aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Rames <alexandre.rames@linaro.org>2016-06-29 10:15:26 +0000
committerLinaro Android Code Review <android-review@review.linaro.org>2016-06-29 10:15:26 +0000
commit84c148db67e8c89f4c07b7fb7c4d8b2c7e390bcc (patch)
treeb9049f4888c10e5ed1e2c629205d06ebddf5ba8f
parent34cd8033d78b469dd329f0e8c3ed6e79d3afc8af (diff)
parent1addb493d121fc1eb67e688943a795c8c0e96603 (diff)
downloadart-build-scripts-84c148db67e8c89f4c07b7fb7c4d8b2c7e390bcc.tar.gz
Merge "Fix android helpers."
-rwxr-xr-xtests/test_art_build_linux_target.sh2
-rwxr-xr-xtests/test_art_host.sh2
-rw-r--r--utils/utils_android.sh32
3 files changed, 18 insertions, 18 deletions
diff --git a/tests/test_art_build_linux_target.sh b/tests/test_art_build_linux_target.sh
index 919fafc3..d0656891 100755
--- a/tests/test_art_build_linux_target.sh
+++ b/tests/test_art_build_linux_target.sh
@@ -73,7 +73,7 @@ build_art_linux_target() {
# Build linker.
log I "Build the linker"
- safe_make_build linker
+ safe_make_build "" "" "linker"
}
compile_boot_oat () {
diff --git a/tests/test_art_host.sh b/tests/test_art_host.sh
index a8115ae8..00cf34dd 100755
--- a/tests/test_art_host.sh
+++ b/tests/test_art_host.sh
@@ -27,7 +27,7 @@ usage() {
test_art_host() {
log I "Running test-art-host tests."
- mma_build "test-art-host dist"
+ mma_build "test-art-host" "dist"
}
argument_parser() {
diff --git a/utils/utils_android.sh b/utils/utils_android.sh
index 7630867b..5900891b 100644
--- a/utils/utils_android.sh
+++ b/utils/utils_android.sh
@@ -2,7 +2,7 @@
# Common android build methods.
-readonly jcpu_count=$(($(nproc) * 2))
+readonly jcpu_count=$(nproc)
readonly build_log="$(get_workspace)/log_build.txt"
env_defines_lunch_target() {
@@ -79,7 +79,7 @@ mm_build() {
disable_error_on_unset_expansion
start_logging "${build_log}"
# shellcheck disable=SC2086
- safe mm -j"${jcpu_count}" ${1:+"$1"}
+ safe mm -j"${jcpu_count}" "$@"
stop_logging
enable_error_on_unset_expansion
}
@@ -88,28 +88,28 @@ mma_build() {
disable_error_on_unset_expansion
start_logging "${build_log}"
# shellcheck disable=SC2086
- safe mma -j"${jcpu_count}" ${1:+"$1"}
+ safe mma -j"${jcpu_count}" "$@"
stop_logging
enable_error_on_unset_expansion
}
# $1: Safe or unsafe call to make. Default: safe.
-# $2: Make target. Can be empty.
-# $3: Log file. Default: ${build_log}.
-# $4: # for -j#. Default: ${jcpu_count}.
+# $2: Log file. Default: ${build_log}.
+# $3: # for -j#. Default: ${jcpu_count}.
+# Following arguments: make targets
make_build() {
safe_run=${1:-"safe"}
- dash_j=${4:-"${jcpu_count}"}
- output_file=${3:-"${build_log}"}
+ output_file=${2:-"${build_log}"}
+ dash_j=${3:-"${jcpu_count}"}
disable_error_on_unset_expansion
start_logging "${output_file}"
if [[ ${safe_run} == "safe" ]]; then
# shellcheck disable=SC2086
- safe make -j"${dash_j}" ${2:+"$2"}
+ safe make -j"${dash_j}" "${@:4}"
elif [[ ${safe_run} == "unsafe" ]]; then
# shellcheck disable=SC2086
- make -j"${dash_j}" ${2:+"$2"}
+ make -j"${dash_j}" "${@:4}"
else
log E "Don't know how to build with ${safe_run}, only 'safe' or 'unsafe'."
abort
@@ -121,16 +121,16 @@ make_build() {
return ${ret}
}
-# $1: make target
-# $2: log file (optional. default: ${build_log})
-# $3: # for -j# (optional. default: ${jcpu_count})
+# $1: log file (optional. default: ${build_log})
+# $2: # for -j# (optional. default: ${jcpu_count})
+# Following arguments: make targets
safe_make_build() {
make_build "safe" "$@"
}
-# $1: make target
-# $2: log file (optional. default: ${build_log})
-# $3: # for -j# (optional. default: ${jcpu_count})
+# $1: log file (optional. default: ${build_log})
+# $2: # for -j# (optional. default: ${jcpu_count})
+# Following arguments: make targets
unsafe_make_build() {
make_build "unsafe" "$@"
}