Revert "Build source sets hierarchy in Android projects"
This reverts commit 269410d7
The change causes errors in AS 3.2 import.
This commit is contained in:
-31
@@ -8,7 +8,6 @@ import org.jetbrains.kotlin.gradle.util.modify
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
|
||||
class KotlinAndroidGradleIT : AbstractKotlinAndroidGradleTests(androidGradlePluginVersion = "2.3.0") {
|
||||
@@ -23,36 +22,6 @@ class KotlinAndroid32GradleIT : KotlinAndroid3GradleIT(androidGradlePluginVersio
|
||||
|
||||
@Test
|
||||
fun testAndroidWithNewMppApp() = with(Project("new-mpp-android")) {
|
||||
build("printSourceSetDependsOnRelations") {
|
||||
val dependsOnReportRegex = "(\\w+?) dependsOn \\[(.*?)]".toRegex()
|
||||
val dependsOnRelations = dependsOnReportRegex
|
||||
.findAll(output)
|
||||
.associate { it.groupValues[1] to it.groupValues[2].split(", ").toSet() }
|
||||
|
||||
val expectedDependsOnRelations = listOf(
|
||||
"androidLibMain" to setOf("commonMain"),
|
||||
"androidLibDebug" to setOf("commonMain", "androidLibMain"), // compilation
|
||||
"androidLibRelease" to setOf("commonMain", "androidLibMain"), // compilation
|
||||
|
||||
"androidLibTest" to setOf("commonTest"),
|
||||
"androidLibTestDebug" to setOf("commonTest"),
|
||||
"androidLibTestRelease" to setOf("commonTest"),
|
||||
"androidLibAndroidTestDebug" to setOf("commonTest"),
|
||||
"androidLibAndroidTest" to setOf("commonTest"),
|
||||
"androidLibDebugAndroidTest" to setOf("commonTest", "androidLibAndroidTest", "androidLibAndroidTestDebug"), // compilation
|
||||
"androidLibDebugUnitTest" to setOf("commonTest", "androidLibTest", "androidLibTestDebug"), // compilation
|
||||
"androidLibReleaseUnitTest" to setOf("commonTest", "androidLibTest", "androidLibTestRelease") // compilation
|
||||
)
|
||||
|
||||
for ((sourceSetName, expectedDependsOn) in expectedDependsOnRelations) {
|
||||
assertEquals(
|
||||
expectedDependsOn,
|
||||
dependsOnRelations[sourceSetName],
|
||||
"source set $sourceSetName should depend on $expectedDependsOn"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
build("assemble", "compileDebugUnitTestJavaWithJavac") {
|
||||
assertSuccessful()
|
||||
|
||||
|
||||
-8
@@ -51,12 +51,4 @@ kotlin {
|
||||
fromPreset(presets.jvm, 'jvmLib')
|
||||
fromPreset(presets.js, 'jsLib')
|
||||
}
|
||||
}
|
||||
|
||||
task printSourceSetDependsOnRelations {
|
||||
doFirst {
|
||||
kotlin.sourceSets.each { sourceSet ->
|
||||
println sourceSet.name + " dependsOn " + sourceSet.dependsOn.collect { it.name }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user