[Gradle] Test type safe project accessors with KotlinDependencyHandler
KT-58759 Verification Pending
This commit is contained in:
committed by
Space Team
parent
b3b0f23a50
commit
c49f08f427
+19
@@ -1191,6 +1191,25 @@ open class HierarchicalMppIT : KGPBaseTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@GradleTest
|
||||
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_0)
|
||||
fun `test type safe project accessors with KotlinDependencyHandler`(gradleVersion: GradleVersion) {
|
||||
project("mpp-project-with-type-safe-accessors", gradleVersion) {
|
||||
build("help") {
|
||||
println(output)
|
||||
val actualDependencies = output.lineSequence()
|
||||
.filter { it.startsWith("PROJECT_DEPENDENCY: ") }
|
||||
.map { it.removePrefix("PROJECT_DEPENDENCY: ") }
|
||||
.toList()
|
||||
|
||||
assertEquals(
|
||||
listOf(":foo", ":bar"),
|
||||
actualDependencies
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun TestProject.testDependencyTransformations(
|
||||
subproject: String? = null,
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
linuxX64()
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
linuxX64()
|
||||
|
||||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
api(projects.foo)
|
||||
api(projects.bar) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
configurations
|
||||
.getByName("commonMainApi")
|
||||
.dependencies
|
||||
.filterIsInstance<ProjectDependency>()
|
||||
.forEach { println("PROJECT_DEPENDENCY: ${it.dependencyProject.path}") }
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
linuxX64()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
|
||||
include(":foo")
|
||||
include(":bar")
|
||||
|
||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||
Reference in New Issue
Block a user