Remove one more dependency on android extensions project in integration tests.
This commit is contained in:
committed by
Alexander Udalov
parent
b2dc2ed0be
commit
9e6a01081c
-64
@@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.model
|
|
||||||
|
|
||||||
import org.gradle.api.logging.configuration.WarningMode
|
|
||||||
import org.gradle.util.GradleVersion
|
|
||||||
import org.jetbrains.kotlin.gradle.testbase.*
|
|
||||||
import org.junit.jupiter.api.DisplayName
|
|
||||||
import kotlin.test.assertEquals
|
|
||||||
import kotlin.test.assertFalse
|
|
||||||
import kotlin.test.assertNull
|
|
||||||
import kotlin.test.assertTrue
|
|
||||||
|
|
||||||
@DisplayName("Kotlin-android plugin models")
|
|
||||||
@OtherGradlePluginTests
|
|
||||||
class KotlinAndroidExtensionIT : KGPBaseTest() {
|
|
||||||
override val defaultBuildOptions = super.defaultBuildOptions.copy(
|
|
||||||
androidVersion = TestVersions.AGP.AGP_36,
|
|
||||||
warningMode = WarningMode.Summary
|
|
||||||
)
|
|
||||||
|
|
||||||
@DisplayName("Has valid model when plugin is applied")
|
|
||||||
@GradleTest
|
|
||||||
fun testAndroidExtensionsProject(gradleVersion: GradleVersion) {
|
|
||||||
project("AndroidExtensionsProject", gradleVersion) {
|
|
||||||
getModels<KotlinAndroidExtension> {
|
|
||||||
with(getModel(":app")!!) {
|
|
||||||
assertEquals(1L, modelVersion)
|
|
||||||
assertEquals("app", name)
|
|
||||||
assertFalse(isExperimental)
|
|
||||||
assertEquals("hashMap", defaultCacheImplementation)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@DisplayName("Has valid model in android multivariant project when plugin is applied")
|
|
||||||
@GradleTest
|
|
||||||
fun testAndroidExtensionsManyVariants(gradleVersion: GradleVersion) {
|
|
||||||
project("AndroidExtensionsManyVariants", gradleVersion) {
|
|
||||||
getModels<KotlinAndroidExtension> {
|
|
||||||
with(getModel(":app")!!) {
|
|
||||||
assertEquals(1L, modelVersion)
|
|
||||||
assertEquals("app", name)
|
|
||||||
assertTrue(isExperimental)
|
|
||||||
assertEquals("hashMap", defaultCacheImplementation)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@DisplayName("Doesn't have model when plugin is not applied")
|
|
||||||
@GradleTest
|
|
||||||
fun testNonAndroidExtensionsProjects(gradleVersion: GradleVersion) {
|
|
||||||
project("kotlinProject", gradleVersion) {
|
|
||||||
getModels<KotlinAndroidExtension> {
|
|
||||||
assertNull(getModel(":"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-117
@@ -164,123 +164,6 @@ class KotlinProjectIT : KGPBaseTest() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisplayName("Kotlin-android project model is valid")
|
|
||||||
@GradleTest
|
|
||||||
fun testAndroidProject(gradleVersion: GradleVersion) {
|
|
||||||
project(
|
|
||||||
"AndroidExtensionsProject",
|
|
||||||
gradleVersion,
|
|
||||||
buildOptions = defaultBuildOptions.copy(warningMode = WarningMode.Summary)
|
|
||||||
) {
|
|
||||||
getModels<KotlinProject> {
|
|
||||||
with(getModel(":app")!!) {
|
|
||||||
assertBasics(
|
|
||||||
"app",
|
|
||||||
defaultBuildOptions.kotlinVersion,
|
|
||||||
KotlinProject.ProjectType.PLATFORM_JVM,
|
|
||||||
)
|
|
||||||
|
|
||||||
assertTrue(expectedByDependencies.isEmpty())
|
|
||||||
assertEquals(5, sourceSets.size)
|
|
||||||
|
|
||||||
val sourceSets = sourceSets.sortedBy { it.name }
|
|
||||||
|
|
||||||
sourceSets[0].verifySourceSet(
|
|
||||||
this@project,
|
|
||||||
"debug",
|
|
||||||
SourceSet.SourceSetType.PRODUCTION,
|
|
||||||
listOf(),
|
|
||||||
listOf(
|
|
||||||
"app/src/debug/kotlin",
|
|
||||||
"app/src/debug/java",
|
|
||||||
"app/src/main/kotlin",
|
|
||||||
"app/src/main/java"
|
|
||||||
),
|
|
||||||
listOf(
|
|
||||||
"app/src/debug/resources",
|
|
||||||
"app/src/main/resources"
|
|
||||||
),
|
|
||||||
"app/build/tmp/kotlin-classes/debug", "app/build/processedResources/debug"
|
|
||||||
)
|
|
||||||
sourceSets[1].verifySourceSet(
|
|
||||||
this@project,
|
|
||||||
"debugAndroidTest",
|
|
||||||
SourceSet.SourceSetType.TEST,
|
|
||||||
listOf("debug"),
|
|
||||||
listOf(
|
|
||||||
"app/src/debugAndroidTest/kotlin",
|
|
||||||
"app/src/androidTest/kotlin",
|
|
||||||
"app/src/androidTest/java",
|
|
||||||
"app/src/androidTestDebug/kotlin",
|
|
||||||
"app/src/androidTestDebug/java"
|
|
||||||
),
|
|
||||||
listOf(
|
|
||||||
"app/src/debugAndroidTest/resources",
|
|
||||||
"app/src/androidTest/resources",
|
|
||||||
"app/src/androidTestDebug/resources"
|
|
||||||
),
|
|
||||||
"app/build/tmp/kotlin-classes/debugAndroidTest", "app/build/processedResources/debugAndroidTest"
|
|
||||||
)
|
|
||||||
sourceSets[2].verifySourceSet(
|
|
||||||
this@project,
|
|
||||||
"debugUnitTest",
|
|
||||||
SourceSet.SourceSetType.TEST,
|
|
||||||
listOf("debug"),
|
|
||||||
listOf(
|
|
||||||
"app/src/debugUnitTest/kotlin",
|
|
||||||
"app/src/test/kotlin",
|
|
||||||
"app/src/test/java",
|
|
||||||
"app/src/testDebug/kotlin",
|
|
||||||
"app/src/testDebug/java"
|
|
||||||
),
|
|
||||||
listOf(
|
|
||||||
"app/src/debugUnitTest/resources",
|
|
||||||
"app/src/test/resources",
|
|
||||||
"app/src/testDebug/resources"
|
|
||||||
),
|
|
||||||
"app/build/tmp/kotlin-classes/debugUnitTest", "app/build/processedResources/debugUnitTest"
|
|
||||||
)
|
|
||||||
sourceSets[3].verifySourceSet(
|
|
||||||
this@project,
|
|
||||||
"release",
|
|
||||||
SourceSet.SourceSetType.PRODUCTION,
|
|
||||||
listOf(),
|
|
||||||
listOf(
|
|
||||||
"app/src/release/kotlin",
|
|
||||||
"app/src/release/java",
|
|
||||||
"app/src/main/kotlin",
|
|
||||||
"app/src/main/java"
|
|
||||||
),
|
|
||||||
listOf(
|
|
||||||
"app/src/release/resources",
|
|
||||||
"app/src/main/resources"
|
|
||||||
),
|
|
||||||
"app/build/tmp/kotlin-classes/release", "app/build/processedResources/release"
|
|
||||||
)
|
|
||||||
sourceSets[4].verifySourceSet(
|
|
||||||
this@project,
|
|
||||||
"releaseUnitTest",
|
|
||||||
SourceSet.SourceSetType.TEST,
|
|
||||||
listOf("release"),
|
|
||||||
listOf(
|
|
||||||
"app/src/releaseUnitTest/kotlin",
|
|
||||||
"app/src/test/kotlin",
|
|
||||||
"app/src/test/java",
|
|
||||||
"app/src/testRelease/kotlin",
|
|
||||||
"app/src/testRelease/java"
|
|
||||||
),
|
|
||||||
listOf(
|
|
||||||
"app/src/releaseUnitTest/resources",
|
|
||||||
"app/src/test/resources",
|
|
||||||
"app/src/testRelease/resources"
|
|
||||||
),
|
|
||||||
"app/build/tmp/kotlin-classes/releaseUnitTest", "app/build/processedResources/releaseUnitTest"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun SourceSet.verifySourceSet(
|
private fun SourceSet.verifySourceSet(
|
||||||
testProject: TestProject,
|
testProject: TestProject,
|
||||||
name: String,
|
name: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user