[Gradle] Add MppCompositeBuildIT with host specific targets
... to cover KT-56111
This commit is contained in:
committed by
Space Team
parent
c2e092fe4a
commit
24db9f3680
+28
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.gradle.idea.testFixtures.tcs.*
|
|||||||
import org.jetbrains.kotlin.gradle.testbase.*
|
import org.jetbrains.kotlin.gradle.testbase.*
|
||||||
import org.jetbrains.kotlin.gradle.util.*
|
import org.jetbrains.kotlin.gradle.util.*
|
||||||
import org.junit.jupiter.api.DisplayName
|
import org.junit.jupiter.api.DisplayName
|
||||||
|
import org.junit.jupiter.api.condition.OS
|
||||||
|
|
||||||
@MppGradlePluginTests
|
@MppGradlePluginTests
|
||||||
@DisplayName("Tests for multiplatform with composite builds")
|
@DisplayName("Tests for multiplatform with composite builds")
|
||||||
@@ -150,4 +151,31 @@ class MppCompositeBuildIT : KGPBaseTest() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OsCondition(enabledOnCI = [OS.MAC], supportedOn = [OS.MAC])
|
||||||
|
@GradleTest
|
||||||
|
fun `test - sample2-withHostSpecificTargets - assemble`(gradleVersion: GradleVersion) {
|
||||||
|
val producer = project("mpp-composite-build/sample2-withHostSpecificTargets/producerBuild", gradleVersion)
|
||||||
|
|
||||||
|
project("mpp-composite-build/sample2-withHostSpecificTargets/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:compileKotlinIosX64")
|
||||||
|
assertTasksExecuted(":consumerA:compileKotlinJvm")
|
||||||
|
}
|
||||||
|
|
||||||
|
build("assemble") {
|
||||||
|
assertTasksUpToDate(":consumerA:compileCommonMainKotlinMetadata")
|
||||||
|
assertTasksUpToDate(":consumerA:compileNativeMainKotlinMetadata")
|
||||||
|
assertTasksUpToDate(":consumerA:compileNativeMainKotlinMetadata")
|
||||||
|
assertTasksUpToDate(":consumerA:compileKotlinIosX64")
|
||||||
|
assertTasksUpToDate(":consumerA:compileKotlinJvm")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
@file:Suppress("OPT_IN_USAGE")
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
kotlin("multiplatform")
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
targetHierarchy.default()
|
||||||
|
jvm()
|
||||||
|
iosX64()
|
||||||
|
iosArm64()
|
||||||
|
|
||||||
|
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 ConsumerAIosX64 {
|
||||||
|
init {
|
||||||
|
ProducerACommon
|
||||||
|
ProducerANative
|
||||||
|
ProducerAIosX64
|
||||||
|
}
|
||||||
|
}
|
||||||
+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()
|
||||||
|
iosX64()
|
||||||
|
iosArm64()
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
object ProducerACommon
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
object ProducerAIosX64
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
object ProducerANative
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
dependencyResolutionManagement {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
include(":producerA")
|
||||||
Reference in New Issue
Block a user