aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDan Bornstein <danfuzz@android.com>2010-09-20 16:13:54 -0700
committerDan Bornstein <danfuzz@android.com>2010-09-20 16:13:54 -0700
commit7099d194aeb7d0524108aa3d4ed8a8da0595c007 (patch)
treec59ef9622bacda7664a082872b25b3850e0382fe /tools
parent43c54c0b3a5161dedfee9c255e60788627ed8505 (diff)
Insert "/./" into the input file path when necessary.
This is necessary, in particular, when the input file is on the boot classpath. Change-Id: I18822d7b2eceba0eb15d5548a87bff5bb641788f
Diffstat (limited to 'tools')
-rwxr-xr-xtools/dex-preopt16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/dex-preopt b/tools/dex-preopt
index 31270bf7d..ec3789dfe 100755
--- a/tools/dex-preopt
+++ b/tools/dex-preopt
@@ -243,9 +243,9 @@ fi
# really) uses this to know how to generate the names of the
# dependencies (since we don't want the device files to contain bits
# of pathname from the host build system).
-bootDir="${productDir}/./${bootDir}"
-if [ ! '(' -d "${bootDir}" -a -w "${bootDir}" ')' ]; then
- echo "boot-dir is not a writable directory: ${bootDir}" 1>&2
+productBootDir="${productDir}/./${bootDir}"
+if [ ! '(' -d "${productBootDir}" -a -w "${productBootDir}" ')' ]; then
+ echo "boot-dir is not a writable directory: ${productBootDir}" 1>&2
exit 1
fi
@@ -268,7 +268,7 @@ fi
# Expand the bootJars into paths that are relative from the build
# directory, maintaining the colon separators.
BOOTCLASSPATH=`echo ":${bootJars}" | \
- sed "s!:\([^:]*\)!:${bootDir}/\1.jar!g" | \
+ sed "s!:\([^:]*\)!:${productBootDir}/\1.jar!g" | \
sed 's/^://'`
export BOOTCLASSPATH
@@ -288,6 +288,14 @@ if [ "${bootstrap}" = "yes" ]; then
done
else
echo "Processing ${inputFile}" 1>&2
+
+ bootJarFile=`expr -- "${inputFile}" : "${productDir}/${bootDir}/\(.*\)"`
+ if [ "x${bootJarFile}" != 'x' ]; then
+ # The input file is in the boot classpath directory, so it needs
+ # to have "/./" inserted into it (see longer description above).
+ inputFile="${productBootDir}/${bootJarFile}"
+ fi
+
"${dexopt}" --preopt "${inputFile}" "${outputFile}" "${optimizeFlags}"
status="$?"