Skip to content

Commit cfc36fb

Browse files
authored
Merge pull request #72 from androidx/gradle-requirements
Ensure that androidx.build.gradle.gcpbuildcache support Gradle 8.4 or newer
2 parents 2a29c89 + c980c75 commit cfc36fb

File tree

3 files changed

+35
-11
lines changed

3 files changed

+35
-11
lines changed

gcpbuildcache/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
An implementation of the Gradle Remote Cache that's backed by Google Cloud Storage buckets.
44

5+
## Requirements
6+
7+
- Gradle 8.4 or newer
8+
59
## Using the plugin
610

711
In your `settings.gradle.kts` file add the following
@@ -12,7 +16,7 @@ import androidx.build.gradle.gcpbuildcache.GcpBuildCacheServiceFactory
1216
import androidx.build.gradle.gcpbuildcache.ExportedKeyGcpCredentials
1317

1418
plugins {
15-
id("androidx.build.gradle.gcpbuildcache") version "1.0.0"
19+
id("androidx.build.gradle.gcpbuildcache") version "1.0.1"
1620
}
1721

1822
buildCache {
@@ -35,7 +39,7 @@ If you are using Groovy, then you should do the following:
3539

3640
```groovy
3741
plugins {
38-
id("androidx.build.gradle.gcpbuildcache") version "1.0.0"
42+
id("androidx.build.gradle.gcpbuildcache") version "1.0.1"
3943
}
4044
4145
import androidx.build.gradle.gcpbuildcache.GcpBuildCache

gcpbuildcache/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ kotlin {
4141
jvmToolchain {
4242
jvmToolchain(17)
4343
}
44+
// Kotlin 1.9 is needed to support Gradle 8.4, if the value is changed, update README.md
4445
compilerOptions {
45-
languageVersion.set(KotlinVersion.KOTLIN_2_0)
46+
@Suppress("DEPRECATION") // 1.9 is deprecated when using KGP 2.2.20
47+
languageVersion.set(KotlinVersion.KOTLIN_1_9)
4648
}
47-
coreLibrariesVersion = "2.0.0"
49+
coreLibrariesVersion = "1.9.0"
4850
}
4951

5052
gradlePlugin {

gcpbuildcache/src/functionalTest/kotlin/androidx/build/gradle/gcpbuildcache/GcpGradleBuildCachePluginFunctionalTest.kt

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,28 @@ import org.gradle.testkit.runner.GradleRunner
2424
import org.junit.Rule
2525
import org.junit.Test
2626
import org.junit.rules.TemporaryFolder
27+
import org.junit.runner.RunWith
28+
import org.junit.runners.Parameterized
2729

2830
/**
2931
* A simple functional test for the 'androidx.build.gradle.gcpbuildcache.GcpBuildCache' plugin.
3032
*/
31-
class GcpGradleBuildCachePluginFunctionalTest {
33+
@RunWith(Parameterized::class)
34+
class GcpGradleBuildCachePluginFunctionalTest(private val gradleVersion: String) {
35+
companion object {
36+
@get:JvmStatic
37+
@get:Parameterized.Parameters(name = "gradleVersion={0}")
38+
@Suppress("unused") // needed for Parameterized
39+
val params = listOf(
40+
arrayOf("8.4"),
41+
arrayOf("8.5"),
42+
arrayOf("8.11.1"),
43+
arrayOf("8.14"),
44+
arrayOf("9.0.0"),
45+
arrayOf("9.1.0"),
46+
)
47+
}
48+
3249
@get:Rule val tempFolder = TemporaryFolder()
3350

3451
private fun getProjectDir() = tempFolder.root
@@ -56,11 +73,12 @@ class GcpGradleBuildCachePluginFunctionalTest {
5673
getBuildFile().writeText("")
5774

5875
// Run the build
59-
val runner = GradleRunner.create()
60-
runner.forwardOutput()
61-
runner.withPluginClasspath()
62-
runner.withArguments("tasks")
63-
runner.withProjectDir(getProjectDir())
64-
runner.build();
76+
GradleRunner.create()
77+
.forwardOutput()
78+
.withGradleVersion(gradleVersion)
79+
.withPluginClasspath()
80+
.withArguments("tasks", "-s")
81+
.withProjectDir(getProjectDir())
82+
.build();
6583
}
6684
}

0 commit comments

Comments
 (0)