Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions gcpbuildcache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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

## Requirements

- Gradle 8.4 or newer

## Using the plugin

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

plugins {
id("androidx.build.gradle.gcpbuildcache") version "1.0.0"
id("androidx.build.gradle.gcpbuildcache") version "1.0.1"
}

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

```groovy
plugins {
id("androidx.build.gradle.gcpbuildcache") version "1.0.0"
id("androidx.build.gradle.gcpbuildcache") version "1.0.1"
}

import androidx.build.gradle.gcpbuildcache.GcpBuildCache
Expand Down
6 changes: 4 additions & 2 deletions gcpbuildcache/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ kotlin {
jvmToolchain {
jvmToolchain(17)
}
// Kotlin 1.9 is needed to support Gradle 8.4, if the value is changed, update README.md
compilerOptions {
languageVersion.set(KotlinVersion.KOTLIN_2_0)
@Suppress("DEPRECATION") // 1.9 is deprecated when using KGP 2.2.20
languageVersion.set(KotlinVersion.KOTLIN_1_9)
}
coreLibrariesVersion = "2.0.0"
coreLibrariesVersion = "1.9.0"
}

gradlePlugin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,28 @@ import org.gradle.testkit.runner.GradleRunner
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
import org.junit.runner.RunWith
import org.junit.runners.Parameterized

/**
* A simple functional test for the 'androidx.build.gradle.gcpbuildcache.GcpBuildCache' plugin.
*/
class GcpGradleBuildCachePluginFunctionalTest {
@RunWith(Parameterized::class)
class GcpGradleBuildCachePluginFunctionalTest(private val gradleVersion: String) {
companion object {
@get:JvmStatic
@get:Parameterized.Parameters(name = "gradleVersion={0}")
@Suppress("unused") // needed for Parameterized
val params = listOf(
arrayOf("8.4"),
arrayOf("8.5"),
arrayOf("8.11.1"),
arrayOf("8.14"),
arrayOf("9.0.0"),
arrayOf("9.1.0"),
)
}

@get:Rule val tempFolder = TemporaryFolder()

private fun getProjectDir() = tempFolder.root
Expand Down Expand Up @@ -56,11 +73,12 @@ class GcpGradleBuildCachePluginFunctionalTest {
getBuildFile().writeText("")

// Run the build
val runner = GradleRunner.create()
runner.forwardOutput()
runner.withPluginClasspath()
runner.withArguments("tasks")
runner.withProjectDir(getProjectDir())
runner.build();
GradleRunner.create()
.forwardOutput()
.withGradleVersion(gradleVersion)
.withPluginClasspath()
.withArguments("tasks", "-s")
.withProjectDir(getProjectDir())
.build();
}
}
Loading