diff options
Diffstat (limited to 'eclipse/scripts/build_adt.sh')
-rwxr-xr-x | eclipse/scripts/build_adt.sh | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/eclipse/scripts/build_adt.sh b/eclipse/scripts/build_adt.sh new file mode 100755 index 000000000..7006aabc5 --- /dev/null +++ b/eclipse/scripts/build_adt.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Expected arguments: +# $1 = out_dir +# $2 = dist_dir +# $3 = build_number + +# exit on error +set -e + +if [ $# -ne 3 ] +then + echo "Usage: $0 <out_dir> <dest_dir> <build_number>" > /dev/stderr + echo "Given arguments: $*" > /dev/stderr + exit 1 +fi + +PROG_DIR=$(dirname "$0") + +cd "$PROG_DIR"/../../.. +ANDROID_SRC="$PWD" + +OUT="$1" +DIST="$2" +BNUM="$3" + +echo "ANDROID_SRC=$ANDROID_SRC" +echo "OUT=$OUT" +echo "DIST=$DIST" +echo "BNUM=$BNUM" + +# Steps to build Eclipse +# 1. Generate Maven repository containing all tools +echo Running gradle to build tools libraries... +cd "$ANDROID_SRC"/tools +./gradlew --no-daemon publishLocal + +# 2. Copy dependent jars into the libs folder of each plugin +echo Copying jars to be embedded inside the ADT plugins +cd "$ANDROID_SRC" +./tools/gradlew -i -b sdk/eclipse/build.gradle --no-daemon copydeps + +# 3. Launch Tycho build +echo Launching Tycho to build ADT plugins and bundle +( set -x ; BUILD_NUMBER="$BNUM" ./tools/gradlew -i -b sdk/eclipse/build.gradle --no-daemon buildEclipse) + +echo Copying ADT plugins and bundle into destination folder +cd "$ANDROID_SRC" +cp -rv out/host/maven/bundles-*/products/*.zip "$DIST"/ +cp -rv out/host/maven/p2repo-*/p2repo-*.zip "$DIST"/p2repo-$BNUM.zip |