Bump advanced Gradle version to 7.0-milestone-3.

Fixed test setup that causes test failures.

^KT-44949 In Progress
This commit is contained in:
Yahor Berdnikau
2021-03-15 14:37:30 +01:00
committed by TeamCityServer
parent c38a793352
commit 6473d2a7c8
7 changed files with 28 additions and 11 deletions
@@ -81,7 +81,7 @@ fun Test.includeNative(include: Boolean) {
} }
fun Test.advanceGradleVersion() { fun Test.advanceGradleVersion() {
val gradleVersionForTests = "7.0-milestone-2" val gradleVersionForTests = "7.0-milestone-3"
systemProperty("kotlin.gradle.version.for.tests", gradleVersionForTests) systemProperty("kotlin.gradle.version.for.tests", gradleVersionForTests)
} }
@@ -48,7 +48,11 @@ class BuildCacheRelocationIT : BaseGradleIT() {
val (firstProject, secondProject) = (0..1).map { id -> val (firstProject, secondProject) = (0..1).map { id ->
workingDir = workingDirs[id] workingDir = workingDirs[id]
Project(projectName, directoryPrefix = projectDirectoryPrefix).apply { Project(
projectName,
directoryPrefix = projectDirectoryPrefix,
gradleVersionRequirement = gradleVersionRequirement
).apply {
setupWorkingDir() setupWorkingDir()
initProject() initProject()
prepareLocalBuildCache(localBuildCacheDirectory) prepareLocalBuildCache(localBuildCacheDirectory)
@@ -90,6 +94,7 @@ class BuildCacheRelocationIT : BaseGradleIT() {
class TestCase( class TestCase(
val projectName: String, val projectName: String,
val gradleVersionRequirement: GradleVersionRequired = GradleVersionRequired.None,
val cacheableTaskNames: List<String>, val cacheableTaskNames: List<String>,
val projectDirectoryPrefix: String? = null, val projectDirectoryPrefix: String? = null,
val outputRootPaths: List<String> = listOf("build"), val outputRootPaths: List<String> = listOf("build"),
@@ -148,6 +153,7 @@ class BuildCacheRelocationIT : BaseGradleIT() {
outputRootPaths = listOf("lib", "libJvm", "libJs").map { "$it/build" } outputRootPaths = listOf("lib", "libJvm", "libJs").map { "$it/build" }
), ),
TestCase("AndroidProject", TestCase("AndroidProject",
gradleVersionRequirement = GradleVersionRequired.AtLeast("6.6.1"),
taskToExecute = arrayOf("assembleDebug"), taskToExecute = arrayOf("assembleDebug"),
cacheableTaskNames = listOf("Lib", "Android").flatMap { module -> cacheableTaskNames = listOf("Lib", "Android").flatMap { module ->
listOf("Flavor1", "Flavor2").flatMap { flavor -> listOf("Flavor1", "Flavor2").flatMap { flavor ->
@@ -157,9 +163,10 @@ class BuildCacheRelocationIT : BaseGradleIT() {
} }
}, },
outputRootPaths = listOf("Lib", "Android", "Test").map { "$it/build" }, outputRootPaths = listOf("Lib", "Android", "Test").map { "$it/build" },
androidGradlePluginVersion = AGPVersion.v3_6_0 androidGradlePluginVersion = AGPVersion.v4_2_0
), ),
TestCase("android-dagger", TestCase("android-dagger",
gradleVersionRequirement = GradleVersionRequired.AtLeast("6.6.1"),
taskToExecute = arrayOf("assembleDebug"), taskToExecute = arrayOf("assembleDebug"),
projectDirectoryPrefix = "kapt2", projectDirectoryPrefix = "kapt2",
cacheableTaskNames = listOf("Debug").flatMap { buildType -> cacheableTaskNames = listOf("Debug").flatMap { buildType ->
@@ -169,7 +176,7 @@ class BuildCacheRelocationIT : BaseGradleIT() {
}, },
outputRootPaths = listOf("app/build"), outputRootPaths = listOf("app/build"),
initProject = { File(projectDir, "app/build.gradle").appendText("\nkapt.useBuildCache = true") }, initProject = { File(projectDir, "app/build.gradle").appendText("\nkapt.useBuildCache = true") },
androidGradlePluginVersion = AGPVersion.v3_6_0 androidGradlePluginVersion = AGPVersion.v4_2_0
), ),
TestCase("native-build-cache", TestCase("native-build-cache",
taskToExecute = arrayOf("build-cache-lib:publish", "build-cache-app:assemble"), taskToExecute = arrayOf("build-cache-lib:publish", "build-cache-app:assemble"),
@@ -264,10 +264,13 @@ class KaptIncrementalWithIsolatingApt : KaptIncrementalIT() {
//https://youtrack.jetbrains.com/issue/KTI-405 //https://youtrack.jetbrains.com/issue/KTI-405
if (System.getProperty("os.name")?.toLowerCase()?.contains("windows") == true) return if (System.getProperty("os.name")?.toLowerCase()?.contains("windows") == true) return
val project = Project("kaptIncrementalWithParceler", GradleVersionRequired.None).apply { val project = Project(
projectName = "kaptIncrementalWithParceler",
gradleVersionRequirement = GradleVersionRequired.AtLeast("6.6.1")
).apply {
setupWorkingDir() setupWorkingDir()
} }
val options = defaultBuildOptions().copy(androidGradlePluginVersion = AGPVersion.v3_6_0) val options = defaultBuildOptions().copy(androidGradlePluginVersion = AGPVersion.v4_2_0)
project.build("clean", ":mylibrary:assembleDebug", options = options) { project.build("clean", ":mylibrary:assembleDebug", options = options) {
assertSuccessful() assertSuccessful()
} }
@@ -1117,12 +1117,15 @@ class KotlinGradleIT : BaseGradleIT() {
@Test @Test
fun testKtKt35942InternalsFromMainInTestViaTransitiveDepsAndroid() = with( fun testKtKt35942InternalsFromMainInTestViaTransitiveDepsAndroid() = with(
Project("kt-35942-android", GradleVersionRequired.FOR_MPP_SUPPORT) Project(
projectName = "kt-35942-android",
gradleVersionRequirement = GradleVersionRequired.AtLeast("6.6.1")
)
) { ) {
build( build(
":lib1:compileDebugUnitTestKotlin", ":lib1:compileDebugUnitTestKotlin",
options = defaultBuildOptions().copy( options = defaultBuildOptions().copy(
androidGradlePluginVersion = AGPVersion.v3_6_0, androidGradlePluginVersion = AGPVersion.v4_2_0,
androidHome = KtTestUtil.findAndroidSdk(), androidHome = KtTestUtil.findAndroidSdk(),
), ),
) { ) {
@@ -1408,7 +1408,7 @@ class NewMultiplatformIT : BaseGradleIT() {
(Regex.escape(">> :app:testNonTransitiveStringNotationApiDependenciesMetadata") + " .*").toRegex().findAll(output).count() (Regex.escape(">> :app:testNonTransitiveStringNotationApiDependenciesMetadata") + " .*").toRegex().findAll(output).count()
) )
assertContains(">> :app:testNonTransitiveDependencyNotationApiDependenciesMetadata --> kotlin-reflect-${defaultBuildOptions().kotlinVersion}.jar") assertContains(">> :app:testNonTransitiveDependencyNotationApiDependenciesMetadata --> kotlin-reflect-${defaultBuildOptions().kotlinVersion}.jar")
assertEquals( assertEquals(
1, 1,
(Regex.escape(">> :app:testNonTransitiveStringNotationApiDependenciesMetadata") + " .*").toRegex().findAll(output) (Regex.escape(">> :app:testNonTransitiveStringNotationApiDependenciesMetadata") + " .*").toRegex().findAll(output)
@@ -134,9 +134,13 @@ class SimpleKotlinGradleIT : BaseGradleIT() {
//Proguard corrupts RuntimeInvisibleParameterAnnotations/RuntimeVisibleParameterAnnotations tables: //Proguard corrupts RuntimeInvisibleParameterAnnotations/RuntimeVisibleParameterAnnotations tables:
// https://sourceforge.net/p/proguard/bugs/735/ // https://sourceforge.net/p/proguard/bugs/735/
// Gradle 7 compatibility issue: https://github.com/Guardsquare/proguard/issues/136
@Test @Test
fun testInteropWithProguarded() { fun testInteropWithProguarded() {
Project("interopWithProguarded").build("build") { Project(
projectName = "interopWithProguarded",
gradleVersionRequirement = GradleVersionRequired.Until("6.8.4")
).build("build") {
assertSuccessful() assertSuccessful()
assertTasksExecuted(":test") assertTasksExecuted(":test")
assertContains("InteropWithProguardedTest PASSED") assertContains("InteropWithProguardedTest PASSED")
@@ -221,7 +221,7 @@ class SubpluginsIT : BaseGradleIT() {
build( build(
":app:compileDebugKotlin", ":app:compileDebugKotlin",
options = defaultBuildOptions().copy( options = defaultBuildOptions().copy(
androidGradlePluginVersion = AGPVersion.v3_4_1, androidGradlePluginVersion = AGPVersion.v4_2_0,
androidHome = KtTestUtil.findAndroidSdk() androidHome = KtTestUtil.findAndroidSdk()
) )
) { ) {