Fix bootclasspath setup for target in tools/art script.

This fixes one of the issues on golem.

This code path got accidentally lost in CL/1263040.

Bug: 154074847
Test: Check that golem can load bootclasspath on target.
Change-Id: I9de03521c8c13fb104734259d3e90453ed2cb706
diff --git a/tools/art b/tools/art
index a4fe480..fe74614 100644
--- a/tools/art
+++ b/tools/art
@@ -531,19 +531,29 @@
   # Note: This must start with the CORE_IMG_JARS in Android.common_path.mk
   # because that's what we use for compiling the core.art image.
   # It may contain additional modules from TEST_CORE_JARS.
-  core_jars_list="core-oj core-libart core-icu4j okhttp bouncycastle apache-xml conscrypt"
+  core_jars_list="core-oj core-libart core-icu4j okhttp bouncycastle apache-xml"
   core_jars_suffix=
   if [[ -e $ANDROID_ROOT/framework/core-oj-hostdex.jar ]]; then
     core_jars_suffix=-hostdex
+    core_filenames_dir=$ANDROID_ROOT/framework
     core_locations_dir=$ANDROID_ROOT/framework
     prefix=$PWD/
     if [[ ${core_locations_dir:0:${#prefix}} = $prefix ]]; then
       core_locations_dir="${core_locations_dir##$prefix}"
     fi
+  elif [[ -e $ANDROID_ROOT/apex/com.android.art.debug/javalib/core-oj.jar ]]; then
+    core_jars_suffix=
+    core_filenames_dir=$ANDROID_ROOT/apex/com.android.art.debug/javalib
+    core_locations_dir=/apex/com.android.art/javalib
+  else
+    echo "Can not find jar files for boot image $DEX2OAT_BOOT_IMAGE"
+    exit 1
+  fi
+  if [[ $core_locations_dir != "" ]]; then
     boot_separator=""
     for boot_module in ${core_jars_list}; do
       DEX_FILENAME="$boot_module$core_jars_suffix.jar"
-      DEX2OAT_BCP+="$boot_separator$ANDROID_ROOT/framework/${DEX_FILENAME}"
+      DEX2OAT_BCP+="$boot_separator$core_filenames_dir/${DEX_FILENAME}"
       DEX2OAT_BCP_LOCS+="$boot_separator$core_locations_dir/${DEX_FILENAME}"
       boot_separator=":"
     done