Skip to content

Conversation

@RBusarow
Copy link
Contributor

There are several methods for setting a JDK version, but the artifacts check plugin is only parsing the lowest priority method. JavaPluginExtension.targetCompatibility.majorVersion can be set directly, or via the newer javaToolchain functionality. However, in an Android project, the compileOptions.targetCompatibility property has a higher priority, and the options.release property in a JavaCompile task is higher than them both.

Prior to these changes, if a JDK version setting was overwritten by the other methods, the plugin wouldn't catch it. Now it will.

I also made the decision to change ArtifactConfig.javaVersion from a String to an Int. This is because there's ambiguity when the version is a String and it's representing Java 8. In this case, is the string version just "8" or is it "1.8"? The different methods report different versions. Just treating the version as an Int removes that ambiguity.

… when parsing an artifact jdk version

There are several methods for setting a JDK version, but the artifacts check plugin is only parsing the lowest priority method.  `JavaPluginExtension.targetCompatibility.majorVersion` can be set directly, or via the newer `javaToolchain` functionality.  However, in an Android project, the `compileOptions.targetCompatibility` property has a higher priority, and the `options.release` property in a `JavaCompile` task is higher than them both.

Prior to these changes, if a JDK version setting was overwritten by the other methods, the plugin wouldn't catch it.  Now it will.

I also made the decision to change `ArtifactConfig.javaVersion` from a `String` to an `Int`.  This is because there's ambiguity when the version is a String and it's representing Java 8.  In this case, is the string version just `"8"` or is it `"1.8"`?  The different methods report different versions.  Just treating the version as an `Int` removes that ambiguity.
@RBusarow RBusarow marked this pull request as ready for review March 14, 2023 21:19
@RBusarow RBusarow requested review from a team and zach-klippenstein as code owners March 14, 2023 21:19
@RBusarow RBusarow merged commit 407bf70 into main Mar 14, 2023
@RBusarow RBusarow deleted the rick/artifactsDump_jdk_int branch March 14, 2023 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants