-
Notifications
You must be signed in to change notification settings - Fork 1.1k
WIP Gradle 9 upgrade #6829
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
base: main
Are you sure you want to change the base?
WIP Gradle 9 upgrade #6829
Conversation
cc2a72d to
429c5b7
Compare
| /** | ||
| * Enables the provided filter for the Meters selected by the predicate. | ||
| * <code>registry.config().meterFilter(MeterFilter.forMeters(id -> id.getName().startsWith("test"), MeterFilter.ignoreTags("ignored")))</code> | ||
| * <code>registry.config().meterFilter(MeterFilter.forMeters(id -> id.getName().startsWith("test"), MeterFilter.ignoreTags("ignored")))</code> |
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 don't understand why this JavaDoc error started happening but it was blocking the build so I fixed it. It looked like the following (although it's for the other JavaDoc with the same issue):
> Task :micrometer-jakarta9:javadoc FAILED
/Users/tludwig/repos/micrometer/micrometer-jakarta9/src/main/java/io/micrometer/jakarta9/instrument/jms/JmsInstrumentation.java:52: error: bad use of '>'
* consumer.setMessageListener(message -> consumeMessage(message));
^
1 error
Maybe it is worth spending more time to figure out what's different in the JavaDoc configuration that's causing this.
| classpath libs.plugin.downloadTask | ||
| classpath libs.plugin.spotless | ||
|
|
||
| if (javaLanguageVersion.asInt() < 17) { |
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 assume the condition here is about the version of the JVM used to run Gradle since this is a dependency for the buildscript (Gradle plugin), and since Gradle 9 requires 17, we don't need such conditionals anymore. I think there may be other places we can simplify things as well. I've also added a gradleJvmVersion variable we can use if we do need to do something conditional on the version of the JVM that Gradle is using.
| apply plugin: 'com.netflix.nebula.publish-verification' | ||
| apply plugin: 'com.netflix.nebula.contacts' | ||
| apply plugin: 'com.netflix.nebula.info' | ||
| apply plugin: 'com.netflix.nebula.project' |
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 stopped applying these because I would get an error like the following, which occurred at the line applying either of these plugins:
A problem occurred evaluating root project 'micrometer'.
> Failed to apply plugin class 'nebula.plugin.info.scm.ScmInfoPlugin'.
> Extension of type 'ScmInfoExtension' does not exist. Currently registered extension types: [ExtraPropertiesExtension, DevelocityConfiguration, LibrariesForLibs, VersionCatalogsExtension, ReleasePluginExtension, ReleaseExtension, NexusPublishExtension]
I could not find anything in the release notes for the plugins about this, but I did find this https://github.com/palantir/gradle-external-publish-plugin/pull/641/files, which seems to indicate we don't need to apply these anymore when applying the maven-publish plugin, which we do before this.
We should confirm we are not missing any functionality we had before.
| // force the stdlib versions to match the plugin version for this sample | ||
| implementation enforcedPlatform('org.jetbrains.kotlin:kotlin-bom') | ||
| // force the stdlib version | ||
| implementation enforcedPlatform('org.jetbrains.kotlin:kotlin-bom:1.7.22') |
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.
The intention here is to run this sample with Kotlin 1.7, but we need to use a more recent plugin version for Gradle 9 compatibility. I hope this achieves that but I'm not certain.
There are some things to work out still. Since one of the motivations to upgrade the build to Gradle 9 was support for building with JDK 25, I've also updated the CI config to have a 25 job. Since Gradle 9 needs to be run with a minimum of 17, we need to utilize the toolchain support to run compilation/tests with a different version than Gradle for versions less than 17, such as our 11 build job.
The BND Gradle plugin appears to not support Gradle 9 yet, so that is a blocker. I've commented out BND related things for the purpose of making progress on other issues upgrading to Gradle 9.
We also seem to have an issue with Kotlin and compatibility with JDK 25.
Some CircleCI executor and job names have been changed for clarity/consistency. The required checks need to be updated.