diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec5ce79b..25b82ef3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,14 +14,14 @@ jobs: os: [ ubuntu-latest, windows-latest ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: 17 - - uses: gradle/wrapper-validation-action@v1 + java-version: 21 + - uses: gradle/wrapper-validation-action@v2 - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 - name: Execute Gradle build run: ./gradlew build diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index b2484339..f7114084 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -23,5 +23,5 @@ repositories { } dependencies { - implementation("com.gradle.publish:plugin-publish-plugin:1.2.0") + implementation("com.gradle.publish:plugin-publish-plugin:1.2.1") } \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 028dc4d8..7f74eed8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,7 +17,7 @@ plugins { jacoco id("me.champeau.buildscan-recipes") version "0.2.3" - id("org.nosphere.apache.rat") version "0.8.0" + id("org.nosphere.apache.rat") version "0.8.1" id("net.nemerosa.versioning") version "3.0.0" id("com.github.kt3k.coveralls") version "2.12.2" id("me.champeau.convention-test") diff --git a/gradle.properties b/gradle.properties index 62302cb6..bd4e2126 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,10 +6,10 @@ project_website=https://github.com/melix/jmh-gradle-plugin project_issues=https://github.com/melix/jmh-gradle-plugin/issues project_vcs=https://github.com/melix/jmh-gradle-plugin.git -jacocoVersion = 0.8.10 +jacocoVersion = 0.8.11 jmhVersion = 1.37 shadowVersion = 7.1.2 -shadowForkVersion = 8.1.3 +shadowForkVersion = 8.1.5 spockVersion = 2.3-groovy-3.0 org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e093..a80b22ce 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/samples/simple-java/groovy-dsl/build.gradle b/samples/simple-java/groovy-dsl/build.gradle index c47192b7..a535502a 100644 --- a/samples/simple-java/groovy-dsl/build.gradle +++ b/samples/simple-java/groovy-dsl/build.gradle @@ -15,7 +15,7 @@ */ plugins { id 'java-library' - id "me.champeau.jmh" version "0.7.1" + id "me.champeau.jmh" version "0.7.2" } repositories { @@ -23,7 +23,7 @@ repositories { } dependencies { - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' } diff --git a/samples/simple-java/kotlin-dsl/build.gradle.kts b/samples/simple-java/kotlin-dsl/build.gradle.kts index d4536668..aaec9bfe 100644 --- a/samples/simple-java/kotlin-dsl/build.gradle.kts +++ b/samples/simple-java/kotlin-dsl/build.gradle.kts @@ -15,7 +15,7 @@ */ plugins { `java-library` - id("me.champeau.jmh") version "0.7.1" + id("me.champeau.jmh") version "0.7.2" } repositories { @@ -23,7 +23,7 @@ repositories { } dependencies { - testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0") + testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") } diff --git a/settings.gradle.kts b/settings.gradle.kts index 78076e76..7aab2572 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -23,8 +23,8 @@ pluginManagement { } plugins { - id("com.gradle.enterprise") version "3.14.1" - id("org.gradle.toolchains.foojay-resolver-convention") version "0.6.0" + id("com.gradle.enterprise") version "3.16.2" + id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" } gradleEnterprise { diff --git a/src/funcTest/groovy/me/champeau/jmh/AbstractFuncSpec.groovy b/src/funcTest/groovy/me/champeau/jmh/AbstractFuncSpec.groovy index c59bd12b..10dfa444 100644 --- a/src/funcTest/groovy/me/champeau/jmh/AbstractFuncSpec.groovy +++ b/src/funcTest/groovy/me/champeau/jmh/AbstractFuncSpec.groovy @@ -51,6 +51,8 @@ abstract class AbstractFuncSpec extends Specification { testedGradleVersion = gradleVersion } + // TODO: We can remove this and fully enable CC in tests once bump the Shadow version to 8.1.1+. + // TODO: But Kotlin test still fails, it was suppressed in 1bab41646df6f47aea84ea3febeeec1c76cd2e79, need to investigate. protected void withoutConfigurationCache(String reason) { noConfigurationCacheReason = reason } @@ -83,6 +85,7 @@ abstract class AbstractFuncSpec extends Specification { .withPluginClasspath() .withProjectDir(projectDir) .withArguments(arguments) + .withTestKitDir(testKitDir) } protected BuildResult build(String... arguments) { @@ -94,13 +97,17 @@ abstract class AbstractFuncSpec extends Specification { } private List calculateArguments(String... arguments) { - def gradleVersionWithConfigurationCache = testedGradleVersion >= GradleVersion.version('6.6') - if (gradleVersionWithConfigurationCache && noConfigurationCacheReason) { - println("Configuration cache disabled: $noConfigurationCacheReason") - } - (gradleVersionWithConfigurationCache && !noConfigurationCacheReason + (!noConfigurationCacheReason ? ['--stacktrace', '--configuration-cache'] : ['--stacktrace']) + (arguments as List) } + + private static File getTestKitDir() { + def gradleUserHome = System.getenv("GRADLE_USER_HOME") + if (!gradleUserHome) { + gradleUserHome = new File(System.getProperty("user.home"), ".gradle").absolutePath + } + return new File(gradleUserHome, "testkit") + } } diff --git a/src/funcTest/groovy/me/champeau/jmh/ParameterSpec.groovy b/src/funcTest/groovy/me/champeau/jmh/ParameterSpec.groovy index 570fe6c7..23ccfde3 100644 --- a/src/funcTest/groovy/me/champeau/jmh/ParameterSpec.groovy +++ b/src/funcTest/groovy/me/champeau/jmh/ParameterSpec.groovy @@ -42,7 +42,7 @@ class ParameterSpec extends AbstractFuncSpec { usingSample("java-project") when: - def result = build("jmhJar", "--configuration-cache") + def result = build("jmhJar") then: result.task(":jmhJar").outcome == SUCCESS @@ -50,7 +50,7 @@ class ParameterSpec extends AbstractFuncSpec { result.output.contains("Calculating task graph as no cached configuration is available for tasks: jmhJar") when: - result = build("jmhJar", "--configuration-cache") + result = build("jmhJar") then: result.task(":jmhJar").outcome == UP_TO_DATE diff --git a/src/funcTest/resources/groovy-project/build.gradle b/src/funcTest/resources/groovy-project/build.gradle index 2b270e4c..499dc621 100644 --- a/src/funcTest/resources/groovy-project/build.gradle +++ b/src/funcTest/resources/groovy-project/build.gradle @@ -23,7 +23,7 @@ repositories { } dependencies { - implementation 'org.codehaus.groovy:groovy-all:3.0.18' + implementation 'org.codehaus.groovy:groovy-all:3.0.20' } jmh { diff --git a/src/funcTest/resources/java-project-with-test-dependencies/build.gradle b/src/funcTest/resources/java-project-with-test-dependencies/build.gradle index fae7a807..5bc1127a 100644 --- a/src/funcTest/resources/java-project-with-test-dependencies/build.gradle +++ b/src/funcTest/resources/java-project-with-test-dependencies/build.gradle @@ -24,7 +24,7 @@ repositories { dependencies { testImplementation 'junit:junit:4.13.2' - testImplementation 'org.apache.commons:commons-lang3:3.13.0' + testImplementation 'org.apache.commons:commons-lang3:3.14.0' } jmh { diff --git a/src/funcTest/resources/kotlin-project/build.gradle b/src/funcTest/resources/kotlin-project/build.gradle index 72f7bec3..d18e460b 100644 --- a/src/funcTest/resources/kotlin-project/build.gradle +++ b/src/funcTest/resources/kotlin-project/build.gradle @@ -18,7 +18,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22' } } diff --git a/src/funcTest/resources/mixed-language-project/build.gradle b/src/funcTest/resources/mixed-language-project/build.gradle index 2b270e4c..499dc621 100644 --- a/src/funcTest/resources/mixed-language-project/build.gradle +++ b/src/funcTest/resources/mixed-language-project/build.gradle @@ -23,7 +23,7 @@ repositories { } dependencies { - implementation 'org.codehaus.groovy:groovy-all:3.0.18' + implementation 'org.codehaus.groovy:groovy-all:3.0.20' } jmh { diff --git a/src/funcTest/resources/scala-forked-shadow-project/build.gradle b/src/funcTest/resources/scala-forked-shadow-project/build.gradle index cdc16d86..73ca741a 100644 --- a/src/funcTest/resources/scala-forked-shadow-project/build.gradle +++ b/src/funcTest/resources/scala-forked-shadow-project/build.gradle @@ -24,7 +24,7 @@ repositories { } dependencies { - implementation 'org.scala-lang:scala-library:2.13.11' + implementation 'org.scala-lang:scala-library:2.13.13' } jmh { diff --git a/src/funcTest/resources/scala-project/build.gradle b/src/funcTest/resources/scala-project/build.gradle index f7a3d71b..8a57729a 100644 --- a/src/funcTest/resources/scala-project/build.gradle +++ b/src/funcTest/resources/scala-project/build.gradle @@ -23,7 +23,7 @@ repositories { } dependencies { - implementation 'org.scala-lang:scala-library:2.13.11' + implementation 'org.scala-lang:scala-library:2.13.13' } jmh { diff --git a/src/funcTest/resources/scala-shadow-project/build.gradle b/src/funcTest/resources/scala-shadow-project/build.gradle index 7faec017..19033395 100644 --- a/src/funcTest/resources/scala-shadow-project/build.gradle +++ b/src/funcTest/resources/scala-shadow-project/build.gradle @@ -24,7 +24,7 @@ repositories { } dependencies { - implementation 'org.scala-lang:scala-library:2.13.11' + implementation 'org.scala-lang:scala-library:2.13.13' } jmh {