Skip to content

Commit 1b11027

Browse files
antohabySpace Team
authored and
Space Team
committed
[Gradle] Test that metadata compilation for bug KT-65954 doesn't fail
Metadata compilation should not fail when test source set has dependency with higher version ^KT-65954 Verification Pending
1 parent 4e5eaa0 commit 1b11027

File tree

1 file changed

+32
-0
lines changed
  • libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle

1 file changed

+32
-0
lines changed

libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/HierarchicalMppIT.kt

+32
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,38 @@ open class HierarchicalMppIT : KGPBaseTest() {
12481248
}
12491249
}
12501250

1251+
@GradleTest
1252+
@DisplayName("KT-65954 Metadata Compilation should not fail when test source set has higher version of a library")
1253+
fun kt65954MetadataCompilationShouldNotFail(gradleVersion: GradleVersion, @TempDir tempDir: Path) {
1254+
// publish version 1.0
1255+
publishThirdPartyLib(withGranularMetadata = true, gradleVersion = gradleVersion, localRepoDir = tempDir)
1256+
1257+
// publish version 2.0
1258+
publishThirdPartyLib(withGranularMetadata = true, gradleVersion = gradleVersion, localRepoDir = tempDir) {
1259+
buildGradleKts.appendText("\nversion = \"2.0\"\n")
1260+
}
1261+
1262+
nativeProject(
1263+
"my-lib-foo".withPrefix,
1264+
gradleVersion,
1265+
localRepoDir = tempDir,
1266+
).run {
1267+
// add a dependency from commonTest on 2.0 version
1268+
buildGradleKts.appendText(
1269+
"""
1270+
1271+
kotlin.sourceSets.getByName("jvmTest").dependencies {
1272+
implementation("com.example.thirdparty:third-party-lib:2.0")
1273+
}
1274+
""".trimIndent()
1275+
)
1276+
build(":compileJvmAndJsMainKotlinMetadata") {
1277+
assertTasksExecuted(":compileJvmAndJsMainKotlinMetadata")
1278+
}
1279+
}
1280+
}
1281+
1282+
12511283
private fun TestProject.testDependencyTransformations(
12521284
subproject: String? = null,
12531285
check: BuildResult.(reports: Iterable<DependencyTransformationReport>) -> Unit,

0 commit comments

Comments
 (0)