[Gradle] Fix gradle integration tests after enabling HMPP by default
This commit is contained in:
+2
-2
@@ -95,12 +95,12 @@ open class KotlinAndroid36GradleIT : KotlinAndroid34GradleIT() {
|
||||
":lib:compileReleaseKotlinAndroidLib",
|
||||
":lib:compileKotlinJvmLib",
|
||||
":lib:compileKotlinJsLib",
|
||||
":lib:compileKotlinMetadata",
|
||||
":lib:compileCommonMainKotlinMetadata",
|
||||
":app:compileDebugKotlinAndroidApp",
|
||||
":app:compileReleaseKotlinAndroidApp",
|
||||
":app:compileKotlinJvmApp",
|
||||
":app:compileKotlinJsApp",
|
||||
":app:compileKotlinMetadata",
|
||||
":app:compileCommonMainKotlinMetadata",
|
||||
":lib:compileDebugUnitTestJavaWithJavac",
|
||||
":app:compileDebugUnitTestJavaWithJavac"
|
||||
)
|
||||
|
||||
+10
@@ -262,6 +262,8 @@ abstract class BaseGradleIT {
|
||||
val customEnvironmentVariables: Map<String, String> = mapOf(),
|
||||
val dryRun: Boolean = false,
|
||||
val abiSnapshot: Boolean = false,
|
||||
val hierarchicalMPPStructureSupport: Boolean? = null,
|
||||
val enableCompatibilityMetadataVariant: Boolean? = null,
|
||||
)
|
||||
|
||||
enum class ConfigurationCacheProblems {
|
||||
@@ -921,6 +923,14 @@ Finished executing task ':$taskName'|
|
||||
add("-Dkotlin.incremental.classpath.snapshot.enabled=true")
|
||||
}
|
||||
|
||||
if (options.hierarchicalMPPStructureSupport != null) {
|
||||
add("-Pkotlin.mpp.hierarchicalStructureSupport=${options.hierarchicalMPPStructureSupport}")
|
||||
}
|
||||
|
||||
if (options.enableCompatibilityMetadataVariant != null) {
|
||||
add("-Pkotlin.mpp.enableCompatibilityMetadataVariant=${options.enableCompatibilityMetadataVariant}")
|
||||
}
|
||||
|
||||
add("-Dorg.gradle.unsafe.configuration-cache=${options.configurationCache}")
|
||||
add("-Dorg.gradle.unsafe.configuration-cache-problems=${options.configurationCacheProblems.name.toLowerCase()}")
|
||||
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
|
||||
secondProject,
|
||||
listOf("build"),
|
||||
listOf(
|
||||
":compileKotlinMetadata",
|
||||
":compileCommonMainKotlinMetadata",
|
||||
":compileKotlinJvmWithJava",
|
||||
":compileTestKotlinJvmWithJava",
|
||||
":compileKotlinJs",
|
||||
|
||||
+2
-2
@@ -234,8 +234,8 @@ class HierarchicalMppIT : BaseGradleIT() {
|
||||
transformNativeTestProjectWithPluginDsl(projectName, gradleVersion, directoryPrefix).apply {
|
||||
beforePublishing()
|
||||
|
||||
if (withGranularMetadata) {
|
||||
projectDir.resolve("gradle.properties").appendText("kotlin.mpp.enableGranularSourceSetsMetadata=true")
|
||||
if (!withGranularMetadata) {
|
||||
projectDir.resolve("gradle.properties").appendText("kotlin.internal.mpp.hierarchicalStructureByDefault=false")
|
||||
}
|
||||
|
||||
build(
|
||||
|
||||
+8
-8
@@ -16,7 +16,7 @@ import kotlin.test.assertTrue
|
||||
@RunWith(Parameterized::class)
|
||||
internal class HierarchicalStructureOptInMigrationArtifactContentIT : BaseGradleIT() {
|
||||
enum class Mode {
|
||||
FLIPPED_DEFAULT, FLIPPED_DISABLE, NON_FLIPPED_DEFAULT
|
||||
HMPP_BY_DEFAULT, OPT_OUT_HMPP, DISABLE_HMPP_BY_DEFAULT
|
||||
}
|
||||
|
||||
companion object {
|
||||
@@ -39,12 +39,12 @@ internal class HierarchicalStructureOptInMigrationArtifactContentIT : BaseGradle
|
||||
add("clean")
|
||||
add("publish")
|
||||
when (mode) {
|
||||
FLIPPED_DISABLE, FLIPPED_DEFAULT -> add("-Pkotlin.internal.mpp.hierarchicalStructureByDefault=true")
|
||||
NON_FLIPPED_DEFAULT -> {}
|
||||
OPT_OUT_HMPP, HMPP_BY_DEFAULT -> {}
|
||||
DISABLE_HMPP_BY_DEFAULT -> { add("-Pkotlin.internal.mpp.hierarchicalStructureByDefault=false") }
|
||||
}
|
||||
when (mode) {
|
||||
FLIPPED_DISABLE -> add("-Pkotlin.mpp.hierarchicalStructureSupport=false")
|
||||
FLIPPED_DEFAULT, NON_FLIPPED_DEFAULT -> {}
|
||||
OPT_OUT_HMPP -> add("-Pkotlin.mpp.hierarchicalStructureSupport=false")
|
||||
HMPP_BY_DEFAULT, DISABLE_HMPP_BY_DEFAULT -> {}
|
||||
}
|
||||
}.toTypedArray(),
|
||||
) {
|
||||
@@ -55,14 +55,14 @@ internal class HierarchicalStructureOptInMigrationArtifactContentIT : BaseGradle
|
||||
zip.entries().asSequence().toList().map { it.name }
|
||||
}
|
||||
|
||||
if (mode != NON_FLIPPED_DEFAULT) {
|
||||
if (mode != DISABLE_HMPP_BY_DEFAULT) {
|
||||
assertTrue { metadataJarEntries.any { "commonMain" in it } }
|
||||
}
|
||||
|
||||
val hasJvmAndJsMainEntries = metadataJarEntries.any { "jvmAndJsMain" in it }
|
||||
val shouldHaveJvmAndJsMainEntries = when (mode) {
|
||||
FLIPPED_DISABLE, NON_FLIPPED_DEFAULT -> false
|
||||
FLIPPED_DEFAULT -> true
|
||||
OPT_OUT_HMPP, DISABLE_HMPP_BY_DEFAULT -> false
|
||||
HMPP_BY_DEFAULT -> true
|
||||
}
|
||||
assertEquals(shouldHaveJvmAndJsMainEntries, hasJvmAndJsMainEntries)
|
||||
}
|
||||
|
||||
+4
-14
@@ -14,7 +14,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
internal class MppFlagsMigrationIT : BaseGradleIT() {
|
||||
internal data class TestCase(
|
||||
var hierarchiesByDefault: Boolean = false,
|
||||
var hierarchiesByDefault: Boolean? = null,
|
||||
var hierarchiesSupportFlag: Boolean? = null,
|
||||
var granularMetadataFlag: Boolean? = null,
|
||||
var dependencyPropagationFlag: Boolean? = null,
|
||||
@@ -37,52 +37,44 @@ internal class MppFlagsMigrationIT : BaseGradleIT() {
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
private val testCases = buildList {
|
||||
add(TestCase {
|
||||
hierarchiesByDefault = true
|
||||
granularMetadataFlag = null
|
||||
dependencyPropagationFlag = null
|
||||
expectedToPass = true
|
||||
notExpectedPhraseInOutput = "It is safe to remove the property."
|
||||
})
|
||||
add(TestCase {
|
||||
hierarchiesByDefault = true
|
||||
granularMetadataFlag = true
|
||||
expectedToPass = true
|
||||
expectedPhraseInOutput = "It is safe to remove the property."
|
||||
})
|
||||
add(TestCase {
|
||||
hierarchiesByDefault = true
|
||||
granularMetadataFlag = false
|
||||
expectedToPass = false
|
||||
expectedPhraseInOutput = "Multiplatform Hierarchical Structures support is now enabled by default"
|
||||
})
|
||||
add(TestCase {
|
||||
hierarchiesByDefault = true
|
||||
dependencyPropagationFlag = false
|
||||
expectedToPass = true
|
||||
expectedPhraseInOutput = "It is safe to remove the property"
|
||||
})
|
||||
add(TestCase {
|
||||
hierarchiesByDefault = true
|
||||
dependencyPropagationFlag = true
|
||||
expectedToPass = false
|
||||
expectedPhraseInOutput = "Kotlin/Native dependencies commonization is now enabled by default"
|
||||
})
|
||||
add(TestCase {
|
||||
hierarchiesByDefault = true
|
||||
hierarchiesSupportFlag = false
|
||||
granularMetadataFlag = true
|
||||
expectedToPass = false
|
||||
expectedPhraseInOutput = "Conflicting properties"
|
||||
})
|
||||
add(TestCase {
|
||||
hierarchiesByDefault = true
|
||||
hierarchiesSupportFlag = false
|
||||
granularMetadataFlag = false
|
||||
expectedToPass = true
|
||||
expectedPhraseInOutput = "is redundant"
|
||||
})
|
||||
add(TestCase {
|
||||
hierarchiesByDefault = true
|
||||
hierarchiesSupportFlag = false
|
||||
dependencyPropagationFlag = false
|
||||
expectedToPass = false
|
||||
@@ -95,10 +87,8 @@ internal class MppFlagsMigrationIT : BaseGradleIT() {
|
||||
expectedPhraseInOutput = "not yet supported"
|
||||
})
|
||||
add(TestCase {
|
||||
hierarchiesByDefault = false
|
||||
hierarchiesSupportFlag = true
|
||||
expectedToPass = false
|
||||
expectedPhraseInOutput = "not yet supported"
|
||||
expectedToPass = true
|
||||
})
|
||||
}
|
||||
|
||||
@@ -126,8 +116,8 @@ internal class MppFlagsMigrationIT : BaseGradleIT() {
|
||||
fun doTest() {
|
||||
val args = buildList {
|
||||
with(testCase) {
|
||||
if (hierarchiesByDefault)
|
||||
add("-Pkotlin.internal.mpp.hierarchicalStructureByDefault=true")
|
||||
if (hierarchiesByDefault == false)
|
||||
add("-Pkotlin.internal.mpp.hierarchicalStructureByDefault=false")
|
||||
if (hierarchiesSupportFlag != null)
|
||||
add("-Pkotlin.mpp.hierarchicalStructureSupport=$hierarchiesSupportFlag")
|
||||
if (granularMetadataFlag != null)
|
||||
|
||||
+107
-42
@@ -45,35 +45,89 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
private fun Project.targetClassesDir(targetName: String, sourceSetName: String = "main") =
|
||||
classesDir(sourceSet = "$targetName/$sourceSetName")
|
||||
|
||||
private data class HmppFlags(
|
||||
val hmppSupport: Boolean,
|
||||
val enableCompatibilityMetadataArtifact: Boolean,
|
||||
val name: String
|
||||
) {
|
||||
override fun toString() = name
|
||||
}
|
||||
|
||||
private val noHMPP = HmppFlags(
|
||||
name = "No HMPP",
|
||||
hmppSupport = false,
|
||||
enableCompatibilityMetadataArtifact = false
|
||||
)
|
||||
|
||||
private val hmppWoCompatibilityMetadataArtifact = HmppFlags(
|
||||
name = "HMPP without Compatibility Metadata Artifact",
|
||||
hmppSupport = true,
|
||||
enableCompatibilityMetadataArtifact = false
|
||||
)
|
||||
|
||||
private val hmppWithCompatibilityMetadataArtifact = HmppFlags(
|
||||
name = "HMPP with Compatibility Metadata Artifact",
|
||||
hmppSupport = true,
|
||||
enableCompatibilityMetadataArtifact = true
|
||||
)
|
||||
|
||||
private val HmppFlags.buildOptions get() = defaultBuildOptions().copy(
|
||||
hierarchicalMPPStructureSupport = hmppSupport,
|
||||
enableCompatibilityMetadataVariant = enableCompatibilityMetadataArtifact,
|
||||
)
|
||||
|
||||
@Test
|
||||
fun testLibAndApp() = doTestLibAndApp(
|
||||
"sample-lib",
|
||||
"sample-app"
|
||||
"sample-app",
|
||||
hmppWoCompatibilityMetadataArtifact
|
||||
)
|
||||
|
||||
@Test
|
||||
fun testLibAndAppWithoutHMPP() = doTestLibAndApp(
|
||||
"sample-lib",
|
||||
"sample-app",
|
||||
noHMPP
|
||||
)
|
||||
|
||||
@Test
|
||||
fun testLibAndAppWithCompatibilityArtifact() = doTestLibAndApp(
|
||||
"sample-lib",
|
||||
"sample-app",
|
||||
hmppWithCompatibilityMetadataArtifact
|
||||
)
|
||||
|
||||
@Test
|
||||
fun testLibAndAppWithGradleKotlinDsl() = doTestLibAndApp(
|
||||
"sample-lib-gradle-kotlin-dsl",
|
||||
"sample-app-gradle-kotlin-dsl"
|
||||
"sample-app-gradle-kotlin-dsl",
|
||||
hmppWoCompatibilityMetadataArtifact
|
||||
)
|
||||
|
||||
private fun doTestLibAndApp(
|
||||
libProjectName: String,
|
||||
appProjectName: String
|
||||
appProjectName: String,
|
||||
hmppFlags: HmppFlags,
|
||||
) {
|
||||
val libProject = transformNativeTestProjectWithPluginDsl(libProjectName, directoryPrefix = "new-mpp-lib-and-app")
|
||||
val appProject = transformNativeTestProjectWithPluginDsl(appProjectName, directoryPrefix = "new-mpp-lib-and-app")
|
||||
val oldStyleAppProject = Project("sample-old-style-app", directoryPrefix = "new-mpp-lib-and-app")
|
||||
|
||||
val buildOptions = hmppFlags.buildOptions
|
||||
val compileTasksNames =
|
||||
listOf("Jvm6", "NodeJs", "Metadata", "Linux64").map { ":compileKotlin$it" }
|
||||
listOf("Jvm6", "NodeJs", "Linux64").map { ":compileKotlin$it" }
|
||||
|
||||
with(libProject) {
|
||||
build(
|
||||
"publish"
|
||||
"publish",
|
||||
options = buildOptions
|
||||
) {
|
||||
assertSuccessful()
|
||||
assertTasksExecuted(*compileTasksNames.toTypedArray(), ":jvm6Jar", ":nodeJsJar", ":metadataJar")
|
||||
assertTasksExecuted(*compileTasksNames.toTypedArray(), ":jvm6Jar", ":nodeJsJar", ":compileCommonMainKotlinMetadata")
|
||||
|
||||
if (hmppFlags.enableCompatibilityMetadataArtifact) {
|
||||
assertTasksExecuted(":compileKotlinMetadata", ":metadataJar")
|
||||
}
|
||||
|
||||
val groupDir = projectDir.resolve("repo/com/example")
|
||||
val jvmJarName = "sample-lib-jvm6/1.0/sample-lib-jvm6-1.0.jar"
|
||||
@@ -113,7 +167,8 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
Assert.assertTrue("function main(" in compiledJs)
|
||||
|
||||
val metadataJarEntries = ZipFile(groupDir.resolve(metadataJarName)).entries().asSequence().map { it.name }.toSet()
|
||||
Assert.assertTrue("com/example/lib/CommonKt.kotlin_metadata" in metadataJarEntries)
|
||||
val metadataFileFound = "com/example/lib/CommonKt.kotlin_metadata" in metadataJarEntries
|
||||
Assert.assertEquals(hmppFlags.enableCompatibilityMetadataArtifact, metadataFileFound)
|
||||
|
||||
Assert.assertTrue(groupDir.resolve(nativeKlibName).exists())
|
||||
}
|
||||
@@ -142,8 +197,10 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
Assert.assertTrue(resolve("com/example/app/Jdk8ApiUsageKt.class").exists())
|
||||
}
|
||||
|
||||
projectDir.resolve(targetClassesDir("metadata")).run {
|
||||
Assert.assertTrue(resolve("com/example/app/AKt.kotlin_metadata").exists())
|
||||
if (hmppFlags.enableCompatibilityMetadataArtifact) {
|
||||
projectDir.resolve(targetClassesDir("metadata")).run {
|
||||
Assert.assertTrue(resolve("com/example/app/AKt.kotlin_metadata").exists())
|
||||
}
|
||||
}
|
||||
|
||||
projectDir.resolve(targetClassesDir("nodeJs")).resolve("sample-app.js").readText().run {
|
||||
@@ -162,7 +219,8 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
|
||||
build(
|
||||
"assemble",
|
||||
"resolveRuntimeDependencies"
|
||||
"resolveRuntimeDependencies",
|
||||
options = buildOptions
|
||||
) {
|
||||
checkAppBuild()
|
||||
assertTasksExecuted(":resolveRuntimeDependencies") // KT-26301
|
||||
@@ -183,27 +241,30 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
build(
|
||||
"clean",
|
||||
"assemble",
|
||||
"--rerun-tasks"
|
||||
"--rerun-tasks",
|
||||
options = buildOptions
|
||||
) {
|
||||
checkAppBuild()
|
||||
}
|
||||
}
|
||||
|
||||
with(oldStyleAppProject) {
|
||||
setupWorkingDir()
|
||||
gradleBuildScript().appendText("\nallprojects { repositories { maven { url '$libLocalRepoUri' } } }")
|
||||
if (hmppFlags.enableCompatibilityMetadataArtifact) {
|
||||
with(oldStyleAppProject) {
|
||||
setupWorkingDir()
|
||||
gradleBuildScript().appendText("\nallprojects { repositories { maven { url '$libLocalRepoUri' } } }")
|
||||
|
||||
build("assemble") {
|
||||
assertSuccessful()
|
||||
assertTasksExecuted(":app-js:compileKotlin2Js", ":app-jvm:compileKotlin", ":app-common:compileKotlinCommon")
|
||||
build("assemble", options = buildOptions) {
|
||||
assertSuccessful()
|
||||
assertTasksExecuted(":app-js:compileKotlin2Js", ":app-jvm:compileKotlin", ":app-common:compileKotlinCommon")
|
||||
|
||||
assertFileExists(kotlinClassesDir("app-common") + "com/example/app/CommonAppKt.kotlin_metadata")
|
||||
assertFileExists(kotlinClassesDir("app-common") + "com/example/app/CommonAppKt.kotlin_metadata")
|
||||
|
||||
val jvmClassFile = projectDir.resolve(kotlinClassesDir("app-jvm") + "com/example/app/JvmAppKt.class")
|
||||
checkBytecodeContains(jvmClassFile, "CommonKt.id", "MainKt.expectedFun")
|
||||
val jvmClassFile = projectDir.resolve(kotlinClassesDir("app-jvm") + "com/example/app/JvmAppKt.class")
|
||||
checkBytecodeContains(jvmClassFile, "CommonKt.id", "MainKt.expectedFun")
|
||||
|
||||
val jsCompiledFilePath = kotlinClassesDir("app-js") + "app-js.js"
|
||||
assertFileContains(jsCompiledFilePath, "lib.expectedFun", "lib.id")
|
||||
val jsCompiledFilePath = kotlinClassesDir("app-js") + "app-js.js"
|
||||
assertFileContains(jsCompiledFilePath, "lib.expectedFun", "lib.id")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -268,7 +329,6 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
"NodeJs${IR.lowerName.capitalize()}",
|
||||
)
|
||||
}),
|
||||
"Metadata"
|
||||
).map { ":compileKotlin$it" }
|
||||
|
||||
with(libProject) {
|
||||
@@ -277,7 +337,8 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
options = defaultBuildOptions().copy(jsCompilerType = jsCompilerType)
|
||||
) {
|
||||
assertSuccessful()
|
||||
assertTasksExecuted(*compileTasksNames.toTypedArray(), ":metadataJar")
|
||||
assertTasksSkipped(":compileCommonMainKotlinMetadata")
|
||||
assertTasksExecuted(*compileTasksNames.toTypedArray(), ":allMetadataJar")
|
||||
|
||||
val groupDir = projectDir.resolve("repo/com/example")
|
||||
val jsExtension = if (jsCompilerType == LEGACY) "jar" else "klib"
|
||||
@@ -317,9 +378,6 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
}
|
||||
BOTH -> {}
|
||||
}
|
||||
|
||||
val metadataJarEntries = ZipFile(groupDir.resolve(metadataJarName)).entries().asSequence().map { it.name }.toSet()
|
||||
Assert.assertTrue("com/example/lib/CommonKt.kotlin_metadata" in metadataJarEntries)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,17 +394,10 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
val compileTaskNames = if (jsCompilerType == compilerType) {
|
||||
compileTasksNames.toTypedArray()
|
||||
} else {
|
||||
arrayOf(
|
||||
":compileKotlinNodeJs",
|
||||
":compileKotlinMetadata"
|
||||
)
|
||||
arrayOf(":compileKotlinNodeJs")
|
||||
}
|
||||
assertTasksExecuted(*compileTaskNames)
|
||||
|
||||
projectDir.resolve(targetClassesDir("metadata")).run {
|
||||
Assert.assertTrue(resolve("com/example/app/AKt.kotlin_metadata").exists())
|
||||
}
|
||||
|
||||
if (jsCompilerType == LEGACY) {
|
||||
projectDir.resolve(targetClassesDir("nodeJs")).resolve("sample-app.js").readText().run {
|
||||
Assert.assertTrue(contains("console.info"))
|
||||
@@ -715,7 +766,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
""".trimIndent()
|
||||
)
|
||||
|
||||
listOf("compileKotlinMetadata", "compileKotlinJvm6", "compileKotlinNodeJs").forEach {
|
||||
listOf("compileCommonMainKotlinMetadata", "compileKotlinJvm6", "compileKotlinNodeJs").forEach {
|
||||
build(it) {
|
||||
assertSuccessful()
|
||||
assertTasksExecuted(":$it")
|
||||
@@ -743,7 +794,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
)
|
||||
|
||||
listOf(
|
||||
"compileKotlinMetadata", "compileKotlinJvm6", "compileKotlinNodeJs", "compileKotlinLinux64"
|
||||
"compileCommonMainKotlinMetadata", "compileKotlinJvm6", "compileKotlinNodeJs", "compileKotlinLinux64"
|
||||
).forEach {
|
||||
build(it) {
|
||||
assertSuccessful()
|
||||
@@ -768,7 +819,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
""".trimIndent()
|
||||
)
|
||||
|
||||
listOf("compileKotlinMetadata", "compileKotlinJvm6", "compileKotlinNodeJs").forEach {
|
||||
listOf("compileCommonMainKotlinMetadata", "compileKotlinJvm6", "compileKotlinNodeJs").forEach {
|
||||
build(it) {
|
||||
assertSuccessful()
|
||||
assertTasksExecuted(":$it")
|
||||
@@ -909,13 +960,26 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testResolveJsPartOfMppLibDependencyToMetadata() {
|
||||
fun testResolveJsPartOfMppLibDependencyToMetadataWithHmpp() =
|
||||
testResolveJsPartOfMppLibDependencyToMetadata(hmppWoCompatibilityMetadataArtifact)
|
||||
|
||||
@Test
|
||||
fun testResolveJsPartOfMppLibDependencyToMetadataWithHmppAndCompatibilityMetadataArtifact() =
|
||||
testResolveJsPartOfMppLibDependencyToMetadata(hmppWithCompatibilityMetadataArtifact)
|
||||
|
||||
@Test
|
||||
fun testResolveJsPartOfMppLibDependencyToMetadataWithoutHmpp() =
|
||||
testResolveJsPartOfMppLibDependencyToMetadata(noHMPP)
|
||||
|
||||
|
||||
private fun testResolveJsPartOfMppLibDependencyToMetadata(hmppFlags: HmppFlags) {
|
||||
val libProject = Project("sample-lib", gradleVersion, "new-mpp-lib-and-app")
|
||||
val appProject = Project("sample-app", gradleVersion, "new-mpp-lib-and-app")
|
||||
|
||||
val buildOptions = hmppFlags.buildOptions
|
||||
libProject.build(
|
||||
"publish",
|
||||
options = defaultBuildOptions().copy(jsCompilerType = BOTH)
|
||||
options = buildOptions.copy(jsCompilerType = BOTH)
|
||||
) {
|
||||
assertSuccessful()
|
||||
}
|
||||
@@ -957,7 +1021,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
|
||||
build(
|
||||
"printMetadataFiles",
|
||||
options = defaultBuildOptions().copy(jsCompilerType = IR)
|
||||
options = buildOptions.copy(jsCompilerType = IR)
|
||||
) {
|
||||
assertSuccessful()
|
||||
|
||||
@@ -1036,7 +1100,8 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
fun testNonMppConsumersOfLibraryPublishedWithNoMetadataOptIn() {
|
||||
val repoDir = with(transformNativeTestProject("sample-lib", gradleVersion, "new-mpp-lib-and-app")) {
|
||||
build(
|
||||
"publish"
|
||||
"publish",
|
||||
options = hmppWithCompatibilityMetadataArtifact.buildOptions
|
||||
) { assertSuccessful() }
|
||||
projectDir.resolve("repo")
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
kotlin.mpp.enableGranularSourceSetsMetadata=true
|
||||
kotlin.mpp.enableCompatibilityMetadataVariant=true
|
||||
-1
@@ -1,2 +1 @@
|
||||
kotlin.mpp.enableGranularSourceSetsMetadata=true
|
||||
kotlin.mpp.enableCompatibilityMetadataVariant=true
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
kotlin.mpp.enableGranularSourceSetsMetadata=true
|
||||
kotlin.mpp.enableCompatibilityMetadataVariant=true
|
||||
Reference in New Issue
Block a user