diff options
-rwxr-xr-x | build.sh | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -207,16 +207,21 @@ if [[ -f "${jar_files[0]}" ]]; then done fi -javac_cmd_options=("-encoding" "UTF-8" \ - "-cp" "${DIR_BENCHMARKS}:${DIR_BUILD}/classes" \ - "-d" "$DIR_BUILD/classes/" \ - $JAVA_FRAMEWORK_FILES \ - $JAVA_BENCHMARK_FILES) +javac_cmd_options=() + +# javac is used both for the target and host builds; for target we also need to set +# the correct bootclasspath. +if [[ "$TARGET_BUILD" == "true" && -n "${JAVAC_BOOTCLASSPATH}" ]]; then + javac_cmd_options+="-bootclasspath" "${JAVAC_BOOTCLASSPATH}" +fi + +javac_cmd_options+=("-encoding" "UTF-8") +javac_cmd_options+=("-cp" "${DIR_BENCHMARKS}:${DIR_BUILD}/classes") +javac_cmd_options+=( "-d" "$DIR_BUILD/classes/") +javac_cmd_options+=($JAVA_FRAMEWORK_FILES) +javac_cmd_options+=($JAVA_BENCHMARK_FILES) DX=$(which dx) -# Use different javac for target and host builds: -# For target: the art/tools/javac-helper.sh is used to invoke javac with the correct bootclasspath. -# For host: javac from PATH is used. if [ $TARGET_BUILD = "true" ] || [ -n "$DX" ]; then if [ $TARGET_BUILD = "false" ]; then info "This is not a target build (\`-t\` was not specified), but" \ @@ -225,9 +230,7 @@ if [ $TARGET_BUILD = "true" ] || [ -n "$DX" ]; then if [[ -d "${DIR_BENCHMARKS}"/resources ]]; then tar cfv $DIR_BUILD/resources.tar -C "${DIR_BENCHMARKS}" ./resources fi - verbose_safe ${ANDROID_BUILD_TOP}/art/tools/javac-helper.sh --show-commands --core-only \ - $CROSS_COMPILE_FLAGS \ - "${javac_cmd_options[@]}" + verbose_safe javac $CROSS_COMPILE_FLAGS "${javac_cmd_options[@]}" if hash dx 2> /dev/null; then # Use custom Java options to compile benchmarks that require more memory. export _JAVA_OPTIONS="-Xms512m -Xmx2048m -XX:MaxPermSize=512m" |