Build: Use stripMetadata task for result jar when relocation is enabled

to cleanup invalid metadata left after relocation
This commit is contained in:
Vyacheslav Gerasimov
2019-07-10 18:42:37 +03:00
parent efafb6585e
commit 9b32670738
+7 -1
View File
@@ -189,8 +189,14 @@ addArtifact("archives", sourcesJar)
addArtifact("sources", sourcesJar) addArtifact("sources", sourcesJar)
val result by task<Jar> { val result by task<Jar> {
val task = if (kotlinBuildProperties.proguard) proguard else reflectShadowJar val task = when {
kotlinBuildProperties.proguard -> proguard
kotlinBuildProperties.relocation -> stripMetadata
else -> reflectShadowJar
}
dependsOn(task) dependsOn(task)
from { from {
zipTree(task.outputs.files.singleFile) zipTree(task.outputs.files.singleFile)
} }