From b7b0397d2cd30c9c9e28c9708a8bca4b67762ecc Mon Sep 17 00:00:00 2001 From: Dmitrii Krasnov Date: Wed, 20 Dec 2023 10:38:37 +0100 Subject: [PATCH] [Gradle] Made klib unpacked for native metadata compile task ^KT-63363 Fixed --- .../kotlin/gradle/CommonizerHierarchicalIT.kt | 10 +++++----- .../jetbrains/kotlin/gradle/ConfigurationCacheIT.kt | 13 +++++++++++++ .../jetbrains/kotlin/gradle/HierarchicalMppIT.kt | 2 +- .../org/jetbrains/kotlin/gradle/KlibBasedMppIT.kt | 2 +- .../kotlin/gradle/mpp/MppSharedNativeCompileIT.kt | 4 ++-- .../pm20/GradleKpmHostSpecificMetadataArtifact.kt | 4 +--- .../mpp/pm20/setupFragmentsMetadataForKpmModules.kt | 4 +--- .../metadata/KotlinMetadataTargetConfigurator.kt | 13 +------------ .../gradle/targets/native/KotlinNativeTarget.kt | 2 +- .../native/KotlinNativeTargetConfigurator.kt | 13 +++++++++++-- .../targets/native/tasks/KotlinNativeTasks.kt | 11 +++++------ .../KotlinNativeCompileRefinesPathsTest.kt | 4 ++-- .../unitTests/DependsOnClosureCompilePathTest.kt | 6 +++--- 13 files changed, 47 insertions(+), 41 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/CommonizerHierarchicalIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/CommonizerHierarchicalIT.kt index f57aa8d891879..e82ac15299c89 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/CommonizerHierarchicalIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/CommonizerHierarchicalIT.kt @@ -22,28 +22,28 @@ open class CommonizerHierarchicalIT : KGPBaseTest() { nativeProject("commonizeHierarchically", gradleVersion) { if (HostManager.hostIsMac) { build(":p1:compileIosMainKotlinMetadata") { - assertFileInProjectExists("p1/build/classes/kotlin/metadata/iosMain/klib/p1_iosMain.klib") + assertDirectoryInProjectExists("p1/build/classes/kotlin/metadata/iosMain/klib/p1_iosMain") assertNoDuplicateLibraryWarning() } build(":p1:compileAppleMainKotlinMetadata") { - assertFileInProjectExists("p1/build/classes/kotlin/metadata/appleMain/klib/p1_appleMain.klib") + assertDirectoryInProjectExists("p1/build/classes/kotlin/metadata/appleMain/klib/p1_appleMain") assertNoDuplicateLibraryWarning() } } build(":p1:compileLinuxMainKotlinMetadata") { - assertFileInProjectExists("p1/build/classes/kotlin/metadata/linuxMain/klib/p1_linuxMain.klib") + assertDirectoryInProjectExists("p1/build/classes/kotlin/metadata/linuxMain/klib/p1_linuxMain") assertNoDuplicateLibraryWarning() } build(":p1:compileAppleAndLinuxMainKotlinMetadata") { - assertFileInProjectExists("p1/build/classes/kotlin/metadata/appleAndLinuxMain/klib/p1_appleAndLinuxMain.klib") + assertDirectoryInProjectExists("p1/build/classes/kotlin/metadata/appleAndLinuxMain/klib/p1_appleAndLinuxMain") assertNoDuplicateLibraryWarning() } build(":p1:compileNativeMainKotlinMetadata") { - assertFileInProjectExists("p1/build/classes/kotlin/metadata/nativeMain/klib/p1_nativeMain.klib") + assertDirectoryInProjectExists("p1/build/classes/kotlin/metadata/nativeMain/klib/p1_nativeMain") assertNoDuplicateLibraryWarning() } diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/ConfigurationCacheIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/ConfigurationCacheIT.kt index 9ea4a5fbd9b98..3a79e20a606ba 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/ConfigurationCacheIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/ConfigurationCacheIT.kt @@ -79,6 +79,19 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() { } } + @MppGradlePluginTests + @DisplayName("KT-63363: all metadata jar works well with configuration cache") + @GradleTestVersions( + minVersion = TestVersions.Gradle.G_7_4, + additionalVersions = [TestVersions.Gradle.G_7_6], + ) + @GradleTest + fun testAllMetadataJarWithConfigurationCache(gradleVersion: GradleVersion) { + project("new-mpp-lib-and-app/sample-lib", gradleVersion) { + testConfigurationCacheOf(":allMetadataJar") + } + } + @NativeGradlePluginTests @DisplayName("works with commonizer") @GradleTestVersions( diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/HierarchicalMppIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/HierarchicalMppIT.kt index 7fc5a49a715b3..62ed3cc36f6d4 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/HierarchicalMppIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/HierarchicalMppIT.kt @@ -380,7 +380,7 @@ open class HierarchicalMppIT : KGPBaseTest() { ) { build("assemble") { assertFileExists(projectPath.resolve("build/libs/test-project-jvm.jar")) - assertFileExists(projectPath.resolve("build/classes/kotlin/metadata/nativeMain/klib/test-project_nativeMain.klib")) + assertDirectoryExists(projectPath.resolve("build/classes/kotlin/metadata/nativeMain/klib/test-project_nativeMain")) } } } diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KlibBasedMppIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KlibBasedMppIT.kt index f2c5e6ea71dab..bc8c870214440 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KlibBasedMppIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KlibBasedMppIT.kt @@ -204,7 +204,7 @@ open class KlibBasedMppIT : BaseGradleIT() { assertFileExists("build/classes/kotlin/metadata/commonMain/default/manifest") assertFileExists("build/classes/kotlin/metadata/jvmAndJsMain/default/manifest") - assertFileExists("build/classes/kotlin/metadata/linuxMain/klib/${projectName}_linuxMain.klib") + assertFileExists("build/classes/kotlin/metadata/linuxMain/klib/${projectName}_linuxMain") // Check that the common and JVM+JS source sets don't receive the Kotlin/Native stdlib in the classpath: run { diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/mpp/MppSharedNativeCompileIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/mpp/MppSharedNativeCompileIT.kt index 1340515aa75de..2bf0c48b5e4c0 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/mpp/MppSharedNativeCompileIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/mpp/MppSharedNativeCompileIT.kt @@ -26,8 +26,8 @@ class MppSharedNativeCompileIT : KGPBaseTest() { fun `test - shared native klib - does not contain 'depends=' manifest property`(gradleVersion: GradleVersion) { project("kt-54995-compileSharedNative-with-okio", gradleVersion) { build("compileNativeMainKotlinMetadata") { - val nativeMainKlib = projectPath.resolve("build/classes/kotlin/metadata/nativeMain/klib/test-project_nativeMain.klib") - assertFileExists(nativeMainKlib) + val nativeMainKlib = projectPath.resolve("build/classes/kotlin/metadata/nativeMain/klib/test-project_nativeMain") + assertDirectoryExists(nativeMainKlib) val libraryFile = org.jetbrains.kotlin.library.resolveSingleFileKlib( org.jetbrains.kotlin.konan.file.File(nativeMainKlib), diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/pm20/GradleKpmHostSpecificMetadataArtifact.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/pm20/GradleKpmHostSpecificMetadataArtifact.kt index 4d7f83976b61d..00a079d9fe554 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/pm20/GradleKpmHostSpecificMetadataArtifact.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/pm20/GradleKpmHostSpecificMetadataArtifact.kt @@ -8,9 +8,7 @@ package org.jetbrains.kotlin.gradle.plugin.mpp.pm20 import org.gradle.api.artifacts.Dependency import org.gradle.jvm.tasks.Jar import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.disambiguateName -import org.jetbrains.kotlin.gradle.targets.metadata.filesWithUnpackedArchives import org.jetbrains.kotlin.gradle.tasks.registerTask -import org.jetbrains.kotlin.library.KLIB_FILE_EXTENSION /** * Will register a 'hostSpecificMetadataJar' [Jar] task containing compilation outputs of host specific metadata. @@ -29,7 +27,7 @@ val GradleKpmHostSpecificMetadataArtifact = GradleKpmConfigurationArtifactsSetup if (metadataCompilation is GradleKpmNativeFragmentMetadataCompilationData) { jar.from(project.files(project.provider { if (metadataFragment in fragment.withRefinesClosure && metadataFragment.isNativeHostSpecific()) - project.filesWithUnpackedArchives(metadataCompilation.output.allOutputs, setOf(KLIB_FILE_EXTENSION)) + metadataCompilation.output.allOutputs else emptyList() })) { spec -> spec.into(metadataFragment.name) } } diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/pm20/setupFragmentsMetadataForKpmModules.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/pm20/setupFragmentsMetadataForKpmModules.kt index 80a5f92c12ea3..58779d0e54241 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/pm20/setupFragmentsMetadataForKpmModules.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/pm20/setupFragmentsMetadataForKpmModules.kt @@ -18,14 +18,12 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.ComputedCapability import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.disambiguateName import org.jetbrains.kotlin.gradle.targets.metadata.KotlinMetadataTargetConfigurator import org.jetbrains.kotlin.gradle.targets.metadata.createGenerateProjectStructureMetadataTask -import org.jetbrains.kotlin.gradle.targets.metadata.filesWithUnpackedArchives import org.jetbrains.kotlin.gradle.tasks.* import org.jetbrains.kotlin.gradle.tasks.withType import org.jetbrains.kotlin.gradle.utils.* import org.jetbrains.kotlin.gradle.utils.dashSeparatedName import org.jetbrains.kotlin.gradle.utils.filesProvider import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName -import org.jetbrains.kotlin.library.KLIB_FILE_EXTENSION import org.jetbrains.kotlin.project.model.KpmFragment import java.util.concurrent.Callable @@ -162,7 +160,7 @@ private fun configureMetadataJarTask( val compilationData = registry.getForFragmentOrNull(fragment) .takeIf { !fragment.isNativeHostSpecific() } ?: return@filesProvider emptyList() - project.filesWithUnpackedArchives(compilationData.output.allOutputs, setOf(KLIB_FILE_EXTENSION)) + compilationData.output.allOutputs } jar.from(metadataOutput) { spec -> spec.into(fragment.fragmentName) diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/metadata/KotlinMetadataTargetConfigurator.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/metadata/KotlinMetadataTargetConfigurator.kt index 68c7d878e509d..8dc74dfb3eb2c 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/metadata/KotlinMetadataTargetConfigurator.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/metadata/KotlinMetadataTargetConfigurator.kt @@ -320,8 +320,7 @@ class KotlinMetadataTargetConfigurator : configureMetadataDependenciesForCompilation(this@apply) if (!isHostSpecific) { - val metadataContent = project.filesWithUnpackedArchives(this@apply.output.allOutputs, setOf("klib")) - allMetadataJar.configure { it.from(metadataContent) { spec -> spec.into(this@apply.defaultSourceSet.name) } } + allMetadataJar.configure { it.from(this@apply.output.allOutputs) { spec -> spec.into(this@apply.defaultSourceSet.name) } } if (this is KotlinSharedNativeCompilation) { project.includeCommonizedCInteropMetadata(allMetadataJar, this) } @@ -477,16 +476,6 @@ internal suspend fun getPublishedPlatformCompilations(project: Project): Map): FileCollection = - project.files(project.provider { - from.mapNotNull { - @Suppress("IMPLICIT_CAST_TO_ANY") - if (it.extension in extensions) { - if (it.exists()) project.zipTree(it) else null - } else it - } - }).builtBy(from) - private val KotlinMetadataTarget.metadataCompilationsCreated: CompletableFuture by extrasLazyProperty("metadataCompilationsCreated") { CompletableFuture() } diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeTarget.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeTarget.kt index 45f669214c1fb..5e5d7f4d03633 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeTarget.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeTarget.kt @@ -80,7 +80,7 @@ abstract class KotlinNativeTarget @Inject constructor( } metadataCompilations.forEach { compilation -> - metadataJar.from(project.filesWithUnpackedArchives(compilation.output.allOutputs, setOf("klib"))) { spec -> + metadataJar.from(compilation.output.allOutputs) { spec -> spec.into(compilation.name) } metadataJar.dependsOn(compilation.output.classesDirs) diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeTargetConfigurator.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeTargetConfigurator.kt index 01bd0fcc38acb..73228e5fcfcb0 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeTargetConfigurator.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeTargetConfigurator.kt @@ -33,6 +33,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.* import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XcodeVersionTask import org.jetbrains.kotlin.gradle.plugin.mpp.apple.registerEmbedAndSignAppleFrameworkTask import org.jetbrains.kotlin.gradle.plugin.mpp.apple.version +import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.GradleKpmMetadataCompilationData import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.GradleKpmVariant import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.copyAttributes import org.jetbrains.kotlin.gradle.targets.metadata.isKotlinGranularMetadataEnabled @@ -45,8 +46,6 @@ import org.jetbrains.kotlin.gradle.tasks.* import org.jetbrains.kotlin.gradle.testing.internal.configureConventions import org.jetbrains.kotlin.gradle.testing.internal.kotlinTestRegistry import org.jetbrains.kotlin.gradle.testing.testTaskName -import org.jetbrains.kotlin.gradle.utils.XcodeUtils -import org.jetbrains.kotlin.gradle.utils.named import org.jetbrains.kotlin.gradle.utils.newInstance import org.jetbrains.kotlin.gradle.utils.valueSourceWithExecProviderCompat import org.jetbrains.kotlin.konan.target.HostManager @@ -366,6 +365,7 @@ open class KotlinNativeTargetConfigurator : AbstractKotl ): TaskProvider { val project = compilationInfo.project val ext = project.topLevelExtension + val isMetadataCompilation = checkCompilationIsMetadataCompilation(compilationInfo) val compileTaskProvider = project.registerTask( compilationInfo.compileKotlinTaskName, listOf( @@ -399,6 +399,8 @@ open class KotlinNativeTargetConfigurator : AbstractKotl ) .finalizeValueOnRead() + // for metadata tasks we should provide unpacked klib + it.produceUnpackedKlib.set(isMetadataCompilation) } compilationInfo.classesDirs.from(compileTaskProvider.map { it.outputFile }) @@ -429,6 +431,13 @@ open class KotlinNativeTargetConfigurator : AbstractKotl return compileTaskProvider } + private fun checkCompilationIsMetadataCompilation(compilationInfo: KotlinCompilationInfo): Boolean { + return when (compilationInfo) { + is KPM -> compilationInfo.compilationData is GradleKpmMetadataCompilationData<*> + is KotlinCompilationInfo.TCS -> compilationInfo.compilation is KotlinMetadataCompilation<*> + } + } + private fun Project.klibOutputDirectory( compilation: KotlinCompilationInfo, ): DirectoryProperty { diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativeTasks.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativeTasks.kt index 44e77e39093a0..4468e1afb65f8 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativeTasks.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativeTasks.kt @@ -47,7 +47,6 @@ import org.jetbrains.kotlin.gradle.targets.native.tasks.* import org.jetbrains.kotlin.gradle.utils.* import org.jetbrains.kotlin.gradle.utils.GradleLoggerAdapter import org.jetbrains.kotlin.gradle.utils.listFilesOrEmpty -import org.jetbrains.kotlin.incremental.deleteDirectoryContents import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageMode import org.jetbrains.kotlin.konan.library.KLIB_INTEROP_IR_PROVIDER_IDENTIFIER import org.jetbrains.kotlin.konan.properties.saveToFile @@ -152,6 +151,9 @@ abstract class AbstractKotlinNativeCompile< @get:Internal abstract val baseName: String + @get:Input + internal abstract val produceUnpackedKlib: Property + @get:Input @get:Optional internal abstract val explicitApiMode: Property @@ -242,7 +244,7 @@ abstract class AbstractKotlinNativeCompile< open val outputFile: Provider get() = destinationDirectory.flatMap { val prefix = outputKind.prefix(konanTarget) - val suffix = outputKind.suffix(konanTarget) + val suffix = if (produceUnpackedKlib.get()) "" else outputKind.suffix(konanTarget) val filename = "$prefix${baseName}$suffix".let { when { outputKind == FRAMEWORK -> @@ -346,10 +348,6 @@ internal constructor( @get:Internal val moduleName: String get() = compilerOptions.moduleName.get() - @get:OutputFile - override val outputFile: Provider - get() = super.outputFile - @get:Input val shortModuleName: String by providerFactory.provider { baseName } @@ -466,6 +464,7 @@ internal constructor( args.metadataKlib = sharedCompilationData != null args.nodefaultlibs = sharedCompilationData != null args.manifestFile = sharedCompilationData?.manifestFile?.absolutePath + args.nopack = produceUnpackedKlib.get() args.pluginOptions = compilerPlugins.flatMap { it.options.arguments }.toTypedArray() diff --git a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/kotlin/org/jetbrains/kotlin/gradle/regressionTests/KotlinNativeCompileRefinesPathsTest.kt b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/kotlin/org/jetbrains/kotlin/gradle/regressionTests/KotlinNativeCompileRefinesPathsTest.kt index 90413f4a94f96..48eb2fb8c626b 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/kotlin/org/jetbrains/kotlin/gradle/regressionTests/KotlinNativeCompileRefinesPathsTest.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/kotlin/org/jetbrains/kotlin/gradle/regressionTests/KotlinNativeCompileRefinesPathsTest.kt @@ -35,8 +35,8 @@ class KotlinNativeCompileRefinesPathsTest { assertEquals( project.files( - "build/classes/kotlin/metadata/nativeMain/klib/test_nativeMain.klib", - "build/classes/kotlin/metadata/commonMain/klib/test_commonMain.klib" + "build/classes/kotlin/metadata/nativeMain/klib/test_nativeMain", + "build/classes/kotlin/metadata/commonMain/klib/test_commonMain" ).toSet().relativeTo(project), compileTask.refinesModule.files.relativeTo(project) ) diff --git a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/kotlin/org/jetbrains/kotlin/gradle/unitTests/DependsOnClosureCompilePathTest.kt b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/kotlin/org/jetbrains/kotlin/gradle/unitTests/DependsOnClosureCompilePathTest.kt index 1baa99293d45c..09aaa1f1c9b53 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/kotlin/org/jetbrains/kotlin/gradle/unitTests/DependsOnClosureCompilePathTest.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/kotlin/org/jetbrains/kotlin/gradle/unitTests/DependsOnClosureCompilePathTest.kt @@ -28,7 +28,7 @@ class DependsOnClosureCompilePathTest { project.evaluate() assertEquals( - listOf("test_appleMain.klib", "test_nativeMain.klib", "test_commonMain.klib"), + listOf("test_appleMain", "test_nativeMain", "test_commonMain"), kotlin.sourceSets.iosMain.get().dependsOnClosureCompilePath.toList().map { it.name } ) } @@ -78,7 +78,7 @@ class DependsOnClosureCompilePathTest { project.evaluate() assertEquals( - listOf("test_c.klib", "test_a.klib", "test_b.klib", "test_commonMain.klib"), + listOf("test_c", "test_a", "test_b", "test_commonMain"), kotlin.sourceSets.linuxMain.get().dependsOnClosureCompilePath.toList().map { it.name } ) } @@ -130,7 +130,7 @@ class DependsOnClosureCompilePathTest { If the order changed, please investigate the root cause; Do not update the assertion! */ assertEquals( - listOf("test_bottom.klib", "test_left.klib", "test_right.klib", "test_commonMain.klib"), + listOf("test_bottom", "test_left", "test_right", "test_commonMain"), kotlin.sourceSets.linuxMain.get().dependsOnClosureCompilePath.toList().map { it.name } ) }