MPP Gradle - Stop using convention mapping for archive name (#4529)
The "archiveFile" property is deprecated on the jar task, and archiveFileName is used in this commit. Also, this fixes an issue in Gradle where convention mapping is incorrectly deserialized from configuraiton cache. Original issue: https://issuetracker.google.com/193558867 Test: testJvmWithJavaConfigurationCache
This commit is contained in:
+15
@@ -146,6 +146,21 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testJvmWithJavaConfigurationCache() =
|
||||
with(Project("mppJvmWithJava", gradleVersionRequirement = GradleVersionRequired.AtLeast("7.1"))) {
|
||||
setupWorkingDir()
|
||||
|
||||
build("jar", options = defaultBuildOptions().copy(configurationCache = true)) {
|
||||
assertSuccessful()
|
||||
}
|
||||
|
||||
build("jar", options = defaultBuildOptions().copy(configurationCache = true)) {
|
||||
assertSuccessful()
|
||||
assertContains("Reusing configuration cache.")
|
||||
}
|
||||
}
|
||||
|
||||
// KT-48241
|
||||
@Test
|
||||
fun testConfigurationCacheJsWithTestDependencies() = with(transformProjectWithPluginsDsl("kotlin-js-project-with-test-dependencies")) {
|
||||
|
||||
-1
@@ -10,7 +10,6 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "com.android.tools.build:gradle:$android_tools_version"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ open class KotlinJvmTarget @Inject constructor(
|
||||
|
||||
project.tasks.withType(Jar::class.java).named(javaPluginConvention.sourceSets.getByName("main").jarTaskName) { javaJar ->
|
||||
(javaJar.source as? ConfigurableFileCollection)?.setFrom(targetJar.map { it.source })
|
||||
javaJar.conventionMapping("archiveName") { targetJar.get().archiveFileName.get() }
|
||||
javaJar.archiveFileName.set(targetJar.flatMap { it.archiveFileName })
|
||||
javaJar.dependsOn(targetJar)
|
||||
javaJar.enabled = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user