Index: build/android/buildbot_functions.sh |
diff --git a/build/android/buildbot_functions.sh b/build/android/buildbot_functions.sh |
index 4c26610d897bff73aa67db603a59263dbb1db5b6..7795fd8ad120c351afeb48a4d25e22735d1b6383 100755 |
--- a/build/android/buildbot_functions.sh |
+++ b/build/android/buildbot_functions.sh |
@@ -13,6 +13,28 @@ JOBS="${JOBS:-4}" |
# Clobber build? Overridden by bots with BUILDBOT_CLOBBER. |
NEED_CLOBBER="${NEED_CLOBBER:-0}" |
+ |
+# Parse named arguments passed into the annotator script |
+# and assign them global variable names |
cmp
2012/06/19 20:46:42
nit: please append periods to the end of all sente
|
+function bb_parse_args { |
+ while [[ $1 ]]; do |
+ case "$1" in |
+ --factory-properties=*) |
+ FACTORY_PROPERTIES="$(echo "$1" | sed 's/^[^=]*=//')" |
cmp
2012/06/19 20:46:42
The content of FACTORY_PROPERTIES and BUILD_PROPER
Isaac (away)
2012/06/20 00:34:53
Right now zip_build and extract_build already pars
cmp
2012/06/20 17:30:06
Right, I didn't expect you to need to extract anyt
|
+ ;; |
+ --build-properties=*) |
+ BUILD_PROPERTIES="$(echo "$1" | sed 's/^[^=]*=//')" |
+ ;; |
+ *) |
+ echo "@@@STEP_WARNINGS@@@" |
+ echo "Warning, unparsed input argument: '$1'" |
+ ;; |
+ esac |
+ shift |
+ done |
+} |
+ |
+ |
# Setup environment for Android build. |
# Called from bb_baseline_setup. |
# Moved to top of file so it is easier to find. |
@@ -30,6 +52,7 @@ function bb_install_build_deps { |
if [[ -f "$script" ]]; then |
"$script" |
else |
+ echo "@@@STEP_WARNINGS@@@" |
echo "Cannot find $script; why?" |
fi |
} |
@@ -42,9 +65,15 @@ function bb_force_bot_green_and_exit { |
# Basic setup for all bots to run after a source tree checkout. |
# $1: source root. |
+# Beyond $1: key value pairs to be parsed by bb_parse_args |
function bb_baseline_setup { |
echo "@@@BUILD_STEP cd into source root@@@" |
SRC_ROOT="$1" |
+ # Remove SRC_ROOT param |
+ shift |
+ |
+ bb_parse_args "$@" |
+ |
if [ ! -d "${SRC_ROOT}" ] ; then |
echo "Please specify a valid source root directory as an arg" |
echo '@@@STEP_FAILURE@@@' |
@@ -237,3 +266,25 @@ function bb_run_apk_tests { |
echo "@@@BUILD_STEP Run APK Tests on actual hardware@@@" |
build/android/run_tests.py --xvfb --verbose --apk=True |
} |
+ |
+# Zip and archive a build |
+function bb_zip_build { |
+ echo "@@@BUILD_STEP Zip build@@@" |
+ python ../../../../scripts/slave/zip_build.py |
+} |
+ |
+# Download and extract a build |
+function bb_extract_build { |
+ echo "@@@BUILD_STEP Download and extract build@@@" |
+ if [[ -z $FACTORY_PROPERTIES ]]; then |
+ echo "@@@STEP_FAILURES@@@" |
+ echo "FACTORY_PROPERTIES is null" |
+ return 1 |
+ fi |
+ |
+ # FACTORY_PROPERTIES contains spaces |
+ python ../../../../scripts/slave/extract_build.py --no-append-dir \ |
+ --build-dir out \ |
+ --target Release \ |
+ --factory-properties "$FACTORY_PROPERTIES" |
+} |