aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjrizzoli <joey@cyanogenmoditalia.it>2016-01-24 21:27:59 (GMT)
committerjrizzoli <joey@cyanogenmoditalia.it>2016-01-24 21:27:59 (GMT)
commit62a660007af1391003d25594bc926af9c8c747da (patch)
tree61bf5b4e570619d7895669b889cfd32dc445838c
parentd911c8fdd96f9ed69b5de04a9874f199a238500a (diff)
downloadandroid_external_gello_build-62a660007af1391003d25594bc926af9c8c747da.zip
android_external_gello_build-62a660007af1391003d25594bc926af9c8c747da.tar.gz
android_external_gello_build-62a660007af1391003d25594bc926af9c8c747da.tar.bz2
gello-build: introduce "--local"
This will let you pick your local Gello repo* instead of synced one, this is really useful when you're testing a local change *assuming this repo is at external/gello-build and gello sources are at packages/apps/Gello Change-Id: I4c8cd48ca94e18de1a6df813a15a23363d97484c Signed-off-by: jrizzoli <joey@cyanogenmoditalia.it>
-rw-r--r--README.md1
-rwxr-xr-xgello_build.sh33
2 files changed, 31 insertions, 3 deletions
diff --git a/README.md b/README.md
index eaafbb8..6b44e9d 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,7 @@ Features
- *--clean* = Make a clean build
- *--depot* = Install Depot Tool
- *--fast* = Skip sync and runhooks, useful for testing changes
+- *--local* = Pick local gello from packages/apps/Gello (for testing purpose)
- *--push* = Once everything else is done, install the given apk on a connected device
- *--no-sync* = Skip sync
diff --git a/gello_build.sh b/gello_build.sh
index 9d545d6..bd9f8bf 100755
--- a/gello_build.sh
+++ b/gello_build.sh
@@ -23,6 +23,9 @@
TOP_GELLO=$(pwd)
SRC_GELLO=$TOP_GELLO/env/src
+BACKUP_GELLO=$SRC_GELLO/swe/browser_orig
+BUILD_GELLO=$SRC_GELLO/swe/browser
+
READY_APK=$TOP_GELLO/Gello.apk
@@ -33,6 +36,7 @@ FAST=false
PUSH=false
NOSYNC=false
CLEAN=false
+LOCAL=false
##
# Sync
@@ -81,6 +85,7 @@ function sync() {
function setup() {
local DONE_FILE=$TOP_GELLO/.cm_done
local GOOGLE_SDK=$SRC_GELLO/third_party/android_tools/sdk/extras/google/google_play_services
+ local LOCAL_GELLO=$TOP_GELLO/../../packages/apps/Gello
cd $SRC_GELLO
@@ -90,6 +95,19 @@ function setup() {
. build/android/envsetup.sh
+ # If local is enabled we will be using local gello shell instead of synced one
+ if [ "$LOCAL" == true ]; then
+ if [ -d $LOCAL_GELLO ]; then
+ if [ -d $BUILD_GELLO ]; then
+ mv $BUILD_GELLO $BACKUP_GELLO
+ fi
+ cp -r $LOCAL_GELLO $BUILD_GELLO
+ else
+ echo "No local Gello found (excepted to be at $LOCAL_GELLO)"
+ return 4
+ fi
+ fi
+
if [ "$FAST" != true ] && [ -f $DONE_FILE ]; then
# !! The first time it asks a manual input to accept licenses !!
GYP_DEFINES="$GYP_DEFINES OS=android swe_channel=cm" gclient runhooks
@@ -103,8 +121,6 @@ function setup() {
if [ ! -d $GOOGLE_SDK ]; then
bash $SRC_GELLO/build/install-android-sdks.sh
fi
-
-
}
@@ -127,8 +143,14 @@ function compile() {
# Make things
ninja -C out/Release swe_android_browser_apk
+ local BUILDRET=$?
+
+ if [ "$LOCAL" == true ]; then
+ rm -rf $BUILD_GELLO
+ mv $BACKUP_GELLO $BUILD_GELLO
+ fi
- if [ "$?" == 0 ]; then
+ if [ "$BUILDRET" == 0 ]; then
if [ -f "$OUT_TARGET" ]; then
rm -f $OUT_TARGET
fi
@@ -160,6 +182,10 @@ function parseflags() {
--clean)
CLEAN=true
;;
+ --local)
+ NOSYNC=true
+ LOCAL=true
+ ;;
esac
done
}
@@ -176,6 +202,7 @@ flags:
--clean = Make a clean build
--depot = Install Depot Tool
--fast = Skip sync and runhooks, useful for testing local changes
+ --local = Pick local gello from packages/apps/Gello (for testing purpose)
--push = Once everything else is done, install the given apk on a connected device
--no-sync = Skip sync
EOF