Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit bd9f883

Browse files
authored
Improve Kotlin build caching (#1947)
* Update Gradle properties with Kotlin 1.7 build things * Disable build tooling metadata task * Revert "Revert "github: stop disabling configuration cache in CI"" This reverts commit 0895164. * Store build reports as artifacts
1 parent a6f7a96 commit bd9f883

File tree

9 files changed

+65
-16
lines changed

9 files changed

+65
-16
lines changed

.github/workflows/deploy_github_releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Build release binaries
3030
uses: gradle/[email protected]
3131
with:
32-
arguments: --no-configuration-cache :app:assembleFreeRelease :app:assembleNonFreeRelease :app:bundleNonFreeRelease
32+
arguments: :app:assembleFreeRelease :app:assembleNonFreeRelease :app:bundleNonFreeRelease
3333
env:
3434
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
3535

.github/workflows/deploy_library_releases.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Upload binaries
3333
uses: gradle/[email protected]
3434
with:
35-
arguments: --no-configuration-cache :${{ steps.task-select.outputs.PROJECT }}:publishAllPublicationsToMavenCentralRepository
35+
arguments: :${{ steps.task-select.outputs.PROJECT }}:publishAllPublicationsToMavenCentralRepository
3636
env:
3737
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
3838
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}
@@ -42,7 +42,7 @@ jobs:
4242
- name: Close and release repository
4343
uses: gradle/[email protected]
4444
with:
45-
arguments: --no-configuration-cache closeAndReleaseRepository
45+
arguments: closeAndReleaseRepository
4646
env:
4747
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
4848
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}

.github/workflows/deploy_snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
3636
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
3737
with:
38-
arguments: --no-configuration-cache collectFreeReleaseApks collectNonFreeReleaseApks -PsentryUploadMappings
38+
arguments: collectFreeReleaseApks collectNonFreeReleaseApks -PsentryUploadMappings
3939

4040
- name: Clean secrets
4141
run: scripts/signing-cleanup.sh

.github/workflows/draft_new_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ jobs:
6969
# that the version number is already correct, and we only need to drop the
7070
# -SNAPSHOT suffix.
7171
if [[ "${CHECKOUT_REF}" == "develop" ]]; then
72-
./gradlew --no-configuration-cache --no-daemon clearPreRelease
72+
./gradlew --no-daemon clearPreRelease
7373
else
74-
./gradlew --no-configuration-cache --no-daemon bumpPatch
74+
./gradlew --no-daemon bumpPatch
7575
fi
7676
7777
# Commit changes to the versioning

.github/workflows/pull_request.yml

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@ jobs:
4242
if: "${{ steps.service-changed.outputs.result == 'true' }}"
4343
uses: gradle/[email protected]
4444
with:
45-
arguments: --no-configuration-cache spotlessCheck
45+
arguments: spotlessCheck
46+
47+
- name: Upload Kotlin build report
48+
if: "${{ always() }}"
49+
uses: actions/[email protected]
50+
with:
51+
name: Build report
52+
path: build/reports/kotlin-build/
4653

4754
unit-tests:
4855
runs-on: ubuntu-latest
@@ -76,7 +83,7 @@ jobs:
7683
if: "${{ steps.service-changed.outputs.result == 'true' }}"
7784
uses: gradle/[email protected]
7885
with:
79-
arguments: --no-configuration-cache test -PslimTests
86+
arguments: test -PslimTests
8087

8188
- name: (Fail-only) Upload test report
8289
if: "${{ failure() }}"
@@ -85,6 +92,13 @@ jobs:
8592
name: Test report
8693
path: app/build/reports
8794

95+
- name: Upload Kotlin build report
96+
if: "${{ always() }}"
97+
uses: actions/[email protected]
98+
with:
99+
name: Build report
100+
path: build/reports/kotlin-build/
101+
88102
build-apks:
89103
runs-on: ubuntu-latest
90104
steps:
@@ -117,7 +131,14 @@ jobs:
117131
if: "${{ steps.service-changed.outputs.result == 'true' }}"
118132
uses: gradle/[email protected]
119133
with:
120-
arguments: --no-configuration-cache assembleFreeDebug assembleNonFreeDebug
134+
arguments: assembleFreeDebug assembleNonFreeDebug
135+
136+
- name: Upload Kotlin build report
137+
if: "${{ always() }}"
138+
uses: actions/[email protected]
139+
with:
140+
name: Build report
141+
path: build/reports/kotlin-build/
121142

