From 76eef2adb170774f983018480d86683042195d4e Mon Sep 17 00:00:00 2001 From: Timofey Solonin Date: Fri, 9 Jun 2023 14:15:37 +0200 Subject: [PATCH] [MPP] Remove obsolete targets from MppCInteropDependencyTransformationIT.ComplexProject ^KT-58822 --- .../MppCInteropDependencyTransformationIT.kt | 36 +++++-------------- .../p1/build.gradle.kts | 10 ++---- .../p2/build.gradle.kts | 18 +++------- .../p3/build.gradle.kts | 20 ++--------- 4 files changed, 16 insertions(+), 68 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/MppCInteropDependencyTransformationIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/MppCInteropDependencyTransformationIT.kt index 32c6f369c68..3455fadd5b3 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/MppCInteropDependencyTransformationIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/MppCInteropDependencyTransformationIT.kt @@ -25,10 +25,6 @@ import org.junit.Test */ abstract class MppCInteropDependencyTransformationIT : BaseGradleIT() { - enum class DependencyMode { - Project, Repository - } - override fun defaultBuildOptions(): BuildOptions = super.defaultBuildOptions().run { copy( forceOutputToStdout = true, @@ -85,8 +81,8 @@ abstract class MppCInteropDependencyTransformationIT : BaseGradleIT() { } if (HostManager.hostIsMingw || HostManager.hostIsMac) { - assertTasksExecuted(":p2:compileWindowsMainKotlinMetadata") - assertTasksExecuted(":p3:compileWindowsMainKotlinMetadata") + assertTasksExecuted(":p2:compileKotlinWindowsX64") + assertTasksExecuted(":p3:compileKotlinWindowsX64") } /* Assert p2 & p3 transformed cinterop dependencies */ @@ -143,7 +139,7 @@ abstract class MppCInteropDependencyTransformationIT : BaseGradleIT() { getCommonizerDependencies(sourceSetName).withoutNativeDistributionDependencies() .assertDependencyFilesMatches(".*cinterop-simple.*", ".*cinterop-withPosix.*") .assertTargetOnAllDependencies( - CommonizerTarget(LINUX_ARM64, LINUX_X64, IOS_ARM64, IOS_X64, MACOS_X64, MINGW_X64, MINGW_X86) + CommonizerTarget(LINUX_ARM64, LINUX_X64, IOS_ARM64, IOS_X64, MACOS_X64, MINGW_X64) ) } @@ -167,18 +163,10 @@ abstract class MppCInteropDependencyTransformationIT : BaseGradleIT() { } } - if (HostManager.hostIsMingw || HostManager.hostIsMac) { - listOf("windowsMain", "windowsTest").forEach { sourceSetName -> - getCommonizerDependencies(sourceSetName).withoutNativeDistributionDependencies() - .assertDependencyFilesMatches(".*cinterop-simple.*", ".*cinterop-withPosix.*") - .assertTargetOnAllDependencies(CommonizerTarget(MINGW_X64, MINGW_X86)) - } - - listOf("linuxMain", "linuxTest").forEach { sourceSetName -> - getCommonizerDependencies(sourceSetName).withoutNativeDistributionDependencies() - .assertDependencyFilesMatches(".*cinterop-simple.*", ".*cinterop-withPosix.*") - .assertTargetOnAllDependencies(CommonizerTarget(LINUX_ARM64, LINUX_X64)) - } + listOf("linuxMain", "linuxTest").forEach { sourceSetName -> + getCommonizerDependencies(sourceSetName).withoutNativeDistributionDependencies() + .assertDependencyFilesMatches(".*cinterop-simple.*", ".*cinterop-withPosix.*") + .assertTargetOnAllDependencies(CommonizerTarget(LINUX_ARM64, LINUX_X64)) } } @@ -191,7 +179,7 @@ abstract class MppCInteropDependencyTransformationIT : BaseGradleIT() { getCommonizerDependencies(sourceSetName).withoutNativeDistributionDependencies() .assertDependencyFilesMatches(".*cinterop-simple.*", ".*cinterop-withPosix.*") .assertTargetOnAllDependencies( - CommonizerTarget(LINUX_ARM64, LINUX_X64, IOS_ARM64, IOS_X64, MACOS_X64, MINGW_X64, MINGW_X86) + CommonizerTarget(LINUX_ARM64, LINUX_X64, IOS_ARM64, IOS_X64, MACOS_X64, MINGW_X64) ) } @@ -208,14 +196,6 @@ abstract class MppCInteropDependencyTransformationIT : BaseGradleIT() { .assertTargetOnAllDependencies(CommonizerTarget(IOS_ARM64, IOS_X64)) } } - - if (HostManager.hostIsMingw || HostManager.hostIsMac) { - listOf("windowsMain", "windowsTest").forEach { sourceSetName -> - getCommonizerDependencies(sourceSetName).withoutNativeDistributionDependencies() - .assertDependencyFilesMatches(".*cinterop-simple.*", ".*cinterop-withPosix.*") - .assertTargetOnAllDependencies(CommonizerTarget(MINGW_X64, MINGW_X86)) - } - } } @Test diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/cinterop-MetadataDependencyTransformation/p1/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/cinterop-MetadataDependencyTransformation/p1/build.gradle.kts index d8ccfaded60..71c83992ebb 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/cinterop-MetadataDependencyTransformation/p1/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/cinterop-MetadataDependencyTransformation/p1/build.gradle.kts @@ -37,8 +37,6 @@ kotlin { ios() mingwX64("windowsX64") - @Suppress("DEPRECATION_ERROR") - mingwX86("windowsX86") val commonMain by sourceSets.getting val concurrentMain by sourceSets.creating @@ -52,9 +50,7 @@ kotlin { val appleMain by sourceSets.creating val macosMain by sourceSets.getting val iosMain by sourceSets.getting - val windowsMain by sourceSets.creating val windowsX64Main by sourceSets.getting - val windowsX86Main by sourceSets.getting commonMain { -jsMain @@ -71,10 +67,8 @@ kotlin { -linuxX64Main } } - -windowsMain { - -windowsX64Main - -windowsX86Main - } + + -windowsX64Main } } } diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/cinterop-MetadataDependencyTransformation/p2/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/cinterop-MetadataDependencyTransformation/p2/build.gradle.kts index 06f44797bde..17dffd3c978 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/cinterop-MetadataDependencyTransformation/p2/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/cinterop-MetadataDependencyTransformation/p2/build.gradle.kts @@ -29,8 +29,6 @@ kotlin { ios() mingwX64("windowsX64") - @Suppress("DEPRECATION_ERROR") - mingwX86("windowsX86") val commonMain by sourceSets.getting val commonTest by sourceSets.getting @@ -51,12 +49,8 @@ kotlin { val macosTest by sourceSets.getting val iosMain by sourceSets.getting val iosTest by sourceSets.getting - val windowsMain by sourceSets.creating - val windowsTest by sourceSets.creating val windowsX64Main by sourceSets.getting val windowsX64Test by sourceSets.getting - val windowsX86Main by sourceSets.getting - val windowsX86Test by sourceSets.getting commonMain { -jvmMain @@ -71,10 +65,8 @@ kotlin { -linuxX64Main } } - -windowsMain { - -windowsX64Main - -windowsX86Main - } + + -windowsX64Main } } @@ -90,10 +82,8 @@ kotlin { -linuxX64Test } } - -windowsTest { - -windowsX64Test - -windowsX86Test - } + + -windowsX64Test } } diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/cinterop-MetadataDependencyTransformation/p3/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/cinterop-MetadataDependencyTransformation/p3/build.gradle.kts index ad5b1364dfa..5c9c3dd281d 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/cinterop-MetadataDependencyTransformation/p3/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/cinterop-MetadataDependencyTransformation/p3/build.gradle.kts @@ -24,8 +24,6 @@ kotlin { linuxX64() ios() mingwX64("windowsX64") - @Suppress("DEPRECATION_ERROR") - mingwX86("windowsX86") val commonMain by sourceSets.getting val commonTest by sourceSets.getting @@ -40,12 +38,8 @@ kotlin { val linuxX64Test by sourceSets.getting val iosMain by sourceSets.getting val iosTest by sourceSets.getting - val windowsMain by sourceSets.creating - val windowsTest by sourceSets.creating val windowsX64Main by sourceSets.getting val windowsX64Test by sourceSets.getting - val windowsX86Main by sourceSets.getting - val windowsX86Test by sourceSets.getting commonMain { -jvmMain @@ -68,13 +62,8 @@ kotlin { Expected to see p1:nativeMain cinterops */ -windowsAndLinuxMain { - -windowsMain - -linuxX64Main - } - - -windowsMain { -windowsX64Main - -windowsX86Main + -linuxX64Main } } } @@ -87,13 +76,8 @@ kotlin { } -windowsAndLinuxTest { - -windowsTest - -linuxX64Test - } - - -windowsTest { -windowsX64Test - -windowsX86Test + -linuxX64Test } } }