-
Notifications
You must be signed in to change notification settings - Fork 464
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
Provisioner can provide dependencies without their transitives #297
Conversation
…heir transitives. Changed EclipseBasedStepBuilder to request dependencies only without transitives. Removed work-around from Eclipse dependency lock-files.
@nedtwigg I think the major issue is to find good method names and decide how far to go about preserving public interfaces. Feel free to make changes or let me know what to do. But I think you have a broader view on these things... |
How about this: public interface Provisioner {
/** Method interface has been extended to {@link Provisioner#provide}. */
public Set<File> provisionWithDependencies(Collection<String> mavenCoordinates);
/** Method interface has been extended to {@link Provisioner#provide}. */
public default Set<File> provisionWithDependencies(String... mavenCoordinates) {
return provisionWithDependencies(Arrays.asList(mavenCoordinates));
}
/** Method interface has been extended to {@link Provisioner#provide}. */
public Set<File> provisionWithoutDependencies(Collection<String> mavenCoordinates);
/** Method interface has been extended to {@link Provisioner#provide}. */
public default Set<File> provisionWithoutDependencies(String... mavenCoordinates) {
return provisionWithoutDependencies(Arrays.asList(mavenCoordinates));
}
}
public class JarState {
public static JarState from(..)
public static JarState fromWithoutTransitives(..) Advantages:
You can still implement them with a I don't foresee a major version bump anywhere in the near or distant future - there's no big technical debt that I see, there's a lot of value in minimizing the amount of infrastructure that we deprecate. |
@nedtwigg How would you do the |
I think you could use your same CompatibleProvisioner trick. private static interface CompatibleProvisioner extends Provisioner {
@Override
@Deprecated
default Set<File> provisionWithDependencies(Collection<String> mavenCoordinates) {
return provide(true, mavenCoordinates);
}
/** Method interface has been extended to {@link Provisioner#provide}. */
@Override
@Deprecated
default Set<File> provisionWithoutDependencies(Collection<String> mavenCoordinates) {
return provide(false, mavenCoordinates);
}
Set<File> provisionWithTransitives(boolean withTransitives, Collection<String> mavenCoordinates);
} But as usual, I missed a valuable property of your existing work, which is that you do So I missed an important part of what you were adding. Adding the no-transitives capability:
For this case, I think it's okay to break only the implementations of So I think your original approach is the best one - apologies for misunderstanding some of the reasoning :) I have a few suggestions that are easiest to describe by pushing code, I'll push in 5 mins. |
…le-time rather than runtime. - Allows us to remove all the CompatibleProvisioner - Renamed `provide(boolean resolveTransitives, ...` to `provisionWithTransitives(boolean withTransitives, ...` This helps to make the boolean parameter less opaque: provisioner.provisionWithTransitives(true, 'artifact') provisioner.provisionWithTransitives(false, 'artifact')
I'm done with my suggestions. Same idea as your original PR, except:
If this looks good to you, feel free to merge. |
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.
When this gets merged, let's not squash it. I think the discussion here was helpful, I'd like to keep it.
@nedtwigg Looks good. Fixed only some minor things in JavaDoc. Thanks for your help. |
Extended Provisioner to provide dependencies either with or without their transitives.
Changed EclipseBasedStepBuilder to request dependencies only without transitives.
Removed work-around from Eclipse dependency lock-files.
The problem had been spotted when switching Groovy-Eclipse to new version supporting Eclipse-Base with the dependency lock.
Please consider this change as an implementation proposal. It is relatively verbose, since I tried to keep the public interfaces unchanged and backward compatible as discussed previously. Maybe this approach can be considered unnecessary for the
Provisioner
.