diff options
| author | 2017-08-01 18:24:12 +0000 | |
|---|---|---|
| committer | 2017-08-01 18:24:12 +0000 | |
| commit | 52a3c989f96984f9bc9e02620694fc44708a1df2 (patch) | |
| tree | d0b4beb13f6401eefb742973da840cc6696b808d | |
| parent | 951853a68554d1bc5f50980194f1686cb5f41d83 (diff) | |
| parent | e0ef0a80878aa53d9b16495e4c72c04802ec559b (diff) | |
Merge "Revert "Revert "tools: Read ANDROID_COMPILE_WITH_JACK from build"""
| -rwxr-xr-x | test/run-test | 2 | ||||
| -rw-r--r-- | test/testrunner/env.py | 14 | ||||
| -rwxr-xr-x | tools/buildbot-build.sh | 9 | ||||
| -rwxr-xr-x | tools/run-jdwp-tests.sh | 15 | ||||
| -rwxr-xr-x | tools/run-libcore-tests.sh | 15 |
5 files changed, 27 insertions, 28 deletions
diff --git a/test/run-test b/test/run-test index bd8b9e88ca..e6196a0213 100755 --- a/test/run-test +++ b/test/run-test @@ -45,7 +45,7 @@ export JAVAC="javac -g -Xlint:-options" export RUN="${progdir}/etc/run-test-jar" export DEX_LOCATION=/data/run-test/${test_dir} export NEED_DEX="true" -export USE_JACK="true" +export USE_JACK="false" export USE_DESUGAR="true" export SMALI_ARGS="" diff --git a/test/testrunner/env.py b/test/testrunner/env.py index b996b04235..d45d009ba4 100644 --- a/test/testrunner/env.py +++ b/test/testrunner/env.py @@ -33,7 +33,8 @@ _DUMP_MANY_VARS_LIST = ['HOST_2ND_ARCH_PREFIX', 'TARGET_ARCH', 'HOST_PREFER_32_BIT', 'HOST_OUT_EXECUTABLES', - 'ANDROID_JAVA_TOOLCHAIN'] + 'ANDROID_JAVA_TOOLCHAIN', + 'ANDROID_COMPILE_WITH_JACK'] _DUMP_MANY_VARS = None # To be set to a dictionary with above list being the keys, # and the build variable being the value. def _dump_many_vars(var_name): @@ -78,6 +79,15 @@ def _dump_many_vars(var_name): def _get_build_var(var_name): return _dump_many_vars(var_name) +def _get_build_var_boolean(var, default): + val = _get_build_var(var) + if val: + if val == "True" or val == "true": + return True + if val == "False" or val == "false": + return False + return default + def get_env(key): return _env.get(key) @@ -97,7 +107,7 @@ def _get_android_build_top(): ANDROID_BUILD_TOP = _get_android_build_top() # Compiling with jack? Possible values in (True, False, 'default') -ANDROID_COMPILE_WITH_JACK = _getEnvBoolean('ANDROID_COMPILE_WITH_JACK', 'default') +ANDROID_COMPILE_WITH_JACK = _get_build_var_boolean('ANDROID_COMPILE_WITH_JACK', 'default') # Directory used for temporary test files on the host. ART_HOST_TEST_DIR = tempfile.mkdtemp(prefix = 'test-art-') diff --git a/tools/buildbot-build.sh b/tools/buildbot-build.sh index 75694c340c..4f99ac33a9 100755 --- a/tools/buildbot-build.sh +++ b/tools/buildbot-build.sh @@ -19,6 +19,8 @@ if [ ! -d art ]; then exit 1 fi +source build/envsetup.sh >&/dev/null # for get_build_var + # Logic for setting out_dir from build/make/core/envsetup.mk: if [[ -z $OUT_DIR ]]; then if [[ -z $OUT_DIR_COMMON_BASE ]]; then @@ -30,10 +32,7 @@ else out_dir=${OUT_DIR} fi -using_jack=true -if [[ $ANDROID_COMPILE_WITH_JACK == false ]]; then - using_jack=false -fi +using_jack=$(get_build_var ANDROID_COMPILE_WITH_JACK) java_libraries_dir=${out_dir}/target/common/obj/JAVA_LIBRARIES common_targets="vogar core-tests apache-harmony-jdwp-tests-hostdex jsr166-tests mockito-target" @@ -63,7 +62,7 @@ while true; do fi done -if $using_jack; then +if [[ $using_jack == "true" ]]; then common_targets="$common_targets ${out_dir}/host/linux-x86/bin/jack" fi diff --git a/tools/run-jdwp-tests.sh b/tools/run-jdwp-tests.sh index 17c84b4f84..d2322bb3a9 100755 --- a/tools/run-jdwp-tests.sh +++ b/tools/run-jdwp-tests.sh @@ -19,24 +19,19 @@ if [ ! -d libcore ]; then exit 1 fi -if [ -z "$ANDROID_JAVA_TOOLCHAIN" ] ; then - source build/envsetup.sh - setpaths # include platform prebuilt java, javac, etc in $PATH. -fi +source build/envsetup.sh >&/dev/null # for get_build_var, setpaths +setpaths # include platform prebuilt java, javac, etc in $PATH. if [ -z "$ANDROID_HOST_OUT" ] ; then ANDROID_HOST_OUT=${OUT_DIR-$ANDROID_BUILD_TOP/out}/host/linux-x86 fi -using_jack=true -if [[ $ANDROID_COMPILE_WITH_JACK == false ]]; then - using_jack=false -fi +using_jack=$(get_build_var ANDROID_COMPILE_WITH_JACK) function jlib_suffix { local str=$1 local suffix="jar" - if $using_jack; then + if [[ $using_jack == "true" ]]; then suffix="jack" fi echo "$str.$suffix" @@ -166,7 +161,7 @@ if [[ $verbose == "yes" ]]; then art_debugee="$art_debugee -verbose:jdwp" fi -if $using_jack; then +if [[ $using_jack == "true" ]]; then toolchain_args="--toolchain jack --language JN --jack-arg -g" else toolchain_args="--toolchain jdk --language CUR" diff --git a/tools/run-libcore-tests.sh b/tools/run-libcore-tests.sh index d549098b0a..eecdd2fb5e 100755 --- a/tools/run-libcore-tests.sh +++ b/tools/run-libcore-tests.sh @@ -19,10 +19,8 @@ if [ ! -d libcore ]; then exit 1 fi -if [ -z "$ANDROID_JAVA_TOOLCHAIN" ] ; then - source build/envsetup.sh - setpaths # include platform prebuilt java, javac, etc in $PATH. -fi +source build/envsetup.sh >&/dev/null # for get_build_var, setpaths +setpaths # include platform prebuilt java, javac, etc in $PATH. if [ -z "$ANDROID_PRODUCT_OUT" ] ; then JAVA_LIBRARIES=out/target/common/obj/JAVA_LIBRARIES @@ -30,16 +28,13 @@ else JAVA_LIBRARIES=${ANDROID_PRODUCT_OUT}/../../common/obj/JAVA_LIBRARIES fi -using_jack=true -if [[ $ANDROID_COMPILE_WITH_JACK == false ]]; then - using_jack=false -fi +using_jack=$(get_build_var ANDROID_COMPILE_WITH_JACK) function classes_jar_path { local var="$1" local suffix="jar" - if $using_jack; then + if [[ $using_jack == "true" ]]; then suffix="jack" fi @@ -151,7 +146,7 @@ done vogar_args="$vogar_args --timeout 480" # Switch between using jack or javac+desugar+dx -if $using_jack; then +if [[ $using_jack == "true" ]]; then vogar_args="$vogar_args --toolchain jack --language JO" else vogar_args="$vogar_args --toolchain jdk --language CUR" |