Skip to content

Commit 3e44233

Browse files
authored
Bump min Gradle requirement to 9.0.0 (#1801)
1 parent 388d35d commit 3e44233

File tree

8 files changed

+20
-21
lines changed

8 files changed

+20
-21
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@ jobs:
1616
# Always test on the latest version and some LTS.
1717
java: [ 17, 24 ]
1818
# Test on the minimum Gradle version and the latest.
19-
gradle: [ 8.11, current ]
20-
exclude:
21-
# Gradle 8.11 doesn't support Java 24.
22-
- gradle: 8.11
23-
java: 24
19+
gradle: [ 9.0.0, current ]
2420
include:
2521
# We just test one JDK version on Windows.
2622
- os: windows-11-arm
27-
gradle: 8.11
23+
gradle: 9.0.0
2824
java: 21
2925
- os: windows-11-arm
3026
gradle: current

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Gradle plugin for creating fat/uber JARs with support for package relocation.
3232
| 8.3.0+ | 8.3 | 8 | [`com.gradleup.shadow`][gradleup's] |
3333
| 9.0.0+ | 8.11 | 11 | [`com.gradleup.shadow`][gradleup's] |
3434
| 9.2.0+ | 8.11 | 17 | [`com.gradleup.shadow`][gradleup's] |
35+
| 9.3.0+ | 9.0 | 17 | [`com.gradleup.shadow`][gradleup's] |
3536

3637

3738

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ kotlin {
3737
compilerOptions {
3838
allWarningsAsErrors = true
3939
// https://docs.gradle.org/current/userguide/compatibility.html#kotlin
40-
apiVersion = KotlinVersion.KOTLIN_2_0 // TODO: upgrade to 2.2 when the min Gradle requirement is 9.0+
40+
apiVersion = KotlinVersion.KOTLIN_2_2
4141
languageVersion = apiVersion
4242
jvmTarget = JvmTarget.fromTarget(libs.versions.jdkRelease.get())
4343
jvmDefault = JvmDefaultMode.NO_COMPATIBILITY
@@ -101,7 +101,7 @@ publishing.publications.withType<MavenPublication>().configureEach {
101101
configurations.named(API_ELEMENTS_CONFIGURATION_NAME) {
102102
attributes.attribute(
103103
GradlePluginApiVersion.GRADLE_PLUGIN_API_VERSION_ATTRIBUTE,
104-
objects.named<GradlePluginApiVersion>("8.11"),
104+
objects.named<GradlePluginApiVersion>("9.0.0"),
105105
)
106106
}
107107

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ dependent libraries into the output jar without incurring the I/O overhead of ex
2929
| 8.3.0+ | 8.3 | 8 | [`com.gradleup.shadow`][gradleup's] |
3030
| 9.0.0+ | 8.11 | 11 | [`com.gradleup.shadow`][gradleup's] |
3131
| 9.2.0+ | 8.11 | 17 | [`com.gradleup.shadow`][gradleup's] |
32+
| 9.3.0+ | 9.0 | 17 | [`com.gradleup.shadow`][gradleup's] |
3233

3334
## Benefits of Shadow
3435

docs/changes/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
- Change the group of `startShadowScripts` from `application` to `other`. ([#1797](https://github.com/GradleUp/shadow/pull/1797))
99
- Update ASM and jdependency to support Java 26. ([#1799](https://github.com/GradleUp/shadow/pull/1799))
10+
- Bump min Gradle requirement to 9.0.0. ([#1801](https://github.com/GradleUp/shadow/pull/1801))
1011

1112
## [9.2.2](https://github.com/GradleUp/shadow/compare/9.2.2) - 2025-09-26
1213

src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/ApplicationPluginTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ class ApplicationPluginTest : BasePluginTest() {
5353
id 'org.gradle.toolchains.foojay-resolver-convention'
5454
}
5555
""".trimIndent(),
56-
runShadowBlock = """
56+
runShadowBlock = $$"""
5757
doFirst {
58-
logger.lifecycle("Running application with JDK ${'$'}{it.javaLauncher.get().metadata.languageVersion.asInt()}")
58+
logger.lifecycle("Running application with JDK ${it.javaLauncher.get().metadata.languageVersion.asInt()}")
5959
}
6060
""".trimIndent(),
6161
)
@@ -95,8 +95,8 @@ class ApplicationPluginTest : BasePluginTest() {
9595
val winScript = path("myapp-shadow/bin/myapp.bat", installPath)
9696

9797
assertThat(unixScript.readText()).contains(
98-
"CLASSPATH=\$APP_HOME/lib/myapp-1.0-all.jar",
99-
"exec \"\$JAVACMD\" \"$@\"",
98+
$$"CLASSPATH=$APP_HOME/lib/myapp-1.0-all.jar",
99+
$$"exec \"$JAVACMD\" \"$@\"",
100100
"DEFAULT_JVM_OPTS='\"--add-opens=java.base/java.lang=ALL-UNNAMED\"'",
101101
)
102102
assertThat(winScript.readText()).contains(

src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginsTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -863,12 +863,12 @@ class JavaPluginsTest : BasePluginTest() {
863863
fun includeFilesInTaskOutputDirectory() {
864864
// Create a build that has a task with jars in the output directory
865865
projectScript.appendText(
866-
"""
866+
$$"""
867867
def createJars = tasks.register('createJars') {
868-
def artifactAJar = file('${artifactAJar.invariantSeparatorsPathString}')
869-
def artifactBJar = file('${artifactBJar.invariantSeparatorsPathString}')
868+
def artifactAJar = file('$${artifactAJar.invariantSeparatorsPathString}')
869+
def artifactBJar = file('$${artifactBJar.invariantSeparatorsPathString}')
870870
inputs.files(artifactAJar, artifactBJar)
871-
def outputDir = file('${'$'}{buildDir}/jars')
871+
def outputDir = file('${buildDir}/jars')
872872
outputs.dir(outputDir)
873873
doLast {
874874
artifactAJar.withInputStream { input ->
@@ -883,7 +883,7 @@ class JavaPluginsTest : BasePluginTest() {
883883
}
884884
}
885885
}
886-
$shadowJarTask {
886+
$$shadowJarTask {
887887
includedDependencies.from(files(createJars).asFileTree)
888888
}
889889
""".trimIndent(),

src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocatorTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ class SimpleRelocatorTest {
8181
includes = listOf("%regex[org/foo/R(\\$.*)?$]"),
8282
)
8383
assertThat(relocator.canRelocatePath("org/foo/R.class")).isTrue()
84-
assertThat(relocator.canRelocatePath("org/foo/R\$string.class")).isTrue()
85-
assertThat(relocator.canRelocatePath("org/foo/R\$layout.class")).isTrue()
84+
assertThat(relocator.canRelocatePath($$"org/foo/R$string.class")).isTrue()
85+
assertThat(relocator.canRelocatePath($$"org/foo/R$layout.class")).isTrue()
8686
assertThat(relocator.canRelocatePath("org/foo/Recording/R.class")).isFalse()
8787
assertThat(relocator.canRelocatePath("org/foo/Recording.class")).isFalse()
88-
assertThat(relocator.canRelocatePath("org/foo/bar/R\$string.class")).isFalse()
88+
assertThat(relocator.canRelocatePath($$"org/foo/bar/R$string.class")).isFalse()
8989
assertThat(relocator.canRelocatePath("org/R.class")).isFalse()
90-
assertThat(relocator.canRelocatePath("org/R\$string.class")).isFalse()
90+
assertThat(relocator.canRelocatePath($$"org/R$string.class")).isFalse()
9191

9292
// Exclude with Regex
9393
relocator = SimpleRelocator(

0 commit comments

Comments
 (0)