[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
This commit is contained in:
committed by
Space Team
parent
c31a72a4af
commit
32be35051d
+32
@@ -1266,6 +1266,38 @@ open class HierarchicalMppIT : KGPBaseTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@GradleTest
|
||||
@DisplayName("KT-65954 Metadata Compilation should not fail when test source set has higher version of a library")
|
||||
fun kt65954MetadataCompilationShouldNotFail(gradleVersion: GradleVersion, @TempDir tempDir: Path) {
|
||||
// publish version 1.0
|
||||
publishThirdPartyLib(withGranularMetadata = true, gradleVersion = gradleVersion, localRepoDir = tempDir)
|
||||
|
||||
// publish version 2.0
|
||||
publishThirdPartyLib(withGranularMetadata = true, gradleVersion = gradleVersion, localRepoDir = tempDir) {
|
||||
buildGradleKts.appendText("\nversion = \"2.0\"\n")
|
||||
}
|
||||
|
||||
nativeProject(
|
||||
"my-lib-foo".withPrefix,
|
||||
gradleVersion,
|
||||
localRepoDir = tempDir,
|
||||
).run {
|
||||
// add a dependency from commonTest on 2.0 version
|
||||
buildGradleKts.appendText(
|
||||
"""
|
||||
|
||||
kotlin.sourceSets.getByName("jvmTest").dependencies {
|
||||
implementation("com.example.thirdparty:third-party-lib:2.0")
|
||||
}
|
||||
""".trimIndent()
|
||||
)
|
||||
build(":compileJvmAndJsMainKotlinMetadata") {
|
||||
assertTasksExecuted(":compileJvmAndJsMainKotlinMetadata")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun TestProject.testDependencyTransformations(
|
||||
subproject: String? = null,
|
||||
check: BuildResult.(reports: Iterable<DependencyTransformationReport>) -> Unit,
|
||||
|
||||
Reference in New Issue
Block a user