Skip to content

Commit

Permalink
Fix Androidx cache misses on :biometric:integration-tests:testapp (#87)
Browse files Browse the repository at this point in the history
MergeResources and DataBindingGenBaseClassesTask are not cache relocatable when sourceSets are not in rootDir
  • Loading branch information
jprinet authored Dec 4, 2023
1 parent 95dd6f9 commit 3c87bbc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/run-experiments-androidx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ jobs:
uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/download@actions-stable
with:
token: ${{ secrets.GITHUB_TOKEN }}
# MergeResources and DataBindingGenBaseClassesTask are not cache relocatable when resourceDirsOutsideRootProjectDir is not empty
# https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/MergeResources.kt;l=164?q=MergeResources
# This is the case here as androidx/biometric project has its root dir set to androidx/playground-projects/biometric-playground
- name: Adjust git hook to temporarily disable caching for MergeResources and DataBindingGenBaseClassesTask on biometric:integration-tests
run: |
mkdir ~/git-hooks
echo -e 'echo "\nproject.getTasks().withType(com.android.build.gradle.tasks.MergeResources).configureEach { outputs.doNotCacheIf(\"MergeResources is not cache relocatable when resourceDirsOutsideRootProjectDir is not empty\") { true } }" >> biometric/integration-tests/testapp/build.gradle\n' > ~/git-hooks/post-checkout
echo -e 'echo "\nproject.getTasks().withType(com.android.build.gradle.internal.tasks.databinding.DataBindingGenBaseClassesTask).configureEach { outputs.doNotCacheIf(\"DataBindingGenBaseClassesTask is not cache relocatable when resourceDirsOutsideRootProjectDir is not empty\") { true } }" >> biometric/integration-tests/testapp/build.gradle\n' >> ~/git-hooks/post-checkout
chmod +x ~/git-hooks/post-checkout
git config --global core.hooksPath ~/git-hooks
if: matrix.experimentId == 3
- name: Run experiment 1
uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/experiment-1@actions-stable
env:
Expand Down

0 comments on commit 3c87bbc

Please sign in to comment.