sign-build: Support $OUT_DIR_COMMON_BASE

$OUT_DIR_COMMON_BASE allows to set a different output directory in the
Android build environment.

Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
This commit is contained in:
Wolfgang Wiedmeyer 2017-01-02 21:22:19 +01:00
parent 20d985a1b8
commit 0d8994fdd7
No known key found for this signature in database
GPG Key ID: 5816A24C10757FC4

View File

@ -30,8 +30,16 @@ set -e
BASEDIR=$(pwd) BASEDIR=$(pwd)
KEY_DIR=$BASEDIR/vendor/replicant-security KEY_DIR=$BASEDIR/vendor/replicant-security
TARGET_FILES=$BASEDIR/out/target/product/*/obj/PACKAGING/target_files_intermediates/*-target_files-*.zip
OUT_DIR=$BASEDIR/"out/dist" if [ -z ${OUT_DIR_COMMON_BASE+x} ]
then
OUT_DIR=$BASEDIR/"out"
else
OUT_DIR=$OUT_DIR_COMMON_BASE/${PWD##*/}
fi
TARGET_FILES=$OUT_DIR/target/product/*/obj/PACKAGING/target_files_intermediates/*-target_files-*.zip
DIST_OUT_DIR=$OUT_DIR/"dist"
RELEASE=replicant-6.0 RELEASE=replicant-6.0
generate_keys () { generate_keys () {
@ -77,22 +85,22 @@ then
exit 1 exit 1
fi fi
mkdir -p $OUT_DIR mkdir -p $DIST_OUT_DIR
# -o option replaces the test keys with the created ones # -o option replaces the test keys with the created ones
python $BASEDIR/build/tools/releasetools/sign_target_files_apks \ python $BASEDIR/build/tools/releasetools/sign_target_files_apks \
-o \ -o \
-d $KEY_DIR $TARGET_FILES \ -d $KEY_DIR $TARGET_FILES \
$OUT_DIR/signed-target_files.zip $DIST_OUT_DIR/signed-target_files.zip
python $BASEDIR/build/tools/releasetools/ota_from_target_files \ python $BASEDIR/build/tools/releasetools/ota_from_target_files \
-k $KEY_DIR/releasekey \ -k $KEY_DIR/releasekey \
$OUT_DIR/signed-target_files.zip \ $DIST_OUT_DIR/signed-target_files.zip \
$OUT_DIR/$RELEASE.zip $DIST_OUT_DIR/$RELEASE.zip
python $BASEDIR/build/tools/releasetools/img_from_target_files \ python $BASEDIR/build/tools/releasetools/img_from_target_files \
$OUT_DIR/signed-target_files.zip \ $DIST_OUT_DIR/signed-target_files.zip \
$OUT_DIR/signed-img.zip $DIST_OUT_DIR/signed-img.zip
# get the recovery from the signed-img.zip # get the recovery from the signed-img.zip
unzip -o -j $OUT_DIR/signed-img.zip recovery.img -d $OUT_DIR unzip -o -j $DIST_OUT_DIR/signed-img.zip recovery.img -d $DIST_OUT_DIR