Skip to content

Commit 4f206d3

Browse files
committed
Update shadow plugin
1 parent 81e6b00 commit 4f206d3

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

buildSrc/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repositories {
1212
dependencies {
1313
implementation(kotlin("gradle-plugin"))
1414
implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.3.0")
15-
implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0")
15+
implementation("gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0")
1616
implementation("org.gradle:test-retry-gradle-plugin:1.2.1")
1717
compileOnly("com.gradle.enterprise:test-distribution-gradle-plugin:2.0.3")
1818
}

buildSrc/src/main/kotlin/java-library-conventions.gradle.kts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
12
import org.gradle.api.tasks.PathSensitivity.RELATIVE
23

34
plugins {
@@ -163,7 +164,7 @@ tasks.withType<Jar>().configureEach {
163164
into("META-INF")
164165
}
165166
val suffix = archiveClassifier.getOrElse("")
166-
if (suffix.isBlank() || suffix == "all") { // "all" is used by shadow plugin
167+
if (suffix.isBlank() || this is ShadowJar) {
167168
dependsOn(allMainClasses, compileModule)
168169
from("$moduleOutputDir/$javaModuleName") {
169170
include("module-info.class")

buildSrc/src/main/kotlin/shadow-conventions.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ tasks {
4747
shadowJar {
4848
configurations = listOf(shadowed)
4949
exclude("META-INF/maven/**")
50+
excludes.remove("module-info.class")
5051
archiveClassifier.set("")
5152
}
5253
jar {

0 commit comments

Comments
 (0)