@@ -10,21 +10,18 @@ plugins {
10
10
}
11
11
12
12
// 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" )
16
14
17
15
val fatJarContents by configurations.creating
18
-
19
16
val fatJarContentsStripMetadata by configurations.creating
20
17
val fatJarContentsStripServices by configurations.creating
21
- val fatJar by configurations.creating
22
- val compilerJar by configurations.creating
18
+
23
19
val runtimeJar by configurations.creating
24
20
val compile by configurations // maven plugin writes pom compile scope from compile configuration by default
25
21
val libraries by configurations.creating {
26
22
extendsFrom(compile)
27
23
}
24
+
28
25
val trove4jJar by configurations.creating
29
26
val ktorNetworkJar by configurations.creating
30
27
@@ -88,6 +85,7 @@ dependencies {
88
85
}
89
86
90
87
fatJarContentsStripServices(jpsStandalone()) { includeJars(" jps-model" ) }
88
+
91
89
fatJarContentsStripMetadata(intellijDep()) { includeJars(" oro-2.0.8" , " jdom" , " log4j" ) }
92
90
}
93
91
@@ -96,14 +94,12 @@ publish()
96
94
noDefaultJar()
97
95
98
96
val packCompiler by task<ShadowJar > {
99
- configurations = listOf (fatJar )
100
- setDuplicatesStrategy( DuplicatesStrategy .EXCLUDE )
97
+ configurations = listOf (fatJarContents )
98
+ duplicatesStrategy = DuplicatesStrategy .EXCLUDE
101
99
destinationDir = File (buildDir, " libs" )
102
100
103
101
setupPublicJar(compilerBaseName, " before-proguard" )
104
102
105
- from(fatJarContents)
106
-
107
103
dependsOn(fatJarContentsStripServices)
108
104
from {
109
105
fatJarContentsStripServices.files.map {
@@ -131,15 +127,15 @@ val proguard by task<ProGuardTask> {
131
127
inputs.files(packCompiler.outputs.files.singleFile)
132
128
outputs.file(outputJar)
133
129
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
135
135
doFirst {
136
136
System .setProperty(" kotlin-compiler-jar-before-shrink" , packCompiler.outputs.files.singleFile.canonicalPath)
137
137
System .setProperty(" kotlin-compiler-jar" , outputJar.canonicalPath)
138
138
}
139
-
140
- libraryjars(mapOf (" filter" to " !META-INF/versions/**" ), libraries)
141
-
142
- printconfiguration(" $buildDir /compiler.pro.dump" )
143
139
}
144
140
145
141
val pack = if (shrink) proguard else packCompiler
0 commit comments