-
Notifications
You must be signed in to change notification settings - Fork 200
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
Plugin doesn't respect rejectVersionIf
lambda
#906
Comments
can you write it into a minimal sample project? You might consider using jvm-dependency-conflict-resolution for common constraints, like the variant selection. |
Simple project demonstrating the VERSIONS plugin issue. It assumes running Gradle 8.10.1 and Java 17. To see problem run: ./gradlew dependencyUpdates The project is prepared in support of reported issue: ben-manes/gradle-versions-plugin#906
Simple project demonstrating the VERSIONS plugin issue. It assumes running Gradle 8.10.1 and Java 17. To see problem run: ./gradlew dependencyUpdates The project is prepared in support of reported issue: ben-manes/gradle-versions-plugin#906
Simple project demonstrating the VERSIONS plugin issue. It assumes running Gradle 8.10.1 and Java 17. To see problem run: ./gradlew dependencyUpdates The project is prepared in support of reported issue: ben-manes/gradle-versions-plugin#906
Simple project demonstrating the VERSIONS plugin issue. It assumes running Gradle 8.10.1 and Java 17. To see problem run: ./gradlew dependencyUpdates The project is prepared in support of reported issue: ben-manes/gradle-versions-plugin#906
Simple project demonstrating the VERSIONS plugin issue. It assumes running Gradle 8.10.1 and Java 17. To see problem run: ./gradlew dependencyUpdates The project is prepared in support of reported issue: ben-manes/gradle-versions-plugin#906
I made a minimal sample project here: rynkowsg/gradle-versions-plugin-i906. |
I'm not familiar with jvm-dependency-conflict-resolution. Is it something you would apply to the problem shown in the minimal sample project? |
To simplify debugging, I applied the convention plugin to all subprojects so it can be inspected individually: allprojects {
apply(plugin = "demo.versions")
} that led to a small typo via compileClasspath - Compile classpath for 'main'.
+--- org.jetbrains.kotlin:kotlin-stdlib:2.0.20
| \--- org.jetbrains:annotations:13.0
\--- com.google.guava:guava:33.3.0-jvm FAILED The individual modules seems fine in their reports JVMgradle :modules:lib:jvm-library:dU
executing gradlew instead of gradle
> Configure project :
Applying VersionsConventionPlugin to versions-issue
Applying VersionsConventionPlugin to modules
Applying VersionsConventionPlugin to lib
Applying VersionsConventionPlugin to android-library
Applying VersionsConventionPlugin to jvm-library
> Configure project :modules:lib:android-library
Applying AndroidLibraryConventionPlugin to android-library
> Configure project :modules:lib:jvm-library
Applying JvmLibraryConventionPlugin to jvm-library
> Task :modules:lib:jvm-library:dependencyUpdates
------------------------------------------------------------
:modules:lib:jvm-library Project Dependency Updates (report to plain text file)
------------------------------------------------------------
The following dependencies are using the latest milestone version:
- com.google.guava:guava:33.3.0-jre
- org.jetbrains.kotlin:kotlin-build-tools-impl:2.0.20
- org.jetbrains.kotlin:kotlin-compiler-embeddable:2.0.20
- org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.0.20
- org.jetbrains.kotlin:kotlin-native-prebuilt:2.0.20
- org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.0.20
Gradle release-candidate updates:
- Gradle: [8.10.1: UP-TO-DATE] Androidgradle :modules:lib:android-library:dU
executing gradlew instead of gradle
> Configure project :
Applying VersionsConventionPlugin to versions-issue
Applying VersionsConventionPlugin to modules
Applying VersionsConventionPlugin to lib
Applying VersionsConventionPlugin to android-library
Applying VersionsConventionPlugin to jvm-library
> Configure project :modules:lib:android-library
Applying AndroidLibraryConventionPlugin to android-library
> Configure project :modules:lib:jvm-library
Applying JvmLibraryConventionPlugin to jvm-library
> Task :modules:lib:android-library:dependencyUpdates
------------------------------------------------------------
:modules:lib:android-library Project Dependency Updates (report to plain text file)
------------------------------------------------------------
The following dependencies are using the latest milestone version:
- com.google.guava:guava:33.3.0-android
- com.google.testing.platform:android-driver-instrumentation:0.0.9-alpha02
- com.google.testing.platform:android-test-plugin:0.0.9-alpha02
- com.google.testing.platform:core:0.0.9-alpha02
- com.google.testing.platform:launcher:0.0.9-alpha02
The following dependencies have later milestone versions:
- com.android.tools.utp:android-device-provider-ddmlib [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-device-provider-gradle [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-additional-test-output [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-apk-installer [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-coverage [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-device-info [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-emulator-control [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-logcat [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-retention [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-result-listener-gradle [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
Gradle release-candidate updates:
- Gradle: [8.10.1: UP-TO-DATE] The aggregate across all projects is where it seems to combine unintentionally, Aggregategradle :modules:lib:dU
executing gradlew instead of gradle
> Configure project :
Applying VersionsConventionPlugin to versions-issue
Applying VersionsConventionPlugin to modules
Applying VersionsConventionPlugin to lib
Applying VersionsConventionPlugin to android-library
Applying VersionsConventionPlugin to jvm-library
> Configure project :modules:lib:android-library
Applying AndroidLibraryConventionPlugin to android-library
> Configure project :modules:lib:jvm-library
Applying JvmLibraryConventionPlugin to jvm-library
> Task :modules:lib:dependencyUpdates
------------------------------------------------------------
:modules:lib Project Dependency Updates (report to plain text file)
------------------------------------------------------------
The following dependencies are using the latest milestone version:
- com.google.guava:guava:33.3.0-jre
- com.google.testing.platform:android-driver-instrumentation:0.0.9-alpha02
- com.google.testing.platform:android-test-plugin:0.0.9-alpha02
- com.google.testing.platform:core:0.0.9-alpha02
- com.google.testing.platform:launcher:0.0.9-alpha02
- org.jetbrains.kotlin:kotlin-build-tools-impl:2.0.20
- org.jetbrains.kotlin:kotlin-compiler-embeddable:2.0.20
- org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.0.20
- org.jetbrains.kotlin:kotlin-native-prebuilt:2.0.20
- org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.0.20
- org.jetbrains.kotlin:kotlin-stdlib:2.0.20
The following dependencies have later milestone versions:
- com.android.tools.utp:android-device-provider-ddmlib [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-device-provider-gradle [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-additional-test-output [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-apk-installer [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-coverage [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-device-info [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-emulator-control [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-logcat [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-host-retention [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.android.tools.utp:android-test-plugin-result-listener-gradle [31.6.0 -> 31.6.1]
https://developer.android.com/studio/build
- com.google.guava:guava [33.3.0-android -> 33.3.0-jre]
https://github.com/google/guava
Gradle release-candidate updates:
- Gradle: [8.10.1: UP-TO-DATE] When I look at the json report, it seems like it didn't really understand that there were two versions and composed that incorrectly. gron ./modules/lib/build/dependencyUpdates/report.json | rg guava
json.current.dependencies[0].group = "com.google.guava";
json.current.dependencies[0].name = "guava";
json.current.dependencies[0].projectUrl = "https://github.com/google/guava";
json.outdated.dependencies[10].group = "com.google.guava";
json.outdated.dependencies[10].name = "guava";
json.outdated.dependencies[10].projectUrl = "https://github.com/google/guava"; So it seems like something to do with the version mapping logic, since it is atypical to have the same dependency at different versions rather than globally pin it via dependency management. The jvm-dependency-conflict-resolution plugin is just to help avoid the flavor messiness that your convention plugin has to work around, since it would use capabilities to force a rejection when the configuration and dependency were not compatible. That didn't help your case except would have avoided you writing that logic manually. |
It was pointed out in the comment: ben-manes/gradle-versions-plugin#906 (comment)
I made a custom filter, that does two things:
You can find below the convention plugin I used to wrap entire logic related to versions selection.
Convention plugin
I run it against my multi-module Android project and I got result that I do not expect:
If you look at the log attached HERE you will see that all calls of
rejectVersionIf
with current version33.3.0-android
and candidate version33.3.0-jre
, are qualified asGUAVA_DIFFERENT_FLAVORS
, therefore therejectVersionIf
lambda returnstrue
, still at the end the plugin proposes this update.The text was updated successfully, but these errors were encountered: