Index: build/android/buildbot_functions.sh |
diff --git a/build/android/buildbot_functions.sh b/build/android/buildbot_functions.sh |
index 0b6f51fe69697f5ac18081d634439a83717c3900..ac1419b21b33f0097833deae7800e01c9a0f577f 100755 |
--- a/build/android/buildbot_functions.sh |
+++ b/build/android/buildbot_functions.sh |
@@ -84,6 +84,11 @@ function bb_baseline_setup { |
NEED_CLOBBER=1 |
fi |
+ local BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool) |
+ if [ $BUILDTOOL = "ninja" ]; then |
+ export GYP_GENERATORS=ninja |
+ fi |
+ |
. build/android/envsetup.sh |
if [ "$NEED_CLOBBER" -eq 1 ]; then |
@@ -152,14 +157,13 @@ 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) |
+ local BUILDTYPE="$1" |
+ |
HOST_CC=$GOMA_DIR/gcc |
HOST_CXX=$GOMA_DIR/g++ |
TARGET_CC=$(/bin/ls $ANDROID_TOOLCHAIN/*-gcc | head -n1) |
@@ -186,16 +190,34 @@ function bb_goma_make { |
"$@" |
local make_exit_code=$? |
- bb_stop_goma_internal |
return $make_exit_code |
} |
+# Build using ninja. |
+function bb_goma_ninja { |
+ local BUILDTYPE="$1" |
+ |
+ echo "Using ninja to build." |
+ ninja -C out/$BUILDTYPE -j120 -l20 All |
sivachandra
2012/08/30 21:00:02
It is all 'All'?
|
+} |
+ |
# 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 |
+ |
+ bb_setup_goma_internal |
+ |
+ BUILDTYPE=$(bb_get_json_prop "$FACTORY_PROPERTIES" target) |
+ BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool) |
+ if [ $BUILDTOOL = "ninja" ]; then |
+ bb_goma_ninja $BUILDTYPE |
+ else |
+ bb_goma_make $BUILDTYPE |
+ fi |
+ |
+ bb_stop_goma_internal |
} |
# Experimental compile step; does not turn the tree red if it fails. |
@@ -327,5 +349,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')" |
} |