[Gradle] Add test for KT-50925
This commit is contained in:
+26
@@ -1946,6 +1946,32 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testResolveMetadataCompileClasspathKt50925() {
|
||||
Project("lib", directoryPrefix = "kt-50925-resolve-metadata-compile-classpath").apply {
|
||||
setupWorkingDir()
|
||||
gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)
|
||||
|
||||
build("publish", options = defaultBuildOptions().copy(enableCompatibilityMetadataVariant = false)) {
|
||||
assertSuccessful()
|
||||
}
|
||||
}
|
||||
|
||||
Project("app", directoryPrefix = "kt-50925-resolve-metadata-compile-classpath").apply {
|
||||
setupWorkingDir()
|
||||
gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)
|
||||
|
||||
testResolveAllConfigurations { unresolvedConfigurations ->
|
||||
assertTrue(unresolvedConfigurations.isEmpty(), "Unresolved configurations: $unresolvedConfigurations")
|
||||
|
||||
assertContains(">> :metadataCompileClasspath --> lib-metadata-1.0.jar")
|
||||
assertContains(">> :metadataCompileClasspath --> subproject-metadata.jar")
|
||||
assertContains(">> :metadataCommonMainCompileClasspath --> lib-metadata-1.0.jar")
|
||||
assertContains(">> :metadataCommonMainCompileClasspath --> subproject-metadata.jar")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun detectNativeEnabledCompilation(): String = when {
|
||||
HostManager.hostIsLinux -> "linuxX64"
|
||||
HostManager.hostIsMingw -> "mingwX64"
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
plugins {
|
||||
kotlin("multiplatform").version("<pluginMarkerVersion>")
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
maven("$rootDir/../repo")
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
linuxArm64()
|
||||
linuxX64()
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
implementation("kt50925:lib:1.0")
|
||||
implementation(project(":subproject"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
include(":subproject")
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
fun app() = 1 + subproject() + publishedLib()
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
linuxArm64()
|
||||
linuxX64()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
fun subproject() = 42
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
plugins {
|
||||
kotlin("multiplatform").version("<pluginMarkerVersion>")
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
group = "kt50925"
|
||||
version = "1.0"
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
linuxX64()
|
||||
linuxArm64()
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven("$rootDir/../repo")
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
fun publishedLib() = 2
|
||||
Reference in New Issue
Block a user