Do not pack proguard and stripped jars for kotlin-reflect into compiler zip

kotlin-reflect-proguard.jar has different timestamps and shows
difference on each build for the same sources.

The problem was introduced after migrating to Gradle 7.1 where
`libsDir` parameter was removed (https://docs.gradle.org/current/userguide/upgrading_version_6.html#removal_of_basepluginconvention_libsdir_and_basepluginconvention_distsdir).
After that the same variable started to be resolved to `dist` directory.
So this commit reverts the old behaviour.

^KTI-672 Fixed
This commit is contained in:
Nikolay Krasko
2021-10-21 15:58:16 +03:00
committed by TeamCityServer
parent 37b5f01a5a
commit d348efa4c1
2 changed files with 4 additions and 6 deletions
-1
View File
@@ -96,7 +96,6 @@ extra["ktorExcludesForDaemon"] = listOf(
// TODO: use "by extra()" syntax where possible
extra["distLibDir"] = project.file(distLibDir)
extra["libsDir"] = project.file(distLibDir)
extra["commonLocalDataDir"] = project.file(commonLocalDataDir)
extra["ideaSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaPluginDir"] = project.file(ideaPluginDir)
+4 -5
View File
@@ -20,13 +20,14 @@ plugins {
`java-library`
}
val jarBaseName = property("archivesBaseName") as String
configureJavaOnlyToolchain(JdkMajorVersion.JDK_1_6)
publish()
val core = "$rootDir/core"
val relocatedCoreSrc = "$buildDir/core-relocated"
val libsDir = property("libsDir")
val proguardDeps by configurations.creating
val proguardAdditionalInJars by configurations.creating
@@ -120,7 +121,7 @@ val reflectShadowJar by task<ShadowJar> {
val stripMetadata by tasks.registering {
dependsOn(reflectShadowJar)
val inputJar = provider { reflectShadowJar.get().outputs.files.singleFile }
val outputJar = File("$libsDir/kotlin-reflect-stripped.jar")
val outputJar = fileFrom(base.libsDirectory.asFile.get(), "kotlin-reflect-stripped.jar")
inputs.file(inputJar).withNormalizer(ClasspathNormalizer::class.java)
@@ -138,14 +139,12 @@ val stripMetadata by tasks.registering {
}
}
val proguardOutput = "$libsDir/${property("archivesBaseName")}-proguard.jar"
val proguard by task<CacheableProguardTask> {
dependsOn(stripMetadata)
injars(mapOf("filter" to "!META-INF/versions/**"), stripMetadata.get().outputs.files)
injars(mapOf("filter" to "!META-INF/**,!**/*.kotlin_builtins"), proguardAdditionalInJars)
outjars(proguardOutput)
outjars(fileFrom(base.libsDirectory.asFile.get(), "$jarBaseName-$version-proguard.jar"))
javaLauncher.set(project.getToolchainLauncherFor(JdkMajorVersion.JDK_1_6))
libraryjars(mapOf("filter" to "!META-INF/versions/**"), proguardDeps)