Do not run proguard by default, unless "kotlin.build.proguard" is "true"
This commit is contained in:
@@ -21,8 +21,11 @@ plugins {
|
|||||||
`java`
|
`java`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set to false to disable proguard run on kotlin-compiler.jar. Speeds up the build
|
// You can run Gradle with "-Pkotlin.build.proguard=true" to enable ProGuard run on kotlin-compiler.jar (on TeamCity, ProGuard always runs)
|
||||||
val shrink = true
|
val shrink =
|
||||||
|
findProperty("kotlin.build.proguard")?.toString()?.toBoolean()
|
||||||
|
?: hasProperty("teamcity")
|
||||||
|
|
||||||
val compilerManifestClassPath =
|
val compilerManifestClassPath =
|
||||||
"kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar"
|
"kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar"
|
||||||
|
|
||||||
@@ -120,11 +123,12 @@ noDefaultJar()
|
|||||||
|
|
||||||
cleanArtifacts()
|
cleanArtifacts()
|
||||||
|
|
||||||
dist(targetName = compilerBaseName + ".jar",
|
val pack = if (shrink) proguard else packCompiler
|
||||||
fromTask = if (shrink) proguard
|
|
||||||
else packCompiler)
|
|
||||||
|
|
||||||
runtimeJarArtifactBy(proguard, proguard.outputs.files.singleFile) {
|
dist(targetName = compilerBaseName + ".jar",
|
||||||
|
fromTask = pack)
|
||||||
|
|
||||||
|
runtimeJarArtifactBy(pack, pack.outputs.files.singleFile) {
|
||||||
name = compilerBaseName
|
name = compilerBaseName
|
||||||
classifier = ""
|
classifier = ""
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user