-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Gradle] Legacy metadata compilation should contain all source sets from
depends on closure of its default source set. With HMPP it is no longer needed, since each source compiles independently and sees its parent declarations via klib dependencies cherry-picked from 3c34354 ^KT-55730 Verification Pending
- Loading branch information
1 parent
b6cde89
commit e2b4317
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...onalTest/kotlin/org/jetbrains/kotlin/gradle/KT55730CommonMainDependsOnAnotherSourceSet.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. | ||
*/ | ||
|
||
@file:Suppress("FunctionName") | ||
|
||
package org.jetbrains.kotlin.gradle | ||
|
||
import org.jetbrains.kotlin.gradle.dsl.multiplatformExtension | ||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
||
class KT55730CommonMainDependsOnAnotherSourceSet { | ||
@Test | ||
fun `legacy metadata compilation should have commonMain with its depends on closure`() { | ||
val project = buildProject { | ||
enableCompatibilityMetadataVariant() | ||
applyMultiplatformPlugin() | ||
kotlin { | ||
val grandCommonMain = sourceSets.create("grandCommonMain") | ||
val commonMain = sourceSets.getByName("commonMain") | ||
commonMain.dependsOn(grandCommonMain) | ||
} | ||
} | ||
|
||
project.evaluate() | ||
|
||
val actualSourceSets = project | ||
.multiplatformExtension | ||
.metadata() | ||
.compilations | ||
.getByName("main") | ||
.kotlinSourceSets | ||
.map { it.name } | ||
.toSet() | ||
|
||
assertEquals(setOf("grandCommonMain", "commonMain"), actualSourceSets) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters