[Parcelize] Add test for parcelize in multiplatform setting.
This tests that classes in common code can have code generated for them in android compilations.
This commit is contained in:
+4
@@ -8,6 +8,10 @@ fun o() = "O"
|
||||
|
||||
// MODULE: common2
|
||||
// TARGET_PLATFORM: Common
|
||||
// The test framework adds additional files to common modules with no dependencies.
|
||||
// Those files should only be added once, so we exclude them from common2 and only include
|
||||
// them in common1.
|
||||
// NO_COMMON_FILES
|
||||
// FILE: common2.kt
|
||||
|
||||
fun k() = "K"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// LANGUAGE: +MultiPlatformProjects
|
||||
// WITH_STDLIB
|
||||
// WITH_COROUTINES
|
||||
|
||||
// MODULE: common
|
||||
// FILE: common.kt
|
||||
@@ -10,6 +9,7 @@ expect interface I {
|
||||
}
|
||||
|
||||
// MODULE: main()()(common)
|
||||
// WITH_COROUTINES
|
||||
// FILE: main.kt
|
||||
import kotlin.coroutines.*
|
||||
import helpers.*
|
||||
|
||||
+7
@@ -47,4 +47,11 @@ object WasmEnvironmentConfigurationDirectives : SimpleDirectivesContainer() {
|
||||
val CHECK_TYPESCRIPT_DECLARATIONS by directive(
|
||||
description = "Check typescript declarations generated by the compiler",
|
||||
)
|
||||
|
||||
val NO_COMMON_FILES by directive(
|
||||
"""
|
||||
Don't added helper files to prevent linking issues.
|
||||
""".trimIndent(),
|
||||
applicability = DirectiveApplicability.Global,
|
||||
)
|
||||
}
|
||||
|
||||
+7
-12
@@ -355,18 +355,13 @@ class ModuleStructureExtractorImpl(
|
||||
directives = moduleDirectives,
|
||||
languageVersionSettings = currentModuleLanguageVersionSettingsBuilder.build()
|
||||
)
|
||||
if (testModule.frontendKind != FrontendKinds.FIR ||
|
||||
!testModule.languageVersionSettings.supportsFeature(LanguageFeature.MultiPlatformProjects) ||
|
||||
modules.isEmpty()
|
||||
) {
|
||||
additionalSourceProviders.flatMapTo(filesOfCurrentModule) { additionalSourceProvider ->
|
||||
additionalSourceProvider.produceAdditionalFiles(
|
||||
globalDirectives ?: RegisteredDirectives.Empty,
|
||||
testModule
|
||||
).also { additionalFiles ->
|
||||
require(additionalFiles.all { it.isAdditional }) {
|
||||
"Files produced by ${additionalSourceProvider::class.qualifiedName} should have flag `isAdditional = true`"
|
||||
}
|
||||
additionalSourceProviders.flatMapTo(filesOfCurrentModule) { additionalSourceProvider ->
|
||||
additionalSourceProvider.produceAdditionalFiles(
|
||||
globalDirectives ?: RegisteredDirectives.Empty,
|
||||
testModule
|
||||
).also { additionalFiles ->
|
||||
require(additionalFiles.all { it.isAdditional }) {
|
||||
"Files produced by ${additionalSourceProvider::class.qualifiedName} should have flag `isAdditional = true`"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user