aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Astigeevich <evgeny.astigeevich@linaro.org>2020-03-23 10:13:37 +0000
committerEvgeny Astigeevich <evgeny.astigeevich@linaro.org>2020-03-23 15:01:25 +0000
commit9d2d671b13d82decdcebe852d7a8c50ed9906d65 (patch)
treeffe4be70d341081cdee6d00ff69c68096f431c3f
parentc1f6bb41d40b94f1cb1f5c01faa03b6b70ea6f20 (diff)
downloadart-testing-9d2d671b13d82decdcebe852d7a8c50ed9906d65.tar.gz
Fix errors "'./benchmarks/benchmarks/lib/*.jar': No such file or directory"
If 'benchmarks/benchmarks/lib/*.jar' don't exist the loop processing jar files gets an invalid input list. This causes the jar tool to fail. This CL fixes the bug by checking if jar files exist. Test: benchmarks/build.sh -t Change-Id: Ic29f218bcd676d0d7908e3dfa356f5d4607bc4cc
-rwxr-xr-xbuild.sh19
1 files changed, 12 insertions, 7 deletions
diff --git a/build.sh b/build.sh
index 393f067..3037a09 100755
--- a/build.sh
+++ b/build.sh
@@ -194,13 +194,18 @@ JAVA_FRAMEWORK_FILES="$(find $DIR_FRAMEWORK -type f -name '*'.java)"
verbose_safe rm -rf $DIR_BUILD
verbose_safe mkdir -p $DIR_BUILD/classes/
-for jar_file in "${DIR_BENCHMARKS}"/lib/*.jar
-do
- jar_file="$(realpath "${jar_file}")"
- # Extract jar file and remove META-INF, which is not needed and can cause
- # issues with target runs.
- (cd $DIR_BUILD/classes && jar xfv "${jar_file}" && rm -rf META-INF)
-done
+jar_files=("${DIR_BENCHMARKS}"/lib/*.jar)
+# The ${DIR_BENCHMARKS}/lib directory might contain jar files needed for benchmarks.
+# We need to check whether there are any jar files before trying to process them.
+if [[ -f "${jar_files[0]}" ]]; then
+ for jar_file in "${jar_files[@]}"
+ do
+ jar_file="$(realpath "${jar_file}")"
+ # Extract jar file and remove META-INF, which is not needed and can cause
+ # issues with target runs.
+ (cd $DIR_BUILD/classes && jar xfv "${jar_file}" && rm -rf META-INF)
+ done
+fi
javac_cmd_options=("-encoding" "UTF-8" \
"-cp" "${DIR_BENCHMARKS}:${DIR_BUILD}/classes" \