Reland "Adjust build and test scripts for handling ICU prebuilts."

Test: run-tests, buildbot-build.sh, run-libcore-tests, run-libjdwp-tests, gtests (on device and host)
Test: gart/tools/golem/build-target.sh, and art/build/apex/runtests.sh.
Bug: 157734636
Bug: 129332183

Change-Id: I77ee0f07fb2d73dff6465da905c966bffa2c5d47
diff --git a/tools/bootjars.sh b/tools/bootjars.sh
index 5516bfb..6c39d31 100755
--- a/tools/bootjars.sh
+++ b/tools/bootjars.sh
@@ -113,7 +113,12 @@
     if [[ $jar == "conscrypt" ]]; then
       echo "$intermediates_dir/JAVA_LIBRARIES/${jar}.com.android.conscrypt_intermediates/classes.jar"
     elif [[ $jar == "core-icu4j" ]]; then
-      echo "$intermediates_dir/JAVA_LIBRARIES/${jar}.com.android.i18n_intermediates/classes.jar"
+      # The location of ICU is different on an unbundled build.
+      if [[ -f "$intermediates_dir/JAVA_LIBRARIES/${jar}.com.android.i18n_intermediates/classes.jar" ]]; then
+        echo "$intermediates_dir/JAVA_LIBRARIES/${jar}.com.android.i18n_intermediates/classes.jar"
+      else
+        echo "$intermediates_dir/JAVA_LIBRARIES/${jar}_intermediates/classes.jar"
+      fi
     else
       echo "$intermediates_dir/JAVA_LIBRARIES/${jar}.com.android.art.testing_intermediates/classes.jar"
     fi