Index: build/android/buildbot_functions.sh |
diff --git a/build/android/buildbot_functions.sh b/build/android/buildbot_functions.sh |
index 0b6f51fe69697f5ac18081d634439a83717c3900..bb7264a63790e2bd4b4cb31bd6df9a86cf2e2a45 100755 |
--- a/build/android/buildbot_functions.sh |
+++ b/build/android/buildbot_functions.sh |
@@ -152,14 +152,11 @@ function bb_stop_goma_internal { |
# $@: make args. |
# Use goma if possible; degrades to non-Goma if needed. |
function bb_goma_make { |
- bb_setup_goma_internal |
- |
if [ "${GOMA_DIR}" = "" ]; then |
make -j${JOBS} "$@" |
return |
fi |
- BUILDTYPE=$(bb_get_json_prop "$FACTORY_PROPERTIES" target) |
HOST_CC=$GOMA_DIR/gcc |
HOST_CXX=$GOMA_DIR/g++ |
TARGET_CC=$(/bin/ls $ANDROID_TOOLCHAIN/*-gcc | head -n1) |
@@ -186,16 +183,34 @@ function bb_goma_make { |
"$@" |
local make_exit_code=$? |
- bb_stop_goma_internal |
return $make_exit_code |
} |
+# Build using ninja. |
+function bb_goma_ninja { |
+ echo "Using ninja to build." |
+ ninja -C out/$BUILDTYPE -j120 -l20 |
+} |
+ |
# Compile step |
function bb_compile { |
# This must be named 'compile', not 'Compile', for CQ interaction. |
# Talk to maruel for details. |
echo "@@@BUILD_STEP compile@@@" |
- bb_goma_make |
+ |
+ BUILDTYPE=$(bb_get_json_prop "$FACTORY_PROPERTIES" target) |
+ BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool) |
Isaac (away)
2012/08/29 17:29:05
Pass these variables as args rather than relying o
sivachandra
2012/08/29 19:36:49
I do not really understand you here. Are you sayin
Isaac (away)
2012/08/29 19:48:59
I'm saying bb_goma_ninja and bb_goma make are rely
sivachandra
2012/08/29 20:55:36
OK I get the idea. However, since we need to set G
|
+ |
+ bb_setup_goma_internal |
+ |
+ if [ $BUILDTOOL = "ninja" ]; then |
+ export GYP_GENERATORS=ninja |
Isaac (away)
2012/08/29 17:29:05
GYP_GENERATORS needs to be set to ninja before env
sivachandra
2012/08/29 19:36:49
I have moved it in patch set 3. PTAL
|
+ bb_goma_ninja |
+ else |
+ bb_goma_make |
+ fi |
+ |
+ bb_stop_goma_internal |
} |
# Experimental compile step; does not turn the tree red if it fails. |
@@ -327,5 +342,5 @@ function bb_get_json_prop { |
local JSON="$1" |
local PROP="$2" |
- python -c "import json; print json.loads('$JSON')['$PROP']" |
+ python -c "import json; print json.loads('$JSON').get('$PROP')" |
} |