From 62a660007af1391003d25594bc926af9c8c747da Mon Sep 17 00:00:00 2001 From: jrizzoli Date: Sun, 24 Jan 2016 22:27:59 +0100 Subject: 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 --- README.md | 1 + gello_build.sh | 33 ++++++++++++++++++++++++++++++--- 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 -- cgit v1.2.3