1 #!/bin/bash -e 2 # 3 # Copyright (C) 2011 The Android Open Source Project 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # See the License for the specific language governing permissions and 15 # limitations under the License. 16 17 # Set up prog to be the path of this script, including following 18 # symlinks, and set up progdir to be the fully-qualified pathname of 19 # its directory. Switch the current directory to progdir for the 20 # remainder of the script. 21 prog="$0" 22 while [ -h "${prog}" ]; do 23 newProg=`/bin/ls -ld "${prog}"` 24 newProg=`expr "${newProg}" : ".* -> \(.*\)$"` 25 if expr "x${newProg}" : 'x/' >/dev/null; then 26 prog="${newProg}" 27 else 28 progdir=`dirname "${prog}"` 29 prog="${progdir}/${newProg}" 30 fi 31 done 32 oldwd=`pwd` 33 progdir=`dirname "${prog}"` 34 cd "${progdir}" 35 36 resourceDir=../../resources/dalvik/system 37 38 rm -rf classes 39 rm -rf classes.dex 40 rm -rf loading-test2.jar 41 42 mkdir classes 43 javac -d classes *.java 44 dx --dex --output=classes.dex classes 45 jar cf loading-test2.jar classes.dex -C resources . 46 47 rm -rf classes 48 mv classes.dex ${resourceDir}/loading-test2.dex 49 mv loading-test2.jar ${resourceDir} 50