summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-01-02 21:22:19 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-01-02 21:22:19 +0100
commit0d8994fdd7999e0fefa8d19de0b60a554bf1658d (patch)
tree3076380a8fe100826a2b8e4387d669b7651f9b56
parent20d985a1b885286f82afe10d944990d405507651 (diff)
downloadvendor_replicant-0d8994fdd7999e0fefa8d19de0b60a554bf1658d.zip
vendor_replicant-0d8994fdd7999e0fefa8d19de0b60a554bf1658d.tar.gz
vendor_replicant-0d8994fdd7999e0fefa8d19de0b60a554bf1658d.tar.bz2
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>
-rwxr-xr-xsign-build26
1 files changed, 17 insertions, 9 deletions
diff --git a/sign-build b/sign-build
index daf83c7..16cef8f 100755
--- a/sign-build
+++ b/sign-build
@@ -30,8 +30,16 @@ set -e
BASEDIR=$(pwd)
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
generate_keys () {
@@ -77,22 +85,22 @@ then
exit 1
fi
-mkdir -p $OUT_DIR
+mkdir -p $DIST_OUT_DIR
# -o option replaces the test keys with the created ones
python $BASEDIR/build/tools/releasetools/sign_target_files_apks \
-o \
-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 \
-k $KEY_DIR/releasekey \
- $OUT_DIR/signed-target_files.zip \
- $OUT_DIR/$RELEASE.zip
+ $DIST_OUT_DIR/signed-target_files.zip \
+ $DIST_OUT_DIR/$RELEASE.zip
python $BASEDIR/build/tools/releasetools/img_from_target_files \
- $OUT_DIR/signed-target_files.zip \
- $OUT_DIR/signed-img.zip
+ $DIST_OUT_DIR/signed-target_files.zip \
+ $DIST_OUT_DIR/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