OSDN Git Service

Merge "Fix issue 12251: double click handling"
[android-x86/sdk.git] / eclipse / scripts / create_adt_symlinks.sh
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.adt/libs"
14 # computes "../.." from DEST to here (in /android)
15 BACK=`echo $DEST | sed 's@[^/]*@..@g'`
16
17 mkdir -p $DEST
18
19 LIBS="sdkstats androidprefs layoutlib_api ide_common ninepatch sdklib sdkuilib"
20
21 echo "make java libs ..."
22 make -j3 showcommands $LIBS || die "ADT: 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     ln -svf $BACK/out/host/linux-x86/framework/kxml2-2.3.0.jar          "$DEST/"
33     ln -svf $BACK/out/host/linux-x86/framework/commons-compress-1.0.jar "$DEST/"
34   
35 elif [ "$HOST" == "Darwin" ]; then
36     for LIB in $LIBS; do
37         ln -svf $BACK/out/host/darwin-x86/framework/$LIB.jar "$DEST/"
38     done
39     ln -svf $BACK/out/host/darwin-x86/framework/kxml2-2.3.0.jar          "$DEST/"
40     ln -svf $BACK/out/host/darwin-x86/framework/commons-compress-1.0.jar "$DEST/"
41
42 elif [ "${HOST:0:6}" == "CYGWIN" ]; then
43     for LIB in $LIBS; do
44         cp -vf  out/host/windows-x86/framework/$LIB.jar "$DEST/"
45     done
46
47     if [ ! -f "$DEST/kxml2-2.3.0.jar" ]; then
48         cp -v "prebuilt/common/kxml2/kxml2-2.3.0.jar" "$DEST/"
49     fi
50
51     if [ ! -f "$DEST/commons-compress-1.0.jar" ]; then
52         cp -v "prebuilt/common/commons-compress/commons-compress-1.0.jar" "$DEST/"
53     fi
54
55     chmod -v a+rx "$DEST"/*.jar
56 else
57     echo "Unsupported platform ($HOST). Nothing done."
58 fi
59