Home | History | Annotate | Download | only in scripts
      1 #!/bin/bash
      2 # Expected arguments:
      3 # $1 = out_dir
      4 # $2 = dist_dir
      5 # $3 = build_number
      6 
      7 # exit on error
      8 set -e
      9 
     10 if [ $# -ne 3 ]
     11 then
     12   echo "Usage: $0 <out_dir> <dest_dir> <build_number>" > /dev/stderr
     13   echo "Given arguments: $*" > /dev/stderr
     14   exit 1
     15 fi
     16 
     17 PROG_DIR=$(dirname "$0")
     18 
     19 cd "$PROG_DIR"/../../..
     20 ANDROID_SRC="$PWD"
     21 
     22 OUT="$1"
     23 DIST="$2"
     24 BNUM="$3"
     25 
     26 echo "ANDROID_SRC=$ANDROID_SRC"
     27 echo "OUT=$OUT"
     28 echo "DIST=$DIST"
     29 echo "BNUM=$BNUM"
     30 
     31 # Steps to build Eclipse
     32 # 1. Generate Maven repository containing all tools
     33 echo Running gradle to build tools libraries...
     34 cd "$ANDROID_SRC"/tools
     35 ./gradlew --no-daemon publishLocal
     36 
     37 # 2. Copy dependent jars into the libs folder of each plugin
     38 echo Copying jars to be embedded inside the ADT plugins
     39 cd "$ANDROID_SRC"
     40 ./tools/gradlew -i -b sdk/eclipse/build.gradle --no-daemon copydeps
     41 
     42 # 3. Launch Tycho build
     43 echo Launching Tycho to build ADT plugins and bundle
     44 ( set -x ; BUILD_NUMBER="$BNUM" ./tools/gradlew -i -b sdk/eclipse/build.gradle --no-daemon buildEclipse)
     45 
     46 echo Copying ADT plugins and bundle into destination folder
     47 cd "$ANDROID_SRC"
     48 cp -rv out/host/maven/bundles-*/products/*.zip "$DIST"/
     49 cp -rv out/host/maven/p2repo-*/p2repo-*.zip "$DIST"/p2repo-$BNUM.zip
     50