aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/scripts/create_test_symlinks.sh
blob: fa5fd63f867f96d4a50c510766fac6a77e97ecd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash

set -e

# CD to the top android directory
D=`dirname "$0"`
cd "$D/../../../../"

# computes relative ".." paths from $1 to here (in /android)
function back() {
  echo $1 | sed 's@[^/]*@..@g'
}

HOST=`uname`
if [ "${HOST:0:6}" == "CYGWIN" ]; then
    # We can't use symlinks under Cygwin
    function cpdir() { # $1=dest $2=source
        rsync -avW --delete-after $2 $1
    }

else
    # For all other systems which support symlinks
    function cpdir() { # $1=dest $2=source
        ln -svf `back $1`/$2 $1
    }
fi

BASE="development/tools/eclipse/plugins/com.android.ide.eclipse.tests"
DEST=$BASE
BACK=`back $DEST`

HOST=`uname`
if [ "$HOST" == "Linux" ]; then
    ln -svf $BACK/out/host/linux-x86/framework/layoutlib.jar "$DEST/"

elif [ "$HOST" == "Darwin" ]; then
    ln -svf $BACK/out/host/darwin-x86/framework/layoutlib.jar "$DEST/"

elif [ "${HOST:0:6}" == "CYGWIN" ]; then
    cp -v "$BACK/out/host/windows/framework/layoutlib.jar" "$DEST/"

    chmod -v a+rx "$DEST"/*.jar

else
    echo "Unsupported platform ($HOST). Nothing done."
fi

# create link to ddmlib tests
DEST=$BASE/unittests/com/android
cpdir $DEST development/tools/ddms/libs/ddmlib/tests/src/com/android/ddmlib
cpdir $DEST development/tools/sdkmanager/libs/sdklib/tests/com/android/sdklib

DEST=$BASE/unittests/com/android/layoutlib
mkdir $BASE
cpdir $DEST frameworks/base/tools/layoutlib/bridge/tests/com/android/layoutlib/bridge