Skip to content

Commit 4c89a56

Browse files
MV-GHdessalines
andauthored
Improve woodpecker build times (#1139)
* Update woodpecker config * Upgradle gradle to 8.2.1 and set buildtoolsversion * Trigger woodpecker * Test using gradle instead of gradlew * Test run using drone cache * Fix formatting * Trigger woodpecker * Probably wont work * Probably wont work * No privileges as estimated * Test * Alr should print the size * Stuck? * Does weird stuff in logs if debug:true * try caches only * try caches only * try caches only * Add wrapper * trigger woodpecker * Test wrapper only * trigger woodpecker * Try something diff * Try something diff * Show me the gradle locations * Show me the .gradle file locations * Hmmm * dont sopt plz * Introspect * wow * Where is this .gradle * Hmmm * TEST * Only rebuild when build.gradle changes * Only rebuild when build.gradle changes * Shouldnt rebuild * Shouldnt rebuild * Go ahead * Trigger woodpecker --------- Co-authored-by: Dessalines <[email protected]>
1 parent 014582c commit 4c89a56

File tree

6 files changed

+62
-9
lines changed

6 files changed

+62
-9
lines changed

.woodpecker.yml

+48-3
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,74 @@ steps:
44
commands:
55
- prettier -c "*.md" "*.yml"
66

7+
restore-cache:
8+
image: meltwater/drone-cache:v1
9+
pull: true
10+
settings:
11+
restore: true
12+
endpoint:
13+
from_secret: MINIO_ENDPOINT
14+
access-key:
15+
from_secret: MINIO_WRITE_USER
16+
secret-key:
17+
from_secret: MINIO_WRITE_PASSWORD
18+
bucket:
19+
from_secret: MINIO_BUCKET
20+
region: us-east-1
21+
cache_key: "jerboa-cache"
22+
path-style: true
23+
mount:
24+
- ".gradle"
25+
secrets:
26+
[MINIO_ENDPOINT, MINIO_WRITE_USER, MINIO_WRITE_PASSWORD, MINIO_BUCKET]
27+
728
check_formatting:
829
image: cimg/android:2023.08
930
commands:
1031
- sudo chown -R circleci:circleci .
1132
- ./gradlew lintKotlin
1233
environment:
13-
GRADLE_RO_DEP_CACHE: .depcache
34+
GRADLE_USER_HOME: ".gradle"
1435

1536
build_project:
1637
image: cimg/android:2023.08
1738
commands:
1839
- sudo chown -R circleci:circleci .
1940
- ./gradlew assembleDebug
2041
environment:
21-
GRADLE_RO_DEP_CACHE: .depcache
42+
GRADLE_USER_HOME: ".gradle"
2243

2344
run_tests:
2445
image: cimg/android:2023.08
2546
commands:
2647
- sudo chown -R circleci:circleci .
2748
- ./gradlew testDebug
2849
environment:
29-
GRADLE_RO_DEP_CACHE: .depcache
50+
GRADLE_USER_HOME: ".gradle"
51+
52+
rebuild-cache:
53+
image: meltwater/drone-cache:v1
54+
pull: true
55+
settings:
56+
rebuild: true
57+
endpoint:
58+
from_secret: MINIO_ENDPOINT
59+
access-key:
60+
from_secret: MINIO_WRITE_USER
61+
secret-key:
62+
from_secret: MINIO_WRITE_PASSWORD
63+
bucket:
64+
from_secret: MINIO_BUCKET
65+
cache_key: "jerboa-cache"
66+
region: us-east-1
67+
path-style: true
68+
mount:
69+
- ".gradle"
70+
secrets:
71+
[MINIO_ENDPOINT, MINIO_WRITE_USER, MINIO_WRITE_PASSWORD, MINIO_BUCKET]
72+
when:
73+
- path:
74+
include: ["app/build.gradle.kts"]
3075

3176
notify:
3277
image: alpine:3

app/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ plugins {
1212
apply(from = "update_instances.gradle.kts")
1313

1414
android {
15+
buildToolsVersion = "34.0.0-rc3"
1516
compileSdk = 34
1617

1718
defaultConfig {

gradle.properties

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ kotlin.code.style=official
2323
android.nonTransitiveRClass=true
2424
android.nonFinalResIds=false
2525
org.gradle.configuration-cache=true
26+
# TODO remove once AGP 8.2 is out of alpha
27+
android.suppressUnsupportedCompileSdk=34

gradle/wrapper/gradle-wrapper.jar

1.73 KB
Binary file not shown.
+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=38f66cd6eef217b4c35855bb11ea4e9fbc53594ccccb5fb82dfd317ef8c2c5a3
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionSha256Sum=03ec176d388f2aa99defcadc3ac6adf8dd2bce5145a129659537c0874dea5ad1
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
55
networkTimeout=10000
6+
validateDistributionUrl=true
67
zipStoreBase=GRADLE_USER_HOME
78
zipStorePath=wrapper/dists

gradlew

+8-4
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ done
8585
APP_BASE_NAME=${0##*/}
8686
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90-
9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
9390

@@ -133,10 +130,13 @@ location of your Java installation."
133130
fi
134131
else
135132
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
133+
if ! command -v java >/dev/null 2>&1
134+
then
135+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137136
138137
Please set the JAVA_HOME variable in your environment to match the
139138
location of your Java installation."
139+
fi
140140
fi
141141

142142
# Increase the maximum file descriptors if we can.
@@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
197197
done
198198
fi
199199

200+
201+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203+
200204
# Collect all arguments for the java command;
201205
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202206
# shell script including quotes and variable substitutions, so put them in

0 commit comments

Comments
 (0)