Last active
October 14, 2022 21:59
-
-
Save BelooS/3a36a5f2130a0a6357641aebc360b3f9 to your computer and use it in GitHub Desktop.
persist manifest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eo pipefail | |
#extract_manifest.sh {TARGET_APP_NAME} {BUILD_TYPE} | |
#launch example: ./ci/extract_manifest.sh app debug | |
TARGET_APP_NAME=$1 | |
BUILD_TYPE=$2 | |
echo "extract manifest for $TARGET_APP_NAME" | |
build_dir="$WORKSPACE/$TARGET_APP_NAME/build" | |
source_file="$build_dir/intermediates/merged_manifest/$BUILD_TYPE/AndroidManifest.xml" | |
source_log_file="$build_dir/outputs/logs/manifest-merger-$BUILD_TYPE-report.txt" | |
manifest_target_dir="$MANIFESTS_WORKSPACE_DIR/$BUILD_TYPE/$TARGET_APP_NAME" | |
mkdir -p "$manifest_target_dir" | |
cp "$source_log_file" "$manifest_target_dir" || echo "Failed to copy manifest log for $TARGET_APP_NAME" | |
cp "$source_file" "$manifest_target_dir" || echo "Failed to copy manifest for $TARGET_APP_NAME" | |
export TARGET_MANIFEST_PATH=$source_file | |
export SORTED_MANIFEST_PATH="$manifest_target_dir/AndroidManifest-sorted.xml" | |
function failedManifestSorting { | |
echo "Failed to sort© manifest for $TARGET_APP_NAME" | |
exit 1 | |
} | |
#sort and store copy of manifest to $SORTED_MANIFEST_PATH | |
python3 ./sort_manifest.py || failedManifestSorting | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment