Do not run proguard by default, unless "kotlin.build.proguard" is "true"

This commit is contained in:
Alexander Udalov
2017-09-26 17:17:01 +03:00
parent 16a97a8917
commit 77765a8064
+10 -6
View File
@@ -21,8 +21,11 @@ plugins {
`java`
}
// Set to false to disable proguard run on kotlin-compiler.jar. Speeds up the build
val shrink = true
// You can run Gradle with "-Pkotlin.build.proguard=true" to enable ProGuard run on kotlin-compiler.jar (on TeamCity, ProGuard always runs)
val shrink =
findProperty("kotlin.build.proguard")?.toString()?.toBoolean()
?: hasProperty("teamcity")
val compilerManifestClassPath =
"kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar"
@@ -120,11 +123,12 @@ noDefaultJar()
cleanArtifacts()
dist(targetName = compilerBaseName + ".jar",
fromTask = if (shrink) proguard
else packCompiler)
val pack = 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
classifier = ""
}