Do not depend on proguard directly in :kotlin-reflect:modularJar
This is useful if proguard is disabled with -Pkotlin.build.proguard=false.
This commit is contained in:
@@ -185,26 +185,24 @@ val sourcesJar = tasks.register<Jar>("sourcesJar") {
|
|||||||
addArtifact("archives", sourcesJar)
|
addArtifact("archives", sourcesJar)
|
||||||
addArtifact("sources", sourcesJar)
|
addArtifact("sources", sourcesJar)
|
||||||
|
|
||||||
|
val intermediate = when {
|
||||||
|
kotlinBuildProperties.proguard -> proguard
|
||||||
|
kotlinBuildProperties.relocation -> stripMetadata
|
||||||
|
else -> reflectShadowJar
|
||||||
|
}
|
||||||
|
|
||||||
val result by task<Jar> {
|
val result by task<Jar> {
|
||||||
val task = when {
|
dependsOn(intermediate)
|
||||||
kotlinBuildProperties.proguard -> proguard
|
|
||||||
kotlinBuildProperties.relocation -> stripMetadata
|
|
||||||
else -> reflectShadowJar
|
|
||||||
}
|
|
||||||
|
|
||||||
dependsOn(task)
|
|
||||||
|
|
||||||
from {
|
from {
|
||||||
zipTree(task.get().outputs.files.singleFile)
|
zipTree(intermediate.get().outputs.files.singleFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
callGroovy("manifestAttributes", manifest, project, "Main")
|
callGroovy("manifestAttributes", manifest, project, "Main")
|
||||||
}
|
}
|
||||||
|
|
||||||
val modularJar by task<Jar> {
|
val modularJar by task<Jar> {
|
||||||
dependsOn(proguard)
|
dependsOn(intermediate)
|
||||||
archiveClassifier.set("modular")
|
archiveClassifier.set("modular")
|
||||||
from(zipTree(file(proguardOutput)))
|
from(zipTree(intermediate.get().outputs.files.single()))
|
||||||
from(zipTree(reflectShadowJar.get().archivePath)) {
|
from(zipTree(reflectShadowJar.get().archivePath)) {
|
||||||
include("META-INF/versions/**")
|
include("META-INF/versions/**")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user