Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3761
Fixes #3819
Introduce
runModuleDeps
, the runtime version ofmoduleDeps
andcompileModuleDeps
We introduce
transitiveRunIvyDeps
, the runtime version oftransitiveIvyDeps
, and use it in most places as a replacement forrunIvyDeps
I also flipped the ordering of
transitiveModuleDeps
/transitiveRunModuleDeps
to putthis
on the right/last, to follow the rest of the module resolution logic where "upstream" things come on the left/first in the classpath orderingThere are some behavioral changes, e.g. the A module's direct
compileModuleDeps
no longer end up on yourrunClasspath
, as shown by the change in the test casemill.scalalib.ScalaMultiModuleClasspathsTests.modCompile
. I think the new behavior is more correct than the old one?One (benign?) consequence of this change is that the contents of the various
*run*
tasks now have considerable overlap with the non-run
tasks, e.g.transitiveRunIvyDeps
overlaps withtransitiveIvyDeps
.The way transitive runtime dependencies are now managed, both "
run{Module,Ivy}Dep
of{module,ivy}Dep
" and "{module,ivy}Dep
ofrun{Module,Ivy}Dep
" are both aggregated into the run classpath. I'm not sure if this matches what Maven does (it does according to chatgpt!) but it seems reasonable to meAdded some additional unit tests to cover the new transitive behavior. The whole dependency-wiring stuff is pretty gnarly but hopefully the existing test suite will stop us from breaking too much (especially
mill.scalalib.ScalaMultiModuleClasspathsTests
which is pretty rigorous and we add to).This is a binary-compatible but semantically incompatible change, would be good to get it into 0.12.0
Best reviewed with
Hide Whitespace
enabled