[Gradle] Implement test Kotlin Native Link with cycle in dependency constraints
... to cover KT-57531
This commit is contained in:
committed by
Space Team
parent
0e6da53af8
commit
3f4b37693f
+12
@@ -1130,6 +1130,18 @@ open class HierarchicalMppIT : KGPBaseTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@GradleTest
|
||||
@DisplayName("KT-57531: Kotlin Native Link with cycle in dependency constraints")
|
||||
fun `test Kotlin Native Link with cycle in dependency constraints`(gradleVersion: GradleVersion) {
|
||||
project("kt-57531-KotlinNativeLink-with-cycle-in-dependency-constraints", gradleVersion) {
|
||||
build("publish")
|
||||
build("assemble") {
|
||||
assertTasksExecuted(":consumer:linkDebugExecutableLinuxX64")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun TestProject.testDependencyTransformations(
|
||||
subproject: String? = null,
|
||||
check: BuildResult.(reports: Iterable<DependencyTransformationReport>) -> Unit
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
linuxX64 {
|
||||
binaries {
|
||||
executable()
|
||||
}
|
||||
}
|
||||
sourceSets.commonMain.get().dependencies {
|
||||
implementation("org.jetbrains.sample:p2:1.0.0")
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
object ConsumerCommonMain {
|
||||
init {
|
||||
P1CommonMain
|
||||
P2CommonMain
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
ConsumerCommonMain
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
group = "org.jetbrains.sample"
|
||||
version = "1.0.0"
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven(rootProject.buildDir.resolve("repo"))
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
||||
kotlin {
|
||||
jvm()
|
||||
linuxX64()
|
||||
linuxArm64()
|
||||
targetHierarchy.default()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
constraints {
|
||||
kotlin.sourceSets.all {
|
||||
val apiConfiguration = configurations.getByName(apiConfigurationName)
|
||||
apiConfiguration(project(":p2"))
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
object P1CommonMain
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
group = "org.jetbrains.sample"
|
||||
version = "1.0.0"
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven(rootProject.buildDir.resolve("repo"))
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
||||
kotlin {
|
||||
jvm()
|
||||
linuxX64()
|
||||
linuxArm64()
|
||||
targetHierarchy.default()
|
||||
|
||||
sourceSets.commonMain.get().dependencies {
|
||||
api(project(":p1"))
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
object P2CommonMain {
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
maven(rootProject.projectDir.resolve("build").resolve("repo"))
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
||||
include(":p1")
|
||||
include(":p2")
|
||||
include(":consumer")
|
||||
Reference in New Issue
Block a user