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:
Alexander Udalov
2020-01-16 09:56:26 +01:00
parent 547865d5c7
commit ae395bda09
+10 -12
View File
@@ -185,26 +185,24 @@ val sourcesJar = tasks.register<Jar>("sourcesJar") {
addArtifact("archives", sourcesJar)
addArtifact("sources", sourcesJar)
val intermediate = when {
kotlinBuildProperties.proguard -> proguard
kotlinBuildProperties.relocation -> stripMetadata
else -> reflectShadowJar
}
val result by task<Jar> {
val task = when {
kotlinBuildProperties.proguard -> proguard
kotlinBuildProperties.relocation -> stripMetadata
else -> reflectShadowJar
}
dependsOn(task)
dependsOn(intermediate)
from {
zipTree(task.get().outputs.files.singleFile)
zipTree(intermediate.get().outputs.files.singleFile)
}
callGroovy("manifestAttributes", manifest, project, "Main")
}
val modularJar by task<Jar> {
dependsOn(proguard)
dependsOn(intermediate)
archiveClassifier.set("modular")
from(zipTree(file(proguardOutput)))
from(zipTree(intermediate.get().outputs.files.single()))
from(zipTree(reflectShadowJar.get().archivePath)) {
include("META-INF/versions/**")
}