Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ internal class MetadataDependencyTransformationTaskInputs(
@get:PathSensitive(PathSensitivity.RELATIVE)
@get:IgnoreEmptyDirectories
@get:NormalizeLineEndings
val projectStructureMetadataFileCollection = kotlinSourceSet
.internal
.projectStructureMetadataResolvedConfiguration()
.files
val projectStructureMetadataFileCollection: FileCollection = if (keepProjectDependencies) {
kotlinSourceSet
.internal
.projectStructureMetadataResolvedConfiguration()
.files
} else project.files()

@Suppress("unused") // Gradle input
@get:InputFiles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,26 @@ class CInteropMetadataDependencyTransformationTaskTest : MultiplatformExtensionT
// val projectFooDotBar = projectWithCinterops("foo.bar", rootProject)
// assertTasksOutputsDoesntIntersect(projectFooBar, projectFooDotBar)
}

@Test
fun `test IDE task does not depend on project structure metadata`() = project.runLifecycleAwareTest {
enableCInteropCommonization(true)
kotlin.linuxX64()
kotlin.linuxArm64()

val commonMain = kotlin.sourceSets.getByName("commonMain")
val nativeMain = kotlin.sourceSets.create("nativeMain") as DefaultKotlinSourceSet
nativeMain.dependsOn(commonMain)

kotlin.sourceSets.getByName("linuxX64Main").dependsOn(nativeMain)
kotlin.sourceSets.getByName("linuxArm64Main").dependsOn(nativeMain)

val task = locateOrRegisterCInteropMetadataDependencyTransformationTaskForIde(nativeMain)?.get()
?: fail("Expected transformation task registered for 'nativeMain'")

assertTrue(
task.inputs.projectStructureMetadataFileCollection.isEmpty,
"Expected projectStructureMetadataFileCollection to be empty for CInterop IDE task"
)
}
}