lin
2025-08-21 57113df3a0e2be01232281fad9a5f2c060567981
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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