[Gradle] Implement MppCompositeBuildIT for builds with rootProject.name set
KT-56536
This commit is contained in:
committed by
Space Team
parent
aa8885ddfc
commit
419b0e3e23
+63
@@ -253,4 +253,67 @@ class MppCompositeBuildIT : KGPBaseTest() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@GradleTest
|
||||
fun `test - sample5-KT-56536-rootProject_name - assemble`(gradleVersion: GradleVersion) {
|
||||
val producer = project("mpp-composite-build/sample5-KT-56536-rootProject.name/producerBuild", gradleVersion)
|
||||
|
||||
project("mpp-composite-build/sample5-KT-56536-rootProject.name/consumerBuild", gradleVersion) {
|
||||
settingsGradleKts.toFile().replaceText("<producer_path>", producer.projectPath.toUri().path)
|
||||
build("cleanNativeDistributionCommonization")
|
||||
|
||||
build("assemble") {
|
||||
assertTasksExecuted(":consumerA:compileCommonMainKotlinMetadata")
|
||||
assertTasksExecuted(":consumerA:compileNativeMainKotlinMetadata")
|
||||
assertTasksExecuted(":consumerA:compileNativeMainKotlinMetadata")
|
||||
assertTasksExecuted(":consumerA:compileKotlinLinuxX64")
|
||||
assertTasksExecuted(":consumerA:compileKotlinJvm")
|
||||
}
|
||||
|
||||
build("assemble") {
|
||||
assertTasksUpToDate(":consumerA:compileCommonMainKotlinMetadata")
|
||||
assertTasksUpToDate(":consumerA:compileNativeMainKotlinMetadata")
|
||||
assertTasksUpToDate(":consumerA:compileNativeMainKotlinMetadata")
|
||||
assertTasksUpToDate(":consumerA:compileKotlinLinuxX64")
|
||||
assertTasksUpToDate(":consumerA:compileKotlinJvm")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@GradleTest
|
||||
fun `test - sample5-KT-56536-rootProject_name - ide dependencies`(gradleVersion: GradleVersion) {
|
||||
val producer = project("mpp-composite-build/sample5-KT-56536-rootProject.name/producerBuild", gradleVersion)
|
||||
|
||||
project("mpp-composite-build/sample5-KT-56536-rootProject.name/consumerBuild", gradleVersion) {
|
||||
settingsGradleKts.toFile().replaceText("<producer_path>", producer.projectPath.toUri().path)
|
||||
resolveIdeDependencies(":consumerA") { dependencies ->
|
||||
dependencies["commonMain"].assertMatches(
|
||||
regularSourceDependency("producerBuild::producerA/commonMain"),
|
||||
kotlinStdlibDependencies
|
||||
)
|
||||
|
||||
dependencies["nativeMain"].assertMatches(
|
||||
dependsOnDependency(":consumerA/commonMain"),
|
||||
regularSourceDependency("producerBuild::producerA/commonMain"),
|
||||
regularSourceDependency("producerBuild::producerA/nativeMain"),
|
||||
regularSourceDependency("producerBuild::producerA/linuxMain"),
|
||||
kotlinNativeDistributionDependencies,
|
||||
binaryCoordinates(Regex(".*stdlib-common:.*")) /* KT-56278 */
|
||||
)
|
||||
|
||||
dependencies["linuxMain"].assertMatches(
|
||||
dependencies["nativeMain"],
|
||||
dependsOnDependency(":consumerA/nativeMain"),
|
||||
)
|
||||
|
||||
dependencies["linuxX64Main"].assertMatches(
|
||||
dependsOnDependency(":consumerA/commonMain"),
|
||||
dependsOnDependency(":consumerA/nativeMain"),
|
||||
dependsOnDependency(":consumerA/linuxMain"),
|
||||
projectArtifactDependency(Regular, "producerBuild::producerA", FilePathRegex(".*/linuxX64/main/klib/producerA.klib")),
|
||||
kotlinNativeDistributionDependencies,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
targetHierarchy.default()
|
||||
jvm()
|
||||
linuxX64()
|
||||
linuxArm64()
|
||||
|
||||
sourceSets.commonMain.get().dependencies {
|
||||
implementation("org.jetbrains.sample:producerA:1.0.0-SNAPSHOT")
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
object ConsumerACommon {
|
||||
init {
|
||||
ProducerACommon
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
object ConsumerALinuxX64 {
|
||||
init {
|
||||
ProducerACommon
|
||||
ProducerANative
|
||||
ProducerALinuxX64
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
object ConsumerANative {
|
||||
init {
|
||||
ProducerANative
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
include(":consumerA")
|
||||
|
||||
includeBuild("<producer_path>") {
|
||||
dependencySubstitution {
|
||||
substitute(module("org.jetbrains.sample:producerA")).using(project(":producerA"))
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
|
||||
group = "org.jetbrains.sample"
|
||||
version = "1.0.0-SNAPSHOT"
|
||||
|
||||
kotlin {
|
||||
targetHierarchy.default()
|
||||
jvm()
|
||||
linuxX64()
|
||||
linuxArm64()
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
object ProducerACommon
|
||||
+1
@@ -0,0 +1 @@
|
||||
object ProducerALinuxX64
|
||||
+1
@@ -0,0 +1 @@
|
||||
object ProducerANative
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
rootProject.name = "customProducerName"
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
include(":producerA")
|
||||
Reference in New Issue
Block a user