Skip to content

Commit

Permalink
Android: Add restore android merged manifest script
Browse files Browse the repository at this point in the history
  • Loading branch information
ParaskP7 committed Feb 19, 2025
1 parent a960f3b commit 5752276
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions bin/restore_android_merged_manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash -eu

MODULE=$1

echo "Current directory is: $(pwd)"
echo "Current directory contents are: $(ls -la)"

# The key is shared with `bin/save_android_merged_manifest`
ANDROID_MERGED_MANIFEST_KEY="${BUILDKITE_PIPELINE_SLUG}_ANDROID_MERGED_MANIFEST_${MODULE}"

echo "Restoring Android merged manifest..."

# The directory is shared with `bin/save_android_merged_manifest`
ANDROID_MERGED_MANIFEST="${HOME}/.android/merged_manifest/${MODULE}"
echo "ANDROID_MERGED_MANIFEST: ${ANDROID_MERGED_MANIFEST}"

mkdir -p "$ANDROID_MERGED_MANIFEST"

MERGED_MANIFEST_BASE_FOLDER=$(dirname "$ANDROID_MERGED_MANIFEST")
echo "MERGED_MANIFEST_BASE_FOLDER: ${MERGED_MANIFEST_BASE_FOLDER}"
MERGED_MANIFEST_FOLDER_NAME=$(basename "$ANDROID_MERGED_MANIFEST")
echo "MERGED_MANIFEST_FOLDER_NAME: ${MERGED_MANIFEST_FOLDER_NAME}"

# `save_cache` & `restore_cache` scripts only work if they are called from the same directory
pushd "$MERGED_MANIFEST_BASE_FOLDER"
restore_cache "$ANDROID_MERGED_MANIFEST_KEY"
echo "Current directory is: $(pwd)"
echo "Current directory contents are: $(ls -la)"
echo "Directory contents of 'MODULE': $(ls -la "${MODULE}")"
popd

0 comments on commit 5752276

Please sign in to comment.