Skip to content

Commit bbfa264

Browse files
committed
Minor: Cleanup :prepare:compiler build script
1 parent 3800d57 commit bbfa264

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

prepare/compiler/build.gradle.kts

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,18 @@ plugins {
1010
}
1111

1212
// You can run Gradle with "-Pkotlin.build.proguard=true" to enable ProGuard run on kotlin-compiler.jar (on TeamCity, ProGuard always runs)
13-
val shrink =
14-
findProperty("kotlin.build.proguard")?.toString()?.toBoolean()
15-
?: hasProperty("teamcity")
13+
val shrink = findProperty("kotlin.build.proguard")?.toString()?.toBoolean() ?: hasProperty("teamcity")
1614

1715
val fatJarContents by configurations.creating
18-
1916
val fatJarContentsStripMetadata by configurations.creating
2017
val fatJarContentsStripServices by configurations.creating
21-
val fatJar by configurations.creating
22-
val compilerJar by configurations.creating
18+
2319
val runtimeJar by configurations.creating
2420
val compile by configurations // maven plugin writes pom compile scope from compile configuration by default
2521
val libraries by configurations.creating {
2622
extendsFrom(compile)
2723
}
24+
2825
val trove4jJar by configurations.creating
2926
val ktorNetworkJar by configurations.creating
3027

@@ -88,6 +85,7 @@ dependencies {
8885
}
8986

9087
fatJarContentsStripServices(jpsStandalone()) { includeJars("jps-model") }
88+
9189
fatJarContentsStripMetadata(intellijDep()) { includeJars("oro-2.0.8", "jdom", "log4j" ) }
9290
}
9391

@@ -96,14 +94,12 @@ publish()
9694
noDefaultJar()
9795

9896
val packCompiler by task<ShadowJar> {
99-
configurations = listOf(fatJar)
100-
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
97+
configurations = listOf(fatJarContents)
98+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
10199
destinationDir = File(buildDir, "libs")
102100

103101
setupPublicJar(compilerBaseName, "before-proguard")
104102

105-
from(fatJarContents)
106-
107103
dependsOn(fatJarContentsStripServices)
108104
from {
109105
fatJarContentsStripServices.files.map {
@@ -131,15 +127,15 @@ val proguard by task<ProGuardTask> {
131127
inputs.files(packCompiler.outputs.files.singleFile)
132128
outputs.file(outputJar)
133129

134-
// TODO: remove after dropping compatibility with ant build
130+
libraryjars(mapOf("filter" to "!META-INF/versions/**"), libraries)
131+
132+
printconfiguration("$buildDir/compiler.pro.dump")
133+
134+
// This properties are used by proguard config compiler.pro
135135
doFirst {
136136
System.setProperty("kotlin-compiler-jar-before-shrink", packCompiler.outputs.files.singleFile.canonicalPath)
137137
System.setProperty("kotlin-compiler-jar", outputJar.canonicalPath)
138138
}
139-
140-
libraryjars(mapOf("filter" to "!META-INF/versions/**"), libraries)
141-
142-
printconfiguration("$buildDir/compiler.pro.dump")
143139
}
144140

145141
val pack = if (shrink) proguard else packCompiler

0 commit comments

Comments
 (0)