blob: 9913de9a0489cdfd279f34cdfa9d1ac05b4e97e6 [file] [log] [blame]
The Android Open Source Project55a2c712009-03-03 19:29:09 -08001#!/bin/bash
2#----------------------------------------------------------------------------|
3# Creates the links to use ddm{ui}lib in the eclipse-ide plugin.
Raphaelf1d64e22009-11-18 11:27:35 -08004# Run this from sdk/eclipse/scripts
The Android Open Source Project55a2c712009-03-03 19:29:09 -08005#----------------------------------------------------------------------------|
6
7set -e
8
9HOST=`uname`
Xavier Ducrohete312b282010-06-22 17:55:45 -070010
The Android Open Source Project55a2c712009-03-03 19:29:09 -080011if [ "${HOST:0:6}" == "CYGWIN" ]; then
Xavier Ducrohete312b282010-06-22 17:55:45 -070012 PLATFORM="windows-x86"
13
The Android Open Source Project55a2c712009-03-03 19:29:09 -080014 # We can't use symlinks under Cygwin
15
16 function cpfile { # $1=dest $2=source
17 cp -fv $2 $1/
18 }
19
20 function cpdir() { # $1=dest $2=source
21 rsync -avW --delete-after $2 $1
22 }
23
24else
Xavier Ducrohete312b282010-06-22 17:55:45 -070025 if [ "$HOST" == "Linux" ]; then
26 PLATFORM="linux-x86"
27 elif [ "$HOST" == "Darwin" ]; then
28 PLATFORM="darwin-x86"
29 else
30 echo "Unsupported platform ($HOST). Nothing done."
31 fi
32
The Android Open Source Project55a2c712009-03-03 19:29:09 -080033 # For all other systems which support symlinks
34
35 # computes the "reverse" path, e.g. "a/b/c" => "../../.."
36 function back() {
37 echo $1 | sed 's@[^/]*@..@g'
38 }
39
40 function cpfile { # $1=dest $2=source
41 ln -svf `back $1`/$2 $1/
42 }
43
44 function cpdir() { # $1=dest $2=source
45 ln -svf `back $1`/$2 $1
46 }
47fi
48
49# CD to the top android directory
50D=`dirname "$0"`
Raphaelf1d64e22009-11-18 11:27:35 -080051cd "$D/../../../"
The Android Open Source Project55a2c712009-03-03 19:29:09 -080052
Raphaelf1d64e22009-11-18 11:27:35 -080053BASE="sdk/eclipse/plugins/com.android.ide.eclipse.ddms"
The Android Open Source Project55a2c712009-03-03 19:29:09 -080054DEST=$BASE/libs
Xavier Ducrohete312b282010-06-22 17:55:45 -070055# computes "../.." from DEST to here (in /android)
56BACK=`echo $DEST | sed 's@[^/]*@..@g'`
57
The Android Open Source Project55a2c712009-03-03 19:29:09 -080058mkdir -p $DEST
59for i in prebuilt/common/jfreechart/*.jar; do
60 cpfile $DEST $i
61done
62
Xavier Ducrohete312b282010-06-22 17:55:45 -070063LIBS="ddmlib ddmuilib"
64for LIB in $LIBS; do
65 cpfile $DEST $BACK/out/host/$PLATFORM/framework/$LIB.jar
The Android Open Source Project55a2c712009-03-03 19:29:09 -080066done