From a4b472f93842f77438110691e4f5515c42b34a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Fri, 3 Nov 2023 22:18:54 +0100 Subject: [PATCH] Workaround AGP not being able to run basic tasks because it cannot make our lives any simpler it is for some reason forbidden --- .../modules/AndroidApplicationPluginTest.kt | 16 +++++++++++++--- .../starter/modules/AndroidLibraryPluginTest.kt | 16 +++++++++++++--- .../modules/tasks/ConfigurationCacheTest.kt | 12 +++++++++++- .../starter/modules/KotlinLibraryPluginTest.kt | 4 ++-- 4 files changed, 39 insertions(+), 9 deletions(-) diff --git a/android/src/test/kotlin/com/project/starter/modules/AndroidApplicationPluginTest.kt b/android/src/test/kotlin/com/project/starter/modules/AndroidApplicationPluginTest.kt index f4ef44a3..6f32a9c2 100644 --- a/android/src/test/kotlin/com/project/starter/modules/AndroidApplicationPluginTest.kt +++ b/android/src/test/kotlin/com/project/starter/modules/AndroidApplicationPluginTest.kt @@ -21,7 +21,17 @@ internal class AndroidApplicationPluginTest : WithGradleProjectTest() { rootDirectory.apply { resolve("settings.gradle").writeText("""include ":module1", ":module2" """) - rootBuildScript = resolve("build.gradle") + rootBuildScript = resolve("build.gradle") { + writeText(""" + plugins { + id('com.starter.config') + } + + commonConfig { + javaVersion = JavaVersion.VERSION_1_8 // workaround for http://issuetracker.google.com/issues/294137077 + } + """.trimIndent()) + } module1Root = resolve("module1") { val buildScript = // language=groovy @@ -45,7 +55,7 @@ internal class AndroidApplicationPluginTest : WithGradleProjectTest() { } dependencies { - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.2' } """.trimIndent() @@ -83,7 +93,7 @@ internal class AndroidApplicationPluginTest : WithGradleProjectTest() { } dependencies { - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.2' } """.trimIndent(), diff --git a/android/src/test/kotlin/com/project/starter/modules/AndroidLibraryPluginTest.kt b/android/src/test/kotlin/com/project/starter/modules/AndroidLibraryPluginTest.kt index d44b5f26..4d5bdd89 100644 --- a/android/src/test/kotlin/com/project/starter/modules/AndroidLibraryPluginTest.kt +++ b/android/src/test/kotlin/com/project/starter/modules/AndroidLibraryPluginTest.kt @@ -22,7 +22,17 @@ internal class AndroidLibraryPluginTest : WithGradleProjectTest() { mkdirs() resolve("settings.gradle").writeText("""include ":module1", ":module2" """) - rootBuildScript = resolve("build.gradle") + rootBuildScript = resolve("build.gradle") { + writeText(""" + plugins { + id('com.starter.config') + } + + commonConfig { + javaVersion = JavaVersion.VERSION_1_8 // workaround for http://issuetracker.google.com/issues/294137077 + } + """.trimIndent()) + } module1Root = resolve("module1") { val buildScript = // language=groovy @@ -46,7 +56,7 @@ internal class AndroidLibraryPluginTest : WithGradleProjectTest() { } dependencies { - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.2' } """.trimIndent() @@ -88,7 +98,7 @@ internal class AndroidLibraryPluginTest : WithGradleProjectTest() { } dependencies { - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.2' } """.trimIndent(), diff --git a/android/src/test/kotlin/com/project/starter/modules/tasks/ConfigurationCacheTest.kt b/android/src/test/kotlin/com/project/starter/modules/tasks/ConfigurationCacheTest.kt index bc297628..af4353c1 100644 --- a/android/src/test/kotlin/com/project/starter/modules/tasks/ConfigurationCacheTest.kt +++ b/android/src/test/kotlin/com/project/starter/modules/tasks/ConfigurationCacheTest.kt @@ -16,7 +16,17 @@ internal class ConfigurationCacheTest : WithGradleProjectTest() { rootDirectory.apply { resolve("settings.gradle").writeText("""include ':module1', ':module2' """) - resolve("build.gradle").writeText("") + resolve("build.gradle") { + writeText(""" + plugins { + id('com.starter.config') + } + + commonConfig { + javaVersion = JavaVersion.VERSION_1_8 // workaround for http://issuetracker.google.com/issues/294137077 + } + """.trimIndent()) + } androidModuleRoot = resolve("module1") { // language=groovy val script = diff --git a/jvm/src/test/kotlin/com/project/starter/modules/KotlinLibraryPluginTest.kt b/jvm/src/test/kotlin/com/project/starter/modules/KotlinLibraryPluginTest.kt index 21ccb38d..8b9e0d37 100644 --- a/jvm/src/test/kotlin/com/project/starter/modules/KotlinLibraryPluginTest.kt +++ b/jvm/src/test/kotlin/com/project/starter/modules/KotlinLibraryPluginTest.kt @@ -35,7 +35,7 @@ internal class KotlinLibraryPluginTest : WithGradleProjectTest() { } dependencies { - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.2' } """.trimIndent(), @@ -57,7 +57,7 @@ internal class KotlinLibraryPluginTest : WithGradleProjectTest() { } dependencies { - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.2' } """.trimIndent(),