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:
committed by
TeamCityServer
parent
37b5f01a5a
commit
d348efa4c1
@@ -96,7 +96,6 @@ extra["ktorExcludesForDaemon"] = listOf(
|
|||||||
|
|
||||||
// TODO: use "by extra()" syntax where possible
|
// TODO: use "by extra()" syntax where possible
|
||||||
extra["distLibDir"] = project.file(distLibDir)
|
extra["distLibDir"] = project.file(distLibDir)
|
||||||
extra["libsDir"] = project.file(distLibDir)
|
|
||||||
extra["commonLocalDataDir"] = project.file(commonLocalDataDir)
|
extra["commonLocalDataDir"] = project.file(commonLocalDataDir)
|
||||||
extra["ideaSandboxDir"] = project.file(ideaSandboxDir)
|
extra["ideaSandboxDir"] = project.file(ideaSandboxDir)
|
||||||
extra["ideaPluginDir"] = project.file(ideaPluginDir)
|
extra["ideaPluginDir"] = project.file(ideaPluginDir)
|
||||||
|
|||||||
@@ -20,13 +20,14 @@ plugins {
|
|||||||
`java-library`
|
`java-library`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val jarBaseName = property("archivesBaseName") as String
|
||||||
|
|
||||||
configureJavaOnlyToolchain(JdkMajorVersion.JDK_1_6)
|
configureJavaOnlyToolchain(JdkMajorVersion.JDK_1_6)
|
||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
val core = "$rootDir/core"
|
val core = "$rootDir/core"
|
||||||
val relocatedCoreSrc = "$buildDir/core-relocated"
|
val relocatedCoreSrc = "$buildDir/core-relocated"
|
||||||
val libsDir = property("libsDir")
|
|
||||||
|
|
||||||
val proguardDeps by configurations.creating
|
val proguardDeps by configurations.creating
|
||||||
val proguardAdditionalInJars by configurations.creating
|
val proguardAdditionalInJars by configurations.creating
|
||||||
@@ -120,7 +121,7 @@ val reflectShadowJar by task<ShadowJar> {
|
|||||||
val stripMetadata by tasks.registering {
|
val stripMetadata by tasks.registering {
|
||||||
dependsOn(reflectShadowJar)
|
dependsOn(reflectShadowJar)
|
||||||
val inputJar = provider { reflectShadowJar.get().outputs.files.singleFile }
|
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)
|
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> {
|
val proguard by task<CacheableProguardTask> {
|
||||||
dependsOn(stripMetadata)
|
dependsOn(stripMetadata)
|
||||||
|
|
||||||
injars(mapOf("filter" to "!META-INF/versions/**"), stripMetadata.get().outputs.files)
|
injars(mapOf("filter" to "!META-INF/versions/**"), stripMetadata.get().outputs.files)
|
||||||
injars(mapOf("filter" to "!META-INF/**,!**/*.kotlin_builtins"), proguardAdditionalInJars)
|
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))
|
javaLauncher.set(project.getToolchainLauncherFor(JdkMajorVersion.JDK_1_6))
|
||||||
libraryjars(mapOf("filter" to "!META-INF/versions/**"), proguardDeps)
|
libraryjars(mapOf("filter" to "!META-INF/versions/**"), proguardDeps)
|
||||||
|
|||||||
Reference in New Issue
Block a user