Repository: GradleUp/shadow
Pull request #1242 (2025-02-07 09:30:13)

Bump min Java requirement to 11
---

- [x] [CHANGELOG](https://github.com/GradleUp/shadow/blob/main/src/docs/changes/README.md)'s "Unreleased" section has been updated, if applicable.


Goooler: Run `diff shadow-gradle-plugin-9.0.0-beta8-SNAPSHOT.module.before shadow-gradle-plugin-9.0.0-beta8-SNAPSHOT.module.after`:

```diff
23c23
<         "org.gradle.jvm.version": 8,
---
>         "org.gradle.jvm.version": 11,
32,36c32,36
<           "size": 220019,
<           "sha512": "d445551fab7a73ebfb097284540d0d8c2ee4c67ada23b62e85a3feb10c910f4ff7f2bf38f48e70e430e3361eb4b4b02db2728a735534c924b5066c829de76d14",
<           "sha256": "d5ddcddc7c75d407ce69c0f151aae8fdc1a3fa5729b8bb0ec64135e3c2b6bb9d",
<           "sha1": "05f48b3766279f0b895b4a1719c8e2e9f7f6940b",
<           "md5": "534610f3017cbf83c91a9e539e4116be"
---
>           "size": 221090,
>           "sha512": "1fdc000d36db4beecf237091b904b5c3e9fac103726bf9178748f32b915783dcce830e263882e60160e46a4d71e3a1c921a8c02469ab2a138b87c1f6632cdbd1",
>           "sha256": "67e87badd7764c98dda89f85d69422a02ad7b7eb77b332e892bb2affb7815ba4",
>           "sha1": "78755468bce4a6954b1c0e8410bd6615e0eb8f75",
>           "md5": "43d689f27adc2a0ba05b54ed0ae180eb"
78c78
<         "org.gradle.jvm.version": 8,
---
>         "org.gradle.jvm.version": 11,
145,149c145,149
<           "size": 220019,
<           "sha512": "d445551fab7a73ebfb097284540d0d8c2ee4c67ada23b62e85a3feb10c910f4ff7f2bf38f48e70e430e3361eb4b4b02db2728a735534c924b5066c829de76d14",
<           "sha256": "d5ddcddc7c75d407ce69c0f151aae8fdc1a3fa5729b8bb0ec64135e3c2b6bb9d",
<           "sha1": "05f48b3766279f0b895b4a1719c8e2e9f7f6940b",
<           "md5": "534610f3017cbf83c91a9e539e4116be"
---
>           "size": 221090,
>           "sha512": "1fdc000d36db4beecf237091b904b5c3e9fac103726bf9178748f32b915783dcce830e263882e60160e46a4d71e3a1c921a8c02469ab2a138b87c1f6632cdbd1",
>           "sha256": "67e87badd7764c98dda89f85d69422a02ad7b7eb77b332e892bb2affb7815ba4",
>           "sha1": "78755468bce4a6954b1c0e8410bd6615e0eb8f75",
>           "md5": "43d689f27adc2a0ba05b54ed0ae180eb"
```

Patch:
diff --git a/build.gradle.kts b/build.gradle.kts
index ecf92c74..87033637 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,8 +13,8 @@ plugins {
 }
 
 java {
-  sourceCompatibility = JavaVersion.VERSION_1_8
-  targetCompatibility = JavaVersion.VERSION_1_8
+  sourceCompatibility = JavaVersion.VERSION_11
+  targetCompatibility = JavaVersion.VERSION_11
 }
 
 kotlin {
@@ -22,7 +22,7 @@ kotlin {
   compilerOptions {
     // https://docs.gradle.org/current/userguide/compatibility.html#kotlin
     apiVersion = KotlinVersion.KOTLIN_1_8
-    jvmTarget = JvmTarget.JVM_1_8
+    jvmTarget = JvmTarget.JVM_11
     freeCompilerArgs.addAll(
       "-Xjvm-default=all",
     )
diff --git a/src/docs/changes/README.md b/src/docs/changes/README.md
index 83fb71b6..a16a0334 100644
--- a/src/docs/changes/README.md
+++ b/src/docs/changes/README.md
@@ -10,6 +10,7 @@
 **Changed**
 
 - **BREAKING CHANGE:** Mark `RelocatorRemapper` as `internal`. ([#1227](https://github.com/GradleUp/shadow/pull/1227))
+- Bump min Java requirement to 11. ([#1242](https://github.com/GradleUp/shadow/pull/1242))
 
 **Removed**
 


Test patch:
diff --git a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/TransformersTest.kt b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/TransformersTest.kt
index 2ef72bdc..76bf6d3b 100644
--- a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/TransformersTest.kt
+++ b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/TransformersTest.kt
@@ -94,7 +94,6 @@ class TransformersTest : BaseTransformerTest() {
     run(shadowJarTask)
 
     val actualFileBytes = outputShadowJar.use { jar ->
-      @Suppress("Since15")
       jar.getStream(PLUGIN_CACHE_FILE).use { it.readAllBytes() }
     }
     assertThat(actualFileBytes.contentHashCode()).all {
diff --git a/src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/Log4j2PluginsCacheFileTransformerTest.kt b/src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/Log4j2PluginsCacheFileTransformerTest.kt
index c37464df..be119664 100644
--- a/src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/Log4j2PluginsCacheFileTransformerTest.kt
+++ b/src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/Log4j2PluginsCacheFileTransformerTest.kt
@@ -80,7 +80,6 @@ class Log4j2PluginsCacheFileTransformerTest : BaseTransformerTest<Log4j2PluginsC
         if (jarEntry == null) {
           fail("No expected resource in the output jar.")
         } else if (jarEntry.name == PLUGIN_CACHE_FILE) {
-          @Suppress("Since15")
           assertThat(inputStream.readAllBytes().contentHashCode()).all {
             // Hash of the original plugin cache file.
             isNotEqualTo(-2114104185)