Skip to content

Commit

Permalink
[Gradle] Test that metadata compilation for bug KT-65954 doesn't fail
Browse files Browse the repository at this point in the history
Metadata compilation should not fail when test source set has
dependency with higher version

^KT-65954 Verification Pending
  • Loading branch information
antohaby authored and Space Team committed Feb 27, 2024
1 parent 4e5eaa0 commit 1b11027
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,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,
Expand Down

0 comments on commit 1b11027

Please sign in to comment.