aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDan Bornstein <danfuzz@android.com>2010-09-13 17:30:10 -0700
committerDan Bornstein <danfuzz@android.com>2010-09-14 12:16:48 -0700
commit32bc0787307ba57e92fa74c52da550e2ca22af7f (patch)
tree7deb4b72c5106945c04030a51b6ebb54012d1e21 /tools
parent96604831505a9ffef8d2da38c24a533a593efb34 (diff)
Add use of sentinel in BOOTCLASSPATH entries during preopt.
This change introduces the use of the sentinel string "/./" inside BOOTCLASSPATH entries to signal the start of the portion of the paths that should be preserved in optimized dex file dependency lists. It's a little grotty, but it does serve the purpose of allowing host side dexopt to do its thing inside a build directory without letting the host path leading up to that build directory to leak into the results. This change also makes it an error (instead of just a warning) for there to be BOOTCLASSPATH entries that are not absolute paths (either truly absolute or ones with the sentinels as per above). FWIW, dx uses this sentinel in a similar way. Change-Id: Ic8d0533d3ee0bd7a1d4d06fcf9232c56f0a60abf
Diffstat (limited to 'tools')
-rwxr-xr-xtools/dex-preopt10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/dex-preopt b/tools/dex-preopt
index 21e4a32fb..6ac5a6bde 100755
--- a/tools/dex-preopt
+++ b/tools/dex-preopt
@@ -222,9 +222,15 @@ elif [ `expr -- "${dexopt}" : ".* "` != '0' ]; then
exit 1
fi
-# Transform the bootJars into full paths, maintaining the colon separator.
+# Expand the bootJars into paths that are relative from the build
+# directory, maintaining the colon separators. We also add "/./" to
+# separate the build system part of the path from the target system
+# suffix part of the path. The dexopt executable (deep inside the vm
+# 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).
BOOTCLASSPATH=`echo ":${bootJars}" | \
- sed "s!:\([^:]*\)!:${product}/system/framework/\1.jar!g" | \
+ sed "s!:\([^:]*\)!:${product}/./system/framework/\1.jar!g" | \
sed 's/^://'`
export BOOTCLASSPATH