1 #!/bin/bash 2 function die() { 3 echo "Error: $*" 4 exit 1 5 } 6 7 set -e # fail early 8 9 # CD to the top android directory 10 D=`dirname "$0"` 11 cd "$D/../../../" 12 13 DEST="sdk/eclipse/plugins/com.android.ide.eclipse.traceview/libs" 14 # computes "../.." from DEST to here (in /android) 15 BACK=`echo $DEST | sed 's@[^/]*@..@g'` 16 17 mkdir -p $DEST 18 19 LIBS="traceview" 20 21 echo "make java libs ..." 22 make -j3 showcommands $LIBS || die "TRACEVIEW: Fail to build one of $LIBS." 23 24 echo "Copying java libs to $DEST" 25 26 27 HOST=`uname` 28 if [ "$HOST" == "Linux" ]; then 29 for LIB in $LIBS; do 30 ln -svf $BACK/out/host/linux-x86/framework/$LIB.jar "$DEST/" 31 done 32 33 elif [ "$HOST" == "Darwin" ]; then 34 for LIB in $LIBS; do 35 ln -svf $BACK/out/host/darwin-x86/framework/$LIB.jar "$DEST/" 36 done 37 38 elif [ "${HOST:0:6}" == "CYGWIN" ]; then 39 for LIB in $LIBS; do 40 cp -vf out/host/windows-x86/framework/$LIB.jar "$DEST/" 41 done 42 43 chmod -v a+rx "$DEST"/*.jar 44 else 45 echo "Unsupported platform ($HOST). Nothing done." 46 fi 47 48