-
-
Notifications
You must be signed in to change notification settings - Fork 364
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 customize coursier ResolutionParams #3949
Allow users to customize coursier ResolutionParams #3949
Conversation
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 think you should move the resolutionParams
task into CoursierModule
, since that the place where it should be used. This would also avoid the introduction of new resolutionParams
parameter which the default parameter in various places.
The new task should definitely come with some documentation, since some other customizations seem to affect the final |
What do you mean? |
Oh, I think I see |
(seems the CI error is a flake) |
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.
Looks good to me. I restarted the failed test to see, if it was flakyness.
They can be called in a legit fashion if the newly added non-mandatory argument isn't passed
coursier [`2.1.18`](https://github.com/coursier/coursier/releases/tag/v2.1.18) takes Maven "BOMs" better into account, which can sometimes significantly change the versions (or even the dependencies) selected by coursier (see also the [`2.1.17`](https://github.com/coursier/coursier/releases/tag/v2.1.17) release notes). #3949 offers a way to disable the new way of processing BOMs, if ever that's needed, with ```scala def resolutionParams = Task.Anon { super.resolutionParams().withEnableDependencyOverrides(Some(false)) } ``` coursier-interface is bumped along the way just in case. Its `1.0.24` version uses coursier `2.1.18` under-the-hood (in a hidden proguarded fashion).
This adds a
JavaModule#resolutionParams
task, allowing users to customize coursier'sResolutionParams
. These allow to customize some aspects of dependency resolution.In particular,
ResolutionParams#enableDependencyOverrides
, when set toSome(false)
, disables the recent BOM changes added (and enabled by default) in coursier2.1.17
. This might be useful, if ever users aren't happy with the versions it selects, or want to wait a bit before enabling that, or if they find out performance suffers because of it for them.The new task is anonymous (it's not a target, it's not serialized on disk), as
ResolutionParams
has a field that doesn't easily lend itself to serialization (rules
, because of theRule
type, which is an open abstract class).