blob: ce7bf4b1b96a6fd8748af5d3cceaa269cb22688b [file] [log] [blame]
Konstantin Lopyrev0f317512010-07-15 18:26:51 -07001#!/bin/bash
2#----------------------------------------------------------------------------|
3# Creates the links to use hierarchyviewer{ui}lib in the eclipse-ide plugin.
4# Run this from sdk/eclipse/scripts
5#----------------------------------------------------------------------------|
6
7set -e
8
9function die() {
10 echo "Error: $*"
11 exit 1
12}
13
14HOST=`uname`
15
16if [ "${HOST:0:6}" == "CYGWIN" ]; then
17 PLATFORM="windows-x86"
18
19 # We can't use symlinks under Cygwin
20
21 function cpfile { # $1=dest $2=source
22 cp -fv $2 $1/
23 }
24
25 function cpdir() { # $1=dest $2=source
26 rsync -avW --delete-after $2 $1
27 }
28
29else
30 if [ "$HOST" == "Linux" ]; then
31 PLATFORM="linux-x86"
32 elif [ "$HOST" == "Darwin" ]; then
33 PLATFORM="darwin-x86"
34 else
35 echo "Unsupported platform ($HOST). Nothing done."
36 fi
37
38 # For all other systems which support symlinks
39
40 # computes the "reverse" path, e.g. "a/b/c" => "../../.."
41 function back() {
42 echo $1 | sed 's@[^/]*@..@g'
43 }
44
45 function cpfile { # $1=dest $2=source
46 ln -svf `back $1`/$2 $1/
47 }
48
49 function cpdir() { # $1=dest $2=source
50 ln -svf `back $1`/$2 $1
51 }
52fi
53
54# CD to the top android directory
55D=`dirname "$0"`
56cd "$D/../../../"
57
58BASE="sdk/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer"
59DEST=$BASE/libs
60
61mkdir -p $DEST
62
63LIBS="hierarchyviewerlib hierarchyvieweruilib"
64echo "make java libs ..."
65make -j3 showcommands $LIBS || die "Hierarchy Viewer: Fail to build one of $LIBS."
66
67for LIB in $LIBS; do
68 cpfile $DEST out/host/$PLATFORM/framework/$LIB.jar
69done