Skip to content

Commit b4fcec8

Browse files
authored
Adapt Gradle config according to Gradle Enterprise Trial experiments (#4705)
We are now utilizing the Gradle Enterprise remote cache.
1 parent bc1d616 commit b4fcec8

File tree

7 files changed

+27
-20
lines changed

7 files changed

+27
-20
lines changed

.github/workflows/ci-examples.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ env:
88
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
99
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
1010
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
11+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
1112

1213
jobs:
1314
find_gradle_jobs:

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ env:
88
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
99
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
1010
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
11+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
1112

1213
jobs:
1314
thundra_test_initializer:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,6 @@ src/mkdocs-codeinclude-plugin
6464
src/pip-delete-this-directory.txt
6565

6666
.DS_Store
67+
68+
# Codespaces / VSCode
69+
/.vscode/

build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,14 @@ subprojects {
4646
task delombok(type: io.franzbecker.gradle.lombok.task.DelombokTask) {
4747
def outputDir = file("$buildDir/delombok")
4848
outputs.dir(outputDir)
49+
outputs.cacheIf {
50+
true
51+
}
4952
for (srcDir in project.sourceSets.main.java.srcDirs) {
53+
// TODO: named input and relative path for `srcDir` to make task more cacheable
5054
inputs.dir(srcDir)
51-
args(srcDir, "-d", outputDir)
55+
// TODO: `outputDir` as relative path to make task more cacheable
56+
args(srcDir, "-d", outputDir, "-f", "generateDelombokComment:skip")
5257
}
5358
}
5459
delombok.onlyIf {

examples/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
}
77
dependencies {
88
classpath "gradle.plugin.ch.myniva.gradle:s3-build-cache:0.10.0"
9-
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.6.1"
9+
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.7.2"
1010
}
1111
}
1212

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
org.gradle.parallel=false
22
org.gradle.caching=true
3-
3+
org.gradle.configureondemand=true

settings.gradle

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ buildscript {
55
}
66
}
77
dependencies {
8-
classpath "gradle.plugin.ch.myniva.gradle:s3-build-cache:0.10.0"
9-
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.6.1"
10-
classpath "com.gradle:common-custom-user-data-gradle-plugin:1.2.1"
8+
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.7.2"
9+
classpath "com.gradle:common-custom-user-data-gradle-plugin:1.6.1"
1110
}
1211
}
1312

14-
apply plugin: 'ch.myniva.s3-build-cache'
1513
apply plugin: 'com.gradle.enterprise'
1614
apply plugin: "com.gradle.common-custom-user-data-gradle-plugin"
1715

@@ -38,21 +36,20 @@ ext.isMasterBuild = false ||
3836
(System.getenv("GITHUB_REF") == "refs/heads/master") ||
3937
(System.getenv("BUILD_SOURCEBRANCHNAME") == "master")
4038

39+
ext.isCI = System.getenv("CI") != null
40+
4141
buildCache {
4242
local {
43-
enabled = !isMasterBuild
43+
enabled = !isCI
4444
}
45-
46-
remote(ch.myniva.gradle.caching.s3.AwsS3BuildCache) {
47-
endpoint = 'fra1.digitaloceanspaces.com'
48-
region = 'fra1'
49-
bucket = 'testcontainers'
50-
path = 'cache'
51-
reducedRedundancy = false
52-
push = isMasterBuild && !System.getenv("READ_ONLY_REMOTE_GRADLE_CACHE")
53-
headers = [
54-
'x-amz-acl': 'public-read'
55-
]
45+
remote(HttpBuildCache) {
46+
push = isCI
47+
enabled = true
48+
url = 'https://ge.testcontainers.org/cache/'
49+
credentials {
50+
username = 'ci'
51+
password = System.getenv("GRADLE_ENTERPRISE_CACHE_PASSWORD")
52+
}
5653
}
5754
}
5855

@@ -61,7 +58,7 @@ gradleEnterprise {
6158
server = "https://ge.testcontainers.org/"
6259
publishAlways()
6360
publishIfAuthenticated()
64-
uploadInBackground = System.getenv("CI") == null
61+
uploadInBackground = !isCI
6562
captureTaskInputFiles = true
6663
}
6764

0 commit comments

Comments
 (0)