From e3ae2d6bd6b0c87472790466d5103684d33cff51 Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 23 Jun 2026 09:03:55 +0800 Subject: [PATCH 1/5] Suppress UnstableApiUsage for addVariantsFromConfiguration --- .../jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt index 078004734..737f7bb5c 100644 --- a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt +++ b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt @@ -108,14 +108,14 @@ constructor(private val softwareComponentFactory: SoftwareComponentFactory) : Pl val shadowRuntimeElements = configurations.shadowRuntimeElements val shadowComponent = softwareComponentFactory.adhoc(COMPONENT_NAME) components.add(shadowComponent) - @Suppress("UNCHECKED_CAST") + @Suppress("UNCHECKED_CAST", "UnstableApiUsage") shadowComponent.addVariantsFromConfiguration( shadowRuntimeElements as Provider ) { variant -> variant.mapToMavenScope("runtime") } components.named("java", AdhocComponentWithVariants::class.java) { component -> - @Suppress("UNCHECKED_CAST") + @Suppress("UNCHECKED_CAST", "UnstableApiUsage") component.addVariantsFromConfiguration( shadowRuntimeElements as Provider ) { variant -> From fb8e63accf38374bf90bf5f5ef8a072016754d05 Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 23 Jun 2026 09:12:25 +0800 Subject: [PATCH 2/5] Run check-links job on ubuntu-24.04-arm --- .github/workflows/links.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 708e52d29..aeff00ae1 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -19,7 +19,7 @@ on: jobs: check-links: - runs-on: ubuntu-latest # TODO: https://github.com/UmbrellaDocs/linkspector/issues/149 + runs-on: ubuntu-24.04-arm if: github.event.repository.fork == false steps: - uses: actions/checkout@v7 From 2416e599ff6118efb749a01f792e46b8808dbc4b Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 23 Jun 2026 09:22:03 +0800 Subject: [PATCH 3/5] Tweak the snippet for KMP --- docs/kotlin-plugins/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/kotlin-plugins/README.md b/docs/kotlin-plugins/README.md index 81c036557..339865136 100644 --- a/docs/kotlin-plugins/README.md +++ b/docs/kotlin-plugins/README.md @@ -80,18 +80,17 @@ automatically configure additional tasks for bundling the shadowed JAR for its ` val ktorVersion = "3.1.0" kotlin { - @Suppress("OPT_IN_USAGE") jvm().mainRun { // Optionally, set the main class for `runJvm`. mainClass = "myapp.MainKt" } sourceSets { - val commonMain = getByName("commonMain") { + commonMain { dependencies { implementation("io.ktor:ktor-client-core:$ktorVersion") } } - val jvmMain = getByName("jvmMain") { + jvmMain { dependencies { implementation("io.ktor:ktor-client-okhttp:$ktorVersion") } From 32ec66a7c3af5da37385c609f16699c9f15f23a9 Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 23 Jun 2026 09:26:36 +0800 Subject: [PATCH 4/5] Use latest in versions --- docs/kotlin-plugins/README.md | 16 ++++++---------- docs/publishing/README.md | 14 ++++++-------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/docs/kotlin-plugins/README.md b/docs/kotlin-plugins/README.md index 339865136..977cc2cfe 100644 --- a/docs/kotlin-plugins/README.md +++ b/docs/kotlin-plugins/README.md @@ -43,7 +43,7 @@ Shadow works well for Kotlin JVM projects like Java projects. Here is an example } dependencies { - implementation("io.ktor:ktor-client-okhttp:3.1.0") + implementation("io.ktor:ktor-client-okhttp:latest") } ``` @@ -56,7 +56,7 @@ Shadow works well for Kotlin JVM projects like Java projects. Here is an example } dependencies { - implementation 'io.ktor:ktor-client-okhttp:3.1.0' + implementation 'io.ktor:ktor-client-okhttp:latest' } ``` @@ -77,8 +77,6 @@ automatically configure additional tasks for bundling the shadowed JAR for its ` id("com.gradleup.shadow") } - val ktorVersion = "3.1.0" - kotlin { jvm().mainRun { // Optionally, set the main class for `runJvm`. @@ -87,12 +85,12 @@ automatically configure additional tasks for bundling the shadowed JAR for its ` sourceSets { commonMain { dependencies { - implementation("io.ktor:ktor-client-core:$ktorVersion") + implementation("io.ktor:ktor-client-core:latest") } } jvmMain { dependencies { - implementation("io.ktor:ktor-client-okhttp:$ktorVersion") + implementation("io.ktor:ktor-client-okhttp:latest") } } } @@ -115,8 +113,6 @@ automatically configure additional tasks for bundling the shadowed JAR for its ` id 'com.gradleup.shadow' } - def ktorVersion = "3.1.0" - kotlin { jvm().mainRun { // Optionally, set the main class for `runJvm`. @@ -125,12 +121,12 @@ automatically configure additional tasks for bundling the shadowed JAR for its ` sourceSets { commonMain { dependencies { - implementation "io.ktor:ktor-client-core:$ktorVersion" + implementation "io.ktor:ktor-client-core:latest" } } jvmMain { dependencies { - implementation "io.ktor:ktor-client-okhttp:$ktorVersion" + implementation "io.ktor:ktor-client-okhttp:latest" } } } diff --git a/docs/publishing/README.md b/docs/publishing/README.md index 28028c22b..0f587b741 100644 --- a/docs/publishing/README.md +++ b/docs/publishing/README.md @@ -177,15 +177,14 @@ be manually configured. id("com.gradleup.shadow") } - val retrofitVersion = "2.12.0" dependencies { // This will be bundled in the shadowed JAR and not declared in the POM. - implementation("com.squareup.retrofit2:retrofit:$retrofitVersion") + implementation("com.squareup.retrofit2:retrofit:latest") // This will be excluded from the shadowed JAR but declared as a runtime dependency in `META-INF/MANIFEST.MF` // file's `Class-Path` entry, and also in the POM file. - shadow("com.squareup.retrofit2:converter-java8:$retrofitVersion") + shadow("com.squareup.retrofit2:converter-java8:latest") // This will be excluded from the shadowed JAR and not declared in the POM or `META-INF/MANIFEST.MF`. - compileOnly("com.squareup.retrofit2:converter-scalars:$retrofitVersion") + compileOnly("com.squareup.retrofit2:converter-scalars:latest") } publishing { @@ -219,15 +218,14 @@ be manually configured. id 'com.gradleup.shadow' } - def retrofitVersion = '2.12.0' dependencies { // This will be bundled in the shadowed JAR and not declared in the POM. - implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" + implementation "com.squareup.retrofit2:retrofit:latest" // This will be excluded from the shadowed JAR but declared as a runtime dependency in `META-INF/MANIFEST.MF` // file's `Class-Path` entry, and also in the POM file. - shadow "com.squareup.retrofit2:converter-java8:$retrofitVersion" + shadow "com.squareup.retrofit2:converter-java8:latest" // This will be excluded from the shadowed JAR and not declared in the POM or `META-INF/MANIFEST.MF`. - compileOnly "com.squareup.retrofit2:converter-scalars:$retrofitVersion" + compileOnly "com.squareup.retrofit2:converter-scalars:latest" } publishing { From aa4f09e7910265d067b0ef04fdb8513803d4b0bc Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 23 Jun 2026 09:36:14 +0800 Subject: [PATCH 5/5] Revert "Use latest in versions" This reverts commit 32ec66a7c3af5da37385c609f16699c9f15f23a9. --- docs/kotlin-plugins/README.md | 16 ++++++++++------ docs/publishing/README.md | 14 ++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/docs/kotlin-plugins/README.md b/docs/kotlin-plugins/README.md index 977cc2cfe..339865136 100644 --- a/docs/kotlin-plugins/README.md +++ b/docs/kotlin-plugins/README.md @@ -43,7 +43,7 @@ Shadow works well for Kotlin JVM projects like Java projects. Here is an example } dependencies { - implementation("io.ktor:ktor-client-okhttp:latest") + implementation("io.ktor:ktor-client-okhttp:3.1.0") } ``` @@ -56,7 +56,7 @@ Shadow works well for Kotlin JVM projects like Java projects. Here is an example } dependencies { - implementation 'io.ktor:ktor-client-okhttp:latest' + implementation 'io.ktor:ktor-client-okhttp:3.1.0' } ``` @@ -77,6 +77,8 @@ automatically configure additional tasks for bundling the shadowed JAR for its ` id("com.gradleup.shadow") } + val ktorVersion = "3.1.0" + kotlin { jvm().mainRun { // Optionally, set the main class for `runJvm`. @@ -85,12 +87,12 @@ automatically configure additional tasks for bundling the shadowed JAR for its ` sourceSets { commonMain { dependencies { - implementation("io.ktor:ktor-client-core:latest") + implementation("io.ktor:ktor-client-core:$ktorVersion") } } jvmMain { dependencies { - implementation("io.ktor:ktor-client-okhttp:latest") + implementation("io.ktor:ktor-client-okhttp:$ktorVersion") } } } @@ -113,6 +115,8 @@ automatically configure additional tasks for bundling the shadowed JAR for its ` id 'com.gradleup.shadow' } + def ktorVersion = "3.1.0" + kotlin { jvm().mainRun { // Optionally, set the main class for `runJvm`. @@ -121,12 +125,12 @@ automatically configure additional tasks for bundling the shadowed JAR for its ` sourceSets { commonMain { dependencies { - implementation "io.ktor:ktor-client-core:latest" + implementation "io.ktor:ktor-client-core:$ktorVersion" } } jvmMain { dependencies { - implementation "io.ktor:ktor-client-okhttp:latest" + implementation "io.ktor:ktor-client-okhttp:$ktorVersion" } } } diff --git a/docs/publishing/README.md b/docs/publishing/README.md index 0f587b741..28028c22b 100644 --- a/docs/publishing/README.md +++ b/docs/publishing/README.md @@ -177,14 +177,15 @@ be manually configured. id("com.gradleup.shadow") } + val retrofitVersion = "2.12.0" dependencies { // This will be bundled in the shadowed JAR and not declared in the POM. - implementation("com.squareup.retrofit2:retrofit:latest") + implementation("com.squareup.retrofit2:retrofit:$retrofitVersion") // This will be excluded from the shadowed JAR but declared as a runtime dependency in `META-INF/MANIFEST.MF` // file's `Class-Path` entry, and also in the POM file. - shadow("com.squareup.retrofit2:converter-java8:latest") + shadow("com.squareup.retrofit2:converter-java8:$retrofitVersion") // This will be excluded from the shadowed JAR and not declared in the POM or `META-INF/MANIFEST.MF`. - compileOnly("com.squareup.retrofit2:converter-scalars:latest") + compileOnly("com.squareup.retrofit2:converter-scalars:$retrofitVersion") } publishing { @@ -218,14 +219,15 @@ be manually configured. id 'com.gradleup.shadow' } + def retrofitVersion = '2.12.0' dependencies { // This will be bundled in the shadowed JAR and not declared in the POM. - implementation "com.squareup.retrofit2:retrofit:latest" + implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" // This will be excluded from the shadowed JAR but declared as a runtime dependency in `META-INF/MANIFEST.MF` // file's `Class-Path` entry, and also in the POM file. - shadow "com.squareup.retrofit2:converter-java8:latest" + shadow "com.squareup.retrofit2:converter-java8:$retrofitVersion" // This will be excluded from the shadowed JAR and not declared in the POM or `META-INF/MANIFEST.MF`. - compileOnly "com.squareup.retrofit2:converter-scalars:latest" + compileOnly "com.squareup.retrofit2:converter-scalars:$retrofitVersion" } publishing {