-
Notifications
You must be signed in to change notification settings - Fork 1
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
Document the plugin usage #1
Comments
@bric3 It is working, but the dependency insight report does not show which jar is selected. As you see, here the "Java 8" compatible variant was picked.
In particular: org.gradle.jvm.version = 8 (compatible with: 11) The module GAV itself is still In a stage after that, Gradle chooses one of the variants. In your example it chooses the Java 8 variant as expected. It would be nice, if Gradle has a reporting task built-in to show you the actual artifacts (jars) that are resolved. Unfortunately, it does not have it at the moment. You can write your own simple task for it, to verify that it is working as expected:
Note: Version 0.1 of the plugin does not support the latest release (Guava 29.0). I plan to publish a new plugin version later today. I will also attempt to add a readme to the repository explaining what I wrote here to avoid confusion for other users. |
A new version of the plugin (0.2) has been released and the readme was updated. |
@jjohannes Thank you for your insight. I might have built upon a wrong expectation from the plugin, that it will choose / substitute Also I'm not sure about this though as both only ship one jar. What do you mean (ABI compatibility) ?
|
@bric3 I probably need to explain this a bit better. What the plugin does is effectively merging two versions of Guava (e.g. Each version then has both jars in different variants. And Gradle selects one of them based on which JDK you are targeting. If this information where published with Gradle Module Metadata, it would look like this:
(Guava will most likely publish this in the the next release - google/guava#3683 - and then this plugin would no longer be needed) |
This plugin is mentionned in several blogs and presentations, but declaring it is not enough.
E.g. suppose a project like this, with a transitive dependency to guava
28.1-android
, how to use the plugin to select the jre variant, knowing this project will run on the JVM.dep insight
For now the simpliest solution is to declare the dependency itself.
But then it requires more manual intervention to align the version with the transitive one. E.g. if trnasitive is bumped to 30, this require to bump this dependency as well.
I've seen the substution DSL, but this requires more lines, and suffer from the same drawback, I need to set the version.
The text was updated successfully, but these errors were encountered: