Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 34 additions & 35 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
version: 2.1

executors:
jdk24-executor:
jdk25-executor:
working_directory: ~/micrometer
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
resource_class: medium+
docker:
- image: cimg/openjdk:24.0.2
circle-jdk-executor:
- image: cimg/openjdk:25.0
jdk21-executor:
working_directory: ~/micrometer
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1g -XX:+HeapDumpOnOutOfMemoryError"'
resource_class: medium+
docker:
- image: cimg/openjdk:21.0.8
circle-jdk17-executor:
jdk17-executor:
working_directory: ~/micrometer
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1g -XX:+HeapDumpOnOutOfMemoryError"'
resource_class: medium+
docker:
- image: cimg/openjdk:17.0.16
circle-jdk11-executor:
working_directory: ~/micrometer
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1g -XX:+HeapDumpOnOutOfMemoryError"'
resource_class: medium+
docker:
- image: cimg/openjdk:11.0.28
machine-executor:
working_directory: ~/micrometer
machine:
Expand All @@ -41,6 +34,9 @@ commands:
command:
type: string
default: 'build'
toolchainVersion:
type: string
default: ''
steps:
- checkout
- restore_cache:
Expand All @@ -54,7 +50,7 @@ commands:
- ~/.gradle
- run:
name: run gradle command
command: ./gradlew << parameters.command >>
command: ./gradlew << parameters.command >> -PtoolchainVersion=<< parameters.toolchainVersion >>
- run:
name: collect test reports
when: always
Expand All @@ -67,32 +63,35 @@ commands:
path: ~/micrometer/test-results/

jobs:
build-jdk24:
executor: jdk24-executor
build-jdk25:
executor: jdk25-executor
steps:
- gradlew-build
- run: ./gradlew generationalShenandoahTest

build:
executor: circle-jdk-executor
build-jdk21:
executor: jdk21-executor
steps:
- gradlew-build
- run: ./gradlew shenandoahTest
- run: ./gradlew zgcTest
- run: ./gradlew zgcGenerationalTest
- gradlew-build:
toolchainVersion: '21'
- run: ./gradlew shenandoahTest -PtoolchainVersion=21
- run: ./gradlew zgcTest -PtoolchainVersion=21
- run: ./gradlew zgcGenerationalTest -PtoolchainVersion=21

build-jdk11:
executor: circle-jdk11-executor
executor: jdk25-executor
steps:
- gradlew-build
- gradlew-build:
toolchainVersion: '11'

build-jdk17:
executor: circle-jdk17-executor
executor: jdk17-executor
steps:
- gradlew-build
- gradlew-build:
toolchainVersion: '17'

concurrency-tests:
executor: circle-jdk-executor
executor: jdk25-executor
steps:
- gradlew-build:
command: jcstress
Expand All @@ -104,7 +103,7 @@ jobs:
command: dockerTest

deploy:
executor: circle-jdk-executor
executor: jdk25-executor
steps:
- checkout
- restore_cache:
Expand All @@ -114,7 +113,7 @@ jobs:
command: sh ./gradle/deploy.sh

stackdriver-it:
executor: circle-jdk-executor
executor: jdk25-executor
steps:
- run:
name: Setup Google Cloud auth
Expand All @@ -128,10 +127,10 @@ workflows:
version: 2
build_prs_deploy_snapshots:
jobs:
- build
- build-jdk11
- build-jdk17
- build-jdk24
- build-jdk21
- build-jdk25
- concurrency-tests
- docker-tests
- stackdriver-it:
Expand All @@ -146,10 +145,10 @@ workflows:
context:
- deploy
requires:
- build
- build-jdk11
- build-jdk17
- build-jdk24
- build-jdk21
- build-jdk25
- concurrency-tests
- docker-tests
filters:
Expand All @@ -159,7 +158,7 @@ workflows:
- /\d+\.\d+\.x/
build_deploy_releases:
jobs:
- build:
- build-jdk21:
filters:
branches:
ignore: /.*/
Expand All @@ -177,7 +176,7 @@ workflows:
ignore: /.*/
tags:
only: /^v\d+\.\d+\.\d+(-(RC|M)\d+)?$/
- build-jdk24:
- build-jdk25:
filters:
branches:
ignore: /.*/
Expand Down Expand Up @@ -207,10 +206,10 @@ workflows:
context:
- deploy
requires:
- build
- build-jdk11
- build-jdk17
- build-jdk24
- build-jdk21
- build-jdk25
- concurrency-tests
- docker-tests
filters:
Expand Down
38 changes: 16 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
buildscript {
ext.javaLanguageVersion = JavaLanguageVersion.of(JavaVersion.current().isJava11Compatible() ? JavaVersion.current().getMajorVersion() : 17)
ext.gradleJvmVersion = JavaLanguageVersion.of(JavaVersion.current().getMajorVersion())
ext.javaLanguageVersion = project.hasProperty('toolchainVersion') && project.property('toolchainVersion') != '' ? JavaLanguageVersion.of(project.property('toolchainVersion') as int) : gradleJvmVersion
ext.javaTargetVersion = JavaVersion.VERSION_1_8

repositories {
Expand All @@ -20,12 +21,7 @@ buildscript {
classpath libs.plugin.japicmp
classpath libs.plugin.downloadTask
classpath libs.plugin.spotless

if (javaLanguageVersion.asInt() < 17) {
Copy link
Member Author

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.

classpath libs.plugin.bnd
} else {
classpath libs.plugin.bndForJava17
}
classpath libs.plugin.bnd

constraints {
classpath(libs.asmForPlugins) {
Expand Down Expand Up @@ -164,9 +160,9 @@ subprojects {

toolchain {
languageVersion = javaLanguageVersion
sourceCompatibility = javaTargetVersion
targetCompatibility = javaTargetVersion
}
sourceCompatibility = javaTargetVersion
targetCompatibility = javaTargetVersion
}

// Dependencies for all projects that are not transitive to consumers of our modules
Expand Down Expand Up @@ -373,11 +369,9 @@ subprojects {
apply plugin: 'com.netflix.nebula.maven-apache-license'
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'
Copy link
Member Author

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.


if (project.name != 'micrometer-bom') {
apply plugin: 'biz.aQute.bnd.builder'
// apply plugin: 'biz.aQute.bnd.builder'

jar {
manifest.attributes.put('Automatic-Module-Name', project.name.replace('-', '.'))
Expand All @@ -386,20 +380,20 @@ subprojects {
from "$rootDir/NOTICE"
}

bundle {
// workaround for multi-version JARs
// see https://github.com/bndtools/bnd/issues/2227
bnd '''\
-fixupmessages: '^Classes found in the wrong directory: .*'
-exportcontents: io.micrometer.*
'''.stripIndent()
}
// bundle {
// // workaround for multi-version JARs
// // see https://github.com/bndtools/bnd/issues/2227
// bnd '''\
// -fixupmessages: '^Classes found in the wrong directory: .*'
// -exportcontents: io.micrometer.*
// '''.stripIndent()
// }
}

tasks.register("testModules", Exec) {
dependsOn jar
String executablePath = javaToolchains.launcherFor { languageVersion = javaLanguageVersion }.get().executablePath
commandLine "$executablePath", '-p', "$jar.archivePath", '--list-modules'
commandLine "$executablePath", '-p', "$jar.archiveFile", '--list-modules'
standardOutput = new ByteArrayOutputStream()
ignoreExitValue = true

Expand Down Expand Up @@ -502,7 +496,7 @@ nexusPublishing {
}

wrapper {
gradleVersion = '8.14.3'
gradleVersion = '9.1.0'
}

defaultTasks 'build'
8 changes: 0 additions & 8 deletions docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ buildscript {
}

dependencies {
classpath 'io.spring.gradle.antora:spring-antora-plugin:0.0.1'
classpath 'org.antora:gradle-antora-plugin:1.0.0'
}
}

apply plugin: 'java'
apply plugin: 'io.spring.antora.generate-antora-yml'
apply plugin: 'org.antora'

description = 'Micrometer Docs'
Expand Down Expand Up @@ -87,12 +85,6 @@ antora {
]
}

tasks.named('generateAntoraYml') {
asciidocAttributes = project.provider {
return ['micrometer-version': project.version.toString()]
}
}

tasks.create('generateAntoraResources') {
dependsOn 'generateAntoraYml'
}
Expand Down
18 changes: 8 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mongo = "4.11.5"
netty = "4.2.7.Final"
newrelic-api = "5.14.0"
# Kotlin 1.7 sample will fail from OkHttp 4.12.0 due to okio dependency being a Kotlin 1.9 module
okhttp = "4.11.0"
okhttp = "4.12.0"
postgre = "42.7.8"
prometheus = "1.4.1"
prometheusSimpleClient = "0.16.0"
Expand Down Expand Up @@ -216,21 +216,19 @@ wiremockJunit5 = { module = "ru.lanwen.wiremock:wiremock-junit5", version.ref =
# plugin dependencies
plugin-errorprone = { module = "net.ltgt.errorprone:net.ltgt.errorprone.gradle.plugin", version = "4.3.0" }
plugin-license = { module = "gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin", version = "0.16.1" }
plugin-nebulaRelease = { module = "com.netflix.nebula:nebula-release-plugin", version = "18.0.8" }
plugin-nebulaPublishing = { module = "com.netflix.nebula:nebula-publishing-plugin", version = "20.3.0" }
plugin-nebulaProject = { module = "com.netflix.nebula:nebula-project-plugin", version = "10.1.5" }
plugin-nebulaInfo = { module = "com.netflix.nebula:gradle-info-plugin", version = "12.1.6" }
plugin-nebulaRelease = { module = "com.netflix.nebula:nebula-release-plugin", version = "21.0.0" }
plugin-nebulaPublishing = { module = "com.netflix.nebula:nebula-publishing-plugin", version = "22.0.0" }
plugin-nebulaProject = { module = "com.netflix.nebula:nebula-project-plugin", version = "12.0.0" }
plugin-nebulaInfo = { module = "com.netflix.nebula:gradle-info-plugin", version = "15.0.0" }
plugin-noHttp = { module = "io.spring.nohttp:nohttp-gradle", version = "0.0.11" }
plugin-nexusPublish = { module = "io.github.gradle-nexus:publish-plugin", version = "1.3.0" }
plugin-nexusPublish = { module = "io.github.gradle-nexus:publish-plugin", version = "2.0.0" }
plugin-javaformat = { module = "io.spring.javaformat:spring-javaformat-gradle-plugin", version.ref = "spring-javaformat" }
plugin-japicmp = { module = "me.champeau.gradle:japicmp-gradle-plugin", version = "0.4.6" }
plugin-downloadTask = { module = "de.undercouch:gradle-download-task", version = "5.6.0" }
plugin-spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version = "6.25.0" }
plugin-bnd = "biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0"
plugin-bndForJava17 = "biz.aQute.bnd:biz.aQute.bnd.gradle:7.1.0"
plugin-bnd = "biz.aQute.bnd:biz.aQute.bnd.gradle:7.1.0"

[plugins]
kotlin19 = { id = "org.jetbrains.kotlin.jvm", version = "1.9.25" }
kotlin17 = { id = "org.jetbrains.kotlin.jvm", version = "1.7.22" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version = "1.9.25" }
jcstress = { id = "io.github.reyerizo.gradle.jcstress", version = "0.9.0" }
aspectj = { id = 'io.freefair.aspectj.post-compile-weaving', version = '8.14.2' }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion implementations/micrometer-registry-statsd/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.gradleup.shadow' version '8.3.6'
id 'com.gradleup.shadow' version '8.3.9'
}

dependencies {
Expand Down
14 changes: 7 additions & 7 deletions micrometer-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ dependencies {
}
}

publishing {
publications {
nebula(MavenPublication) {
from components.javaPlatform
}
}
}
//publishing {
// publications {
// nebula(MavenPublication) {
// from components.javaPlatform
// }
// }
//}
20 changes: 10 additions & 10 deletions micrometer-commons/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ dependencies {
}

jar {
bundle {
bnd '''\
Import-Package: \
!java.*,\
org.aspectj.*;resolution:=dynamic,\
org.slf4j.*;resolution:=dynamic,\
javax.annotation.*;resolution:=optional;version="${@}",\
*
'''.stripIndent()
}
// bundle {
// bnd '''\
// Import-Package: \
// !java.*,\
// org.aspectj.*;resolution:=dynamic,\
// org.slf4j.*;resolution:=dynamic,\
// javax.annotation.*;resolution:=optional;version="${@}",\
// *
// '''.stripIndent()
// }
}
Loading