diff options
author | Siva Velusamy <vsiva@google.com> | 2014-05-22 22:23:27 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-22 22:23:28 +0000 |
commit | 4648148c1e87bac9aa326ba942bc065e0731733b (patch) | |
tree | 7d0e4d32caed5cd022e55e9f5a5f303ea776a87f | |
parent | 2fbf149ea861cad6338576f6222d29a6ed400987 (diff) | |
parent | 54107d03936fdc287cf48f29cd2aa3ae561d4aa1 (diff) | |
download | sdk-4648148c1e87bac9aa326ba942bc065e0731733b.zip sdk-4648148c1e87bac9aa326ba942bc065e0731733b.tar.gz sdk-4648148c1e87bac9aa326ba942bc065e0731733b.tar.bz2 |
Merge "Enable building with Tycho" into idea133
-rwxr-xr-x | eclipse/scripts/build_adt.sh | 76 |
1 files changed, 54 insertions, 22 deletions
diff --git a/eclipse/scripts/build_adt.sh b/eclipse/scripts/build_adt.sh index ea32247..0c5792c 100755 --- a/eclipse/scripts/build_adt.sh +++ b/eclipse/scripts/build_adt.sh @@ -4,34 +4,66 @@ # $2 = dist_dir # $3 = build_number -PROG_DIR=$(dirname "$0") +# exit on error +set -e -function die() { - echo "$*" > /dev/stderr +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" + +MAVEN="$ANDROID_SRC"/prebuilts/eclipse/maven/apache-maven-3.2.1/bin/mvn + +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 -while [[ -n "$1" ]]; do - if [[ -z "$OUT" ]]; then - OUT="$1" - elif [[ -z "$DIST" ]]; then - DIST="$1" - elif [[ -z "$BNUM" ]]; then - BNUM="$1" - else - die "[$0] Unknown parameter: $1" - fi - shift -done +# The following step temporarily disabled: we are running maven in online mode, but it +# actually picks up everything it needs from within the prebuilts or the out folder. The +# current issue is just in creating a local repository that looks as if it has been +# initialized by downloading from a remote repository. -if [[ -z "$OUT" ]]; then die "## Error: Missing out folder"; fi -if [[ -z "$DIST" ]]; then die "## Error: Missing destination folder"; fi -if [[ -z "$BNUM" ]]; then die "## Error: Missing build number"; fi +# 2. Create a combined m2 repository that has the tools generated in step 1 and other prebuilts +# This is required so that maven can be run in offline mode in the next step. +# echo Creating a combined tools + prebuilts maven repo... +# COMBINED_M2_REPO="$ANDROID_SRC"/out/host/maven/toolsRepo +# mkdir -p "$COMBINED_M2_REPO" +# cp -r "$ANDROID_SRC"/out/repo "$COMBINED_M2_REPO" +# cp -r "$ANDROID_SRC"/prebuilts/tools/common/m2/repository/* "$COMBINED_M2_REPO" -cd "$PROG_DIR" +# 3. Convert the generated Maven repository into a p2 repository +echo Converting maven repo to p2 repo... +cd "$ANDROID_SRC"/sdk/p2gen +"$MAVEN" --no-snapshot-updates \ + -P online \ + -Dmaven.repo.local=../../out/host/maven/toolsRepo \ + p2:site -## TODO: Invoke Maven Tycho build here +# 4. Launch Tycho build +echo Launching Tycho to build ADT plugins and bundle +cd "$ANDROID_SRC"/sdk/eclipse +make -f maven.mk echo "## Copying ADT plugins and bundle into destination folder" -echo "Temporary artifact until Tycho is enabled" > "$DIST"/temporary-artifact.txt +cd "$ANDROID_SRC" +cp -rv out/host/maven/bundles-*/products/*.gz "$DIST"/ +cp -rv out/host/maven/bundles-*/products/*.zip "$DIST"/ +cp -rv out/host/maven/p2repo-*/p2repo-*.zip "$DIST"/ |