-
-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to define and publish their own BOM in Mill #4155
Allow users to define and publish their own BOM in Mill #4155
Conversation
This changes the way transitive dependencies, but also transitive BOM dependencies and dependency management, are passed to coursier. Before this commit, Mill was walking its own module graph, and dependencies / BOM dependencies / dep management were manually aggregated beforehand. During dependency resolution, coursier also does such aggregations. Having both Mill and coursier handle that concern could lead to discrepancies. So this commit passes non-processed dependencies / BOM dependencies / dep management as-is to coursier, and lets coursier handle / compose those.
This comment was marked as resolved.
This comment was marked as resolved.
Conflicts: build.mill
Conflicts: build.mill main/package.mill scalalib/src/mill/scalalib/JavaModule.scala scalalib/src/mill/scalalib/PublishModule.scala
Conflicts: build.mill
I think going with this PR as is is fine, we already have a ticket to split out |
The test failure looks pretty stubborn and isnt passing on retries; @alexarchambault do you think it could be caused by the PR? |
Let me check… |
jar: os.Path, | ||
sourcesJar: os.Path, | ||
docJar: os.Path, | ||
jar: Option[os.Path], | ||
sourcesJar: Option[os.Path], | ||
docJar: Option[os.Path], | ||
pom: os.Path, | ||
artifact: Artifact, | ||
extras: Seq[PublishInfo] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see it yet.
jar: os.Path, | ||
sourcesJar: os.Path, | ||
docJar: os.Path, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should rename extras
to publishInfos
or publishData
, since this is no longer "extra" but "the" data.
I'm still investigating, but I can't manage to reproduce the failure locally. Running the test succeeds:
And manually cloning the mockito repository, checking out the commit of the tests, and running this succeeds too:
(these are the two commands ran by the example of the test) |
If the test passes locally I would be fine disabling it in CI |
e.g. mill/example/thirdparty/mockito/build.mill Line 294 in 1c9f6c4
|
Seems the same error |
Put up a PR to disable that test #4393 |
I took the opportunity to simplify the jar handling further. |
Looks good to me, will merge it once green |
This PR allows users to define their own BOMs in Mill, as Mill modules, via a new
BomModule
type.BomModule
inheritsJavaModule
, but has no sources and creates no JARs, only a POM. This PR also ensures one can publishJavaModule
s that have no JAR, like is the case forBomModule
.It adds non-regression tests illustrating various precedence rules of
BomModule
versus external BOMs (bomIvyDeps
) and manual dependency management (viadepManagement
). Note that some cases might feel ambiguous - precedence rules could be changed later on if needed.