Add tests on precise platforms importing
Note the behaviour in 'precisePlatformsWithUnrelatedModuleHmpp': it is incorrect, as set of platforms still contains unrelated platforms. This is because in the current solution, some source-sets (commonMain/commonTest) always receive COMMON platform and then it gets coerced to set of targets actually seen in the project.This helps if projects uses as much targets as current module (like in precisePlatformsHmpp), but fails if it uses more targets than the current module (like in precisePlatformsWithUnrelatedModuleHmppp) The upcoming commits will fix that issue
This commit is contained in:
+71
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* commonMain----
|
||||
* / \
|
||||
* jvmAndLinuxMain \
|
||||
* / \ \
|
||||
* jvm linuxX64 macosX64
|
||||
*
|
||||
* (the tests structure is the same)
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
{{kts_kotlin_plugin_repositories}}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
{{kts_kotlin_plugin_repositories}}
|
||||
}
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform").version("{{kotlin_plugin_version}}")
|
||||
}
|
||||
|
||||
group = "project"
|
||||
version = "1.0"
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
linuxX64()
|
||||
macosX64()
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
}
|
||||
|
||||
val commonTest by getting {
|
||||
dependencies {
|
||||
implementation(kotlin("test-common"))
|
||||
implementation(kotlin("test-annotations-common"))
|
||||
}
|
||||
}
|
||||
|
||||
val jvmAndLinuxMain by creating {
|
||||
dependsOn(commonMain)
|
||||
}
|
||||
|
||||
val jvmAndLinuxTest by creating {
|
||||
dependsOn(commonTest)
|
||||
}
|
||||
|
||||
val jvmMain by getting {
|
||||
dependsOn(jvmAndLinuxMain)
|
||||
}
|
||||
|
||||
val jvmTest by getting {
|
||||
dependsOn(jvmAndLinuxTest)
|
||||
dependencies {
|
||||
implementation(kotlin("test-junit"))
|
||||
}
|
||||
}
|
||||
|
||||
val linuxX64Main by getting {
|
||||
dependsOn(jvmAndLinuxMain)
|
||||
}
|
||||
|
||||
val linuxX64Test by getting {
|
||||
dependsOn(jvmAndLinuxTest)
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
kotlin.mpp.enableGranularSourceSetsMetadata=true
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
{{kts_kotlin_plugin_repositories}}
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "my-app"
|
||||
|
||||
enableFeaturePreview("GRADLE_METADATA")
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* commonMain----
|
||||
* / \
|
||||
* jvmAndLinuxMain \
|
||||
* / \ \
|
||||
* jvm linuxX64 macosX64
|
||||
*
|
||||
* (the tests structure is the same)
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
{{kts_kotlin_plugin_repositories}}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
{{kts_kotlin_plugin_repositories}}
|
||||
}
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform").version("{{kotlin_plugin_version}}")
|
||||
}
|
||||
|
||||
group = "project"
|
||||
version = "1.0"
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
linuxX64()
|
||||
macosX64()
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
}
|
||||
|
||||
val commonTest by getting {
|
||||
dependencies {
|
||||
implementation(kotlin("test-common"))
|
||||
implementation(kotlin("test-annotations-common"))
|
||||
}
|
||||
}
|
||||
|
||||
val jvmAndLinuxMain by creating {
|
||||
dependsOn(commonMain)
|
||||
}
|
||||
|
||||
val jvmAndLinuxTest by creating {
|
||||
dependsOn(commonTest)
|
||||
}
|
||||
|
||||
val jvmMain by getting {
|
||||
dependsOn(jvmAndLinuxMain)
|
||||
}
|
||||
|
||||
val jvmTest by getting {
|
||||
dependsOn(jvmAndLinuxTest)
|
||||
dependencies {
|
||||
implementation(kotlin("test-junit"))
|
||||
}
|
||||
}
|
||||
|
||||
val linuxX64Main by getting {
|
||||
dependsOn(jvmAndLinuxMain)
|
||||
}
|
||||
|
||||
val linuxX64Test by getting {
|
||||
dependsOn(jvmAndLinuxTest)
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
kotlin.mpp.enableGranularSourceSetsMetadata=true
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
{{kts_kotlin_plugin_repositories}}
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "my-app"
|
||||
|
||||
enableFeaturePreview("GRADLE_METADATA")
|
||||
|
||||
include(":submodule")
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
{{kts_kotlin_plugin_repositories}}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
{{kts_kotlin_plugin_repositories}}
|
||||
}
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
js()
|
||||
jvm()
|
||||
}
|
||||
Reference in New Issue
Block a user