Skip to content

Commit

Permalink
exclude symbol and apex folders, but made it configurable to synch all
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderwolz committed Dec 17, 2023
1 parent e74fa6c commit 3c640d0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bin/create_local_emulator_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ pushd $PACKAGE_DIR > /dev/null
zip -r $PACKAGE_DIR_ZIP . || exit 1
popd > /dev/null

echo "Cleaning up .."
rm -rf $PACKAGE_DIR
# echo "Cleaning up .."
# rm -rf $PACKAGE_DIR


DURATION=$(($(date -u +%s)-$BEGIN))
Expand Down
4 changes: 2 additions & 2 deletions bin/create_local_product_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ rm -rf $PACKAGE_IMAGE_DIR || exit 1
echo "Zipping all content .."
zip -j $PACKAGE_DIR_ZIP $PACKAGE_DIR/* || exit 1

echo "Cleaning up .."
rm -rf $PACKAGE_DIR
#echo "Cleaning up .."
#rm -rf $PACKAGE_DIR


DURATION=$(($(date -u +%s)-$BEGIN))
Expand Down
39 changes: 37 additions & 2 deletions bin/sync_remote_product_out.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#!/bin/bash
# Copyright (C) 2023 Alexander Wolz <mail@alexanderwolz.de>

function printHelpMenu(){
echo ""
echo "usage: [options] [device-name]"
echo "----------------------------"
echo " -a sync everything"
echo "----------------------------"
echo " -h print this menu"
echo ""
}


echo ""
echo "---------------------------------------------------------------"
Expand All @@ -10,6 +20,23 @@ echo "---------------------------------------------------------------"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source "$SCRIPT_DIR/common.sh" || exit 1

while getopts a?h opt; do
case $opt in
a)
SYNC_ALL=1
echo "!! Syncing everything !!"
echo "---------------------------------------------------------------"
;;
h)
printHelpMenu
exit 0
;;
esac
done

shift $((OPTIND - 1))
[ "${1:-}" = "--" ] && shift

setRemoteProductParent

echo "Reading device list from $SSH_HOST .."
Expand Down Expand Up @@ -51,8 +78,16 @@ done
REMOTE_PRODUCT_FOLDER="$REMOTE_PRODUCT_PARENT_FOLDER/$DEVICE_NAME"

BEGIN=$(date -u +%s)
#copy everything from $ANDROID_PRODUCT_OUT except symbols folder
rsync -avh -e "$SSH_OPTS" --delete --exclude symbols "$SSH_USER@$SSH_HOST":$REMOTE_PRODUCT_FOLDER $LOCAL_AOSP_HOME

if [ ! -z $SYNC_ALL ]; then
#copy everything from $ANDROID_PRODUCT_OUT
rsync -avh -e "$SSH_OPTS" --delete "$SSH_USER@$SSH_HOST":$REMOTE_PRODUCT_FOLDER $LOCAL_AOSP_HOME
else
#copy everything from $ANDROID_PRODUCT_OUT except exclude folders
rsync -avh -e "$SSH_OPTS" --delete --exclude apex --exclude symbols --exclude obj --exclude obj_arm --exclude obj_x86 \
"$SSH_USER@$SSH_HOST":$REMOTE_PRODUCT_FOLDER $LOCAL_AOSP_HOME
fi

DURATION=$(($(date -u +%s)-$BEGIN))
echo "---------------------------------------------------------------"
echo "AOSP product can be found at $LOCAL_AOSP_HOME/$DEVICE_NAME"
Expand Down

0 comments on commit 3c640d0

Please sign in to comment.