[Gradle] Implement commonizer test with isolated jvm subproject
^KT-50592
This commit is contained in:
committed by
Space
parent
8b57675002
commit
32177b2cd2
+2
-2
@@ -294,7 +294,7 @@ abstract class BaseGradleIT {
|
|||||||
open val resourcesRoot = File(resourcesRootFile, "testProject/$resourceDirName")
|
open val resourcesRoot = File(resourcesRootFile, "testProject/$resourceDirName")
|
||||||
val projectDir = File(workingDir.canonicalFile, projectName)
|
val projectDir = File(workingDir.canonicalFile, projectName)
|
||||||
|
|
||||||
open fun setupWorkingDir(enableCacheRedirector: Boolean = true) {
|
open fun setupWorkingDir(enableCacheRedirector: Boolean = true, applyAndroidTestFixes: Boolean = true) {
|
||||||
if (!projectDir.isDirectory || projectDir.listFiles().isEmpty()) {
|
if (!projectDir.isDirectory || projectDir.listFiles().isEmpty()) {
|
||||||
copyRecursively(this.resourcesRoot, workingDir)
|
copyRecursively(this.resourcesRoot, workingDir)
|
||||||
if (addHeapDumpOptions) {
|
if (addHeapDumpOptions) {
|
||||||
@@ -304,7 +304,7 @@ abstract class BaseGradleIT {
|
|||||||
projectDir.toPath().apply {
|
projectDir.toPath().apply {
|
||||||
addPluginManagementToSettings()
|
addPluginManagementToSettings()
|
||||||
if (enableCacheRedirector) enableCacheRedirector()
|
if (enableCacheRedirector) enableCacheRedirector()
|
||||||
applyAndroidTestFixes()
|
if (applyAndroidTestFixes) applyAndroidTestFixes()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
@@ -132,6 +132,17 @@ class CommonizerHierarchicalIT : BaseGradleIT() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `test KT-50592 - isolated jvm subproject - should not fail commonization`() {
|
||||||
|
with(Project("commonize-kt-50592-withIsolatedJvmSubproject")) {
|
||||||
|
setupWorkingDir(applyAndroidTestFixes = false) // Necessary to ensure separated classpath
|
||||||
|
build("commonize") {
|
||||||
|
assertSuccessful()
|
||||||
|
assertTasksExecuted(":commonizeNativeDistribution")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private object Os {
|
private object Os {
|
||||||
private val os = OperatingSystem.current()
|
private val os = OperatingSystem.current()
|
||||||
val canCompileApple get() = os.isMacOsX
|
val canCompileApple get() = os.isMacOsX
|
||||||
|
|||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
allprojects {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("jvm")
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("multiplatform")
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
linuxArm64()
|
||||||
|
linuxX64()
|
||||||
|
|
||||||
|
val commonMain by sourceSets.getting
|
||||||
|
val linuxMain by sourceSets.creating
|
||||||
|
val linuxArm64Main by sourceSets.getting
|
||||||
|
val linuxX64Main by sourceSets.getting
|
||||||
|
|
||||||
|
linuxMain.dependsOn(commonMain)
|
||||||
|
linuxArm64Main.dependsOn(linuxMain)
|
||||||
|
linuxX64Main.dependsOn(linuxMain)
|
||||||
|
}
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
include("jvm")
|
||||||
|
include("multiplatform")
|
||||||
Reference in New Issue
Block a user