Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CircleCI Orb to Ensure Cache Key References Kotlin Gradle Scripts #50

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 11 additions & 3 deletions src/commands/install_android_gradle_dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
description: >
Install your Android gradle packages with automated caching and best practices applied. Requires build.gradle file.
Install your Android gradle packages with automated caching and best practices applied. Requires build.gradle or build.gradle.kts file.
parameters:
app-dir:
default: .
Expand All @@ -10,8 +10,16 @@ parameters:
description: Change the default cache version if you need to clear the cache for any reason.
type: string
steps:
- run:
name: Calculate cache key
command: |
if [ -f "<< parameters.app-dir >>/android/app/build.gradle" ]; then
md5sum << parameters.app-dir >>/android/app/build.gradle > ~/gradle_cache_key
else
md5sum << parameters.app-dir >>/android/app/build.gradle.kts > ~/gradle_cache_key
fi
- restore_cache:
key: gradle-<<parameters.cache-version>>-{{ checksum "<< parameters.app-dir >>/android/app/build.gradle" }}
key: gradle-<<parameters.cache-version>>-{{ checksum "~/gradle_cache_key" }}
- run:
name: Installing Android gradle packages
command: gradle androidDependencies
Expand All @@ -20,4 +28,4 @@ steps:
paths:
- ~/.gradle/caches
- ~/.gradle/wrapper
key: gradle-<<parameters.cache-version>>-{{ checksum "<< parameters.app-dir >>/android/app/build.gradle" }}
key: gradle-<<parameters.cache-version>>-{{ checksum "~/gradle_cache_key" }}