122143
check-api:
123144
runs-on: ubuntu-latest
@@ -151,7 +172,14 @@ jobs:
151172
if: "${{ steps.service-changed.outputs.result == 'true' }}"
152173
uses: gradle/[email protected]
153174
with:
154-
arguments: --no-configuration-cache apiCheck
175+
arguments: apiCheck
176+
177+
- name: Upload Kotlin build report
178+
if: "${{ always() }}"
179+
uses: actions/[email protected]
180+
with:
181+
name: Build report
182+
path: build/reports/kotlin-build/
155183

156184
lint-debug:
157185
runs-on: ubuntu-latest
@@ -185,7 +213,14 @@ jobs:
185213
if: "${{ steps.service-changed.outputs.result == 'true' }}"
186214
uses: gradle/[email protected]
187215
with:
188-
arguments: --no-configuration-cache lintDebug
216+
arguments: lintDebug
217+
218+
- name: Upload Kotlin build report
219+
if: "${{ always() }}"
220+
uses: actions/[email protected]
221+
with:
222+
name: Build report
223+
path: build/reports/kotlin-build/
189224

190225
assemble-release-apks:
191226
runs-on: ubuntu-latest
@@ -219,4 +254,11 @@ jobs:
219254
if: "${{ steps.service-changed.outputs.result == 'true' }}"
220255
uses: gradle/[email protected]
221256
with:
222-
arguments: --no-configuration-cache aNFR
257+
arguments: aNFR
258+
259+
- name: Upload Kotlin build report
260+
if: "${{ always() }}"
261+
uses: actions/[email protected]
262+
with:
263+
name: Build report
264+
path: build/reports/kotlin-build/

.github/workflows/shadow_job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ jobs:
4444
env:
4545
GRADLE_VERSION_OVERRIDE_com_android_tools_build_gradle: ${{ matrix.agp-version }}
4646
with:
47-
arguments: --no-configuration-cache check
47+
arguments: check

.github/workflows/sync_crowdin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Download new translations from Crowdin
2121
uses: gradle/[email protected]
2222
with:
23-
arguments: --no-configuration-cache crowdin
23+
arguments: crowdin
2424
env:
2525
CROWDIN_LOGIN: ${{ secrets.CROWDIN_LOGIN }}
2626
CROWDIN_PROJECT_KEY: ${{ secrets.CROWDIN_PROJECT_KEY }}

.github/workflows/update_publicsuffix_data.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Download new publicsuffix data
2121
uses: gradle/[email protected]
2222
with:
23-
arguments: --no-configuration-cache updatePSL
23+
arguments: updatePSL
2424

2525
- name: Compare list changes
2626
run: if [[ $(git diff --binary --stat) != "" ]]; then echo "UPDATED=true" >> $GITHUB_ENV; fi
@@ -29,7 +29,7 @@ jobs:
2929
uses: gradle/[email protected]
3030
if: "${{ env.UPDATED == 'true' }}"
3131
with:
32-
arguments: --no-configuration-cache :autofill-parser:test -PslimTests
32+
arguments: :autofill-parser:test -PslimTests
3333

3434
- name: Create Pull Request
3535
id: cpr

gradle.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ kapt.incremental.apt=true
2424
# Turn off AP discovery in compile path to enable compile avoidance
2525
kapt.include.compile.classpath=false
2626

27+
# New incremental compilation for Kotlin
28+
kotlin.incremental.useClasspathSnapshot=true
29+
kotlin.build.report.output=file
30+
31+
# Disable Gradle task that breaks configuration caching
32+
kotlin.mpp.enableKotlinToolingMetadataArtifact=false
33+
2734
# Use R8 instead of ProGuard for code shrinking.
2835
android.enableR8.fullMode=true
2936

0 commit comments

Comments
 (0)