[mpp] Remove usage of deprecated pre-HMPP properties from tests

#KT-59304 In Progress
This commit is contained in:
Stanislav Erokhin
2023-07-28 17:48:51 +02:00
committed by teamcity
parent a3eb472e5f
commit cfcb0690d7
21 changed files with 4 additions and 52 deletions
@@ -129,13 +129,11 @@ internal class CompilerOptionsIT : KGPBaseTest() {
"""
|
|kotlin.options.suppressFreeCompilerArgsModificationWarning=true
|# to enable the :compileKotlinMetadata task
|kotlin.mpp.enableCompatibilityMetadataVariant=true
""".trimMargin()
)
val compileTasks = listOf(
"compileKotlinMetadata",
"compileCommonMainKotlinMetadata",
"compileKotlinJvmWithoutJava",
"compileKotlinJs",
// we do not allow modifying free args for K/N at execution time
@@ -137,10 +137,10 @@ class TryK2IT : KGPBaseTest() {
) {
enableTryK2()
build(":compileKotlinMetadata") {
assertTasksExecuted(":compileKotlinMetadata")
build(":compileCommonMainKotlinMetadata") {
assertTasksExecuted(":compileCommonMainKotlinMetadata")
assertCompilerArgument(":compileKotlinMetadata", "-language-version 2.0")
assertCompilerArgument(":compileCommonMainKotlinMetadata", "-language-version 2.0")
}
build(":compileKotlinJvm") {
@@ -1 +0,0 @@
kotlin.mpp.enableCompatibilityMetadataVariant=true
@@ -1,3 +1,2 @@
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.enableIntransitiveMetadataConfiguration=true
kotlin.mpp.enableCompatibilityMetadataVariant=false
@@ -1,3 +1,2 @@
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.enableCompatibilityMetadataVariant=false
kotlin.mpp.enableIntransitiveMetadataConfiguration=true
@@ -1,3 +1,2 @@
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.enableCompatibilityMetadataVariant=false
kotlin.mpp.enableIntransitiveMetadataConfiguration=true
@@ -1,4 +1,3 @@
kotlin.code.style=official
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.enableIntransitiveMetadataConfiguration=true
kotlin.mpp.enableCompatibilityMetadataVariant=false
@@ -1,3 +1 @@
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
kotlin.mpp.enableCInteropCommonization=true
@@ -1 +0,0 @@
kotlin.mpp.enableCompatibilityMetadataVariant=true
@@ -1 +0,0 @@
kotlin.mpp.enableCompatibilityMetadataVariant=true
@@ -31,7 +31,6 @@ class JvmAndAndroidIntermediateSourceSetTest {
fun setup() {
project = ProjectBuilder.builder().build() as ProjectInternal
addBuildEventsListenerRegistryMock(project)
project.extensions.getByType(ExtraPropertiesExtension::class.java).set("kotlin.mpp.enableGranularSourceSetsMetadata", "true")
project.plugins.apply("kotlin-multiplatform")
project.plugins.apply("android-library")
@@ -13,11 +13,6 @@ import kotlin.test.Test
class KT46273JvmTargetAndOrphanTestSourceSetTest : MultiplatformExtensionTest() {
override fun setup() {
enableGranularSourceSetsMetadata()
super.setup()
}
@Test
fun `test KT-46273`() {
kotlin.jvm()
@@ -32,7 +32,6 @@ class CInteropCommonizerTaskTest : MultiplatformExtensionTest() {
@BeforeTest
override fun setup() {
enableGranularSourceSetsMetadata()
enableCInteropCommonization()
super.setup()
}
@@ -25,7 +25,6 @@ internal class CompilationSpecificPluginPath {
class NativeSpecificPlugin : FakeSubPlugin("common", "native", { true })
val project = buildProject {
extensions.getByType(ExtraPropertiesExtension::class.java).set("kotlin.mpp.enableGranularSourceSetsMetadata", "true")
project.plugins.apply("kotlin-multiplatform")
plugins.apply(NativeSpecificPlugin::class.java)
@@ -16,7 +16,6 @@ import org.jetbrains.kotlin.gradle.plugin.diagnostics.kotlinToolingDiagnosticsCo
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.util.applyMultiplatformPlugin
import org.jetbrains.kotlin.gradle.util.enableCInteropCommonization
import org.jetbrains.kotlin.gradle.util.enableHierarchicalStructureByDefault
import org.jetbrains.kotlin.gradle.util.propertiesExtension
import kotlin.test.*
@@ -79,18 +78,6 @@ class DisabledCInteropCommonizationWarningTest {
)
}
@Test
fun `test warning is not shown when hierarchical structure is disabled`() {
project.enableCInteropCommonization(false)
project.enableHierarchicalStructureByDefault(false)
project.setupNativeTargetsWithCInterops()
project.evaluate()
assertNull(
project.getWarningMessage(),
"Expected no error message shown when hmpp is disabled"
)
}
@Test
fun `test warning is not shown when no cinterops are defined`() {
project.enableCInteropCommonization(false)
@@ -34,7 +34,6 @@ class SourceSetCommonizerTargetTest {
fun setup() {
project = buildProject()
addBuildEventsListenerRegistryMock(project)
project.extensions.getByType(ExtraPropertiesExtension::class.java).set("kotlin.mpp.enableCompatibilityMetadataVariant", "false")
project.plugins.apply("kotlin-multiplatform")
kotlin = project.extensions.getByName("kotlin") as KotlinMultiplatformExtension
}
@@ -33,10 +33,6 @@ abstract class MultiplatformExtensionTest {
kotlin = project.applyMultiplatformPlugin()
}
protected fun enableGranularSourceSetsMetadata() {
project.enableGranularSourceSetsMetadata()
}
protected fun enableCInteropCommonization() {
project.enableCInteropCommonization()
}
@@ -112,18 +112,10 @@ fun Project.applyCocoapodsPlugin(): CocoapodsExtension {
val Project.propertiesExtension: ExtraPropertiesExtension
get() = extensions.getByType(ExtraPropertiesExtension::class.java)
fun Project.enableGranularSourceSetsMetadata() {
propertiesExtension.set("kotlin.mpp.enableGranularSourceSetsMetadata", "true")
}
fun Project.enableCInteropCommonization(enabled: Boolean = true) {
propertiesExtension.set(PropertiesProvider.PropertyNames.KOTLIN_MPP_ENABLE_CINTEROP_COMMONIZATION, enabled.toString())
}
fun Project.enableHierarchicalStructureByDefault(enabled: Boolean = true) {
propertiesExtension.set(PropertiesProvider.PropertyNames.KOTLIN_MPP_HIERARCHICAL_STRUCTURE_BY_DEFAULT, enabled.toString())
}
fun Project.enableIntransitiveMetadataConfiguration(enabled: Boolean = true) {
propertiesExtension.set(KOTLIN_MPP_ENABLE_INTRANSITIVE_METADATA_CONFIGURATION, enabled.toString())
}