diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 76b586e..12f6d82 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -16,6 +16,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin + # Java 11 for Gradle 6.x support java-version: | 11 17 diff --git a/build.gradle.kts b/build.gradle.kts index 33e04c6..21e7b0e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,6 +7,7 @@ group = "org.gradlex" version = "1.12" java { + toolchain.languageVersion = JavaLanguageVersion.of(17) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } @@ -14,7 +15,7 @@ java { dependencies { implementation("org.ow2.asm:asm:9.8") - testImplementation("org.spockframework:spock-core:2.3-groovy-3.0") + testImplementation("org.spockframework:spock-core:2.3-groovy-4.0") testRuntimeOnly("org.junit.platform:junit-platform-launcher") } @@ -39,7 +40,7 @@ tasks.test { maxParallelForks = 4 } -listOf("6.8.3", "6.9.2", "7.0.2", "7.6.1").forEach { gradleVersionUnderTest -> +listOf("6.8.3", "6.9.4", "7.6.5", "8.14.2").forEach { gradleVersionUnderTest -> val testGradle = tasks.register("testGradle$gradleVersionUnderTest") { group = "verification" description = "Runs tests against Gradle $gradleVersionUnderTest" @@ -48,7 +49,9 @@ listOf("6.8.3", "6.9.2", "7.0.2", "7.6.1").forEach { gradleVersionUnderTest -> useJUnitPlatform() maxParallelForks = 4 systemProperty("gradleVersionUnderTest", gradleVersionUnderTest) - javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(11) } + if (gradleVersionUnderTest.startsWith("6")) { + javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(11) } + } } tasks.check { dependsOn(testGradle) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 1b33c55..8bdaf60 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3735f26..68a9cc4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=7197a12f450794931532469d4ff21a59ea2c1cd59a3ec3f89c035c3c420a6999 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip +distributionSha256Sum=5086034b0656a79fee07a04cfadc103984b075ac85d3a20748649671283be1bb +distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-rc-1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 23d15a9..ef07e01 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoPlugin.java b/src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoPlugin.java index 1896ac3..baac551 100644 --- a/src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoPlugin.java +++ b/src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoPlugin.java @@ -16,7 +16,6 @@ package org.gradlex.javamodule.moduleinfo; -import org.gradle.api.NonNullApi; import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.Transformer; @@ -63,7 +62,6 @@ /** * Entry point of the plugin. */ -@NonNullApi public abstract class ExtraJavaModuleInfoPlugin implements Plugin { @Override diff --git a/src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoTransform.java b/src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoTransform.java index 2fb555f..7463c31 100644 --- a/src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoTransform.java +++ b/src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoTransform.java @@ -16,7 +16,6 @@ package org.gradlex.javamodule.moduleinfo; -import org.gradle.api.NonNullApi; import org.gradle.api.artifacts.CacheableRule; import org.gradle.api.artifacts.transform.InputArtifact; import org.gradle.api.artifacts.transform.TransformAction; @@ -82,7 +81,6 @@ * was defined for it. This way we make sure that all Jars are turned into modules. */ @CacheableRule -@NonNullApi public abstract class ExtraJavaModuleInfoTransform implements TransformAction { private static final Pattern MODULE_INFO_CLASS_MRJAR_PATH = Pattern.compile("META-INF/versions/\\d+/module-info.class"); diff --git a/src/main/java/org/gradlex/javamodule/moduleinfo/package-info.java b/src/main/java/org/gradlex/javamodule/moduleinfo/package-info.java new file mode 100644 index 0000000..2e66cf2 --- /dev/null +++ b/src/main/java/org/gradlex/javamodule/moduleinfo/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright the GradleX team. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@NullMarked +package org.gradlex.javamodule.moduleinfo; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/src/main/java/org/gradlex/javamodule/moduleinfo/tasks/package-info.java b/src/main/java/org/gradlex/javamodule/moduleinfo/tasks/package-info.java new file mode 100644 index 0000000..c8081e2 --- /dev/null +++ b/src/main/java/org/gradlex/javamodule/moduleinfo/tasks/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright the GradleX team. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@NullMarked +package org.gradlex.javamodule.moduleinfo.tasks; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/src/test/groovy/org/gradlex/javamodule/moduleinfo/test/RealModuleJarPreservePatchingFunctionalTest.groovy b/src/test/groovy/org/gradlex/javamodule/moduleinfo/test/RealModuleJarPreservePatchingFunctionalTest.groovy index ed055f7..48a29e8 100644 --- a/src/test/groovy/org/gradlex/javamodule/moduleinfo/test/RealModuleJarPreservePatchingFunctionalTest.groovy +++ b/src/test/groovy/org/gradlex/javamodule/moduleinfo/test/RealModuleJarPreservePatchingFunctionalTest.groovy @@ -23,7 +23,7 @@ class RealModuleJarPreservePatchingFunctionalTest extends Specification { ''' } - @IgnoreIf({ GradleBuild.gradleVersionUnderTest?.matches("[67]\\..*") }) // requires Gradle to support Java 17 + @IgnoreIf({ GradleBuild.gradleVersionUnderTest?.startsWith("6") }) // requires Gradle to support Java 17 def "a real module cannot be extended via preserveExisting"() { given: buildFile << '''