Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(573)

Unified Diff: build/android/buildbot_functions.sh

Issue 10898019: Adding support for ninja. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add 'All' target for the ninja command. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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')"
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698