Project

General

Profile

DeprecatedReplicant42ADTBuild » History » Version 2

Beuc Beuc, 07/25/2015 09:01 PM
Failed alternative for Eclipse

1 1 Beuc Beuc
h1. Build the Android Development Tools for Eclipse (ADT) with Replicant 4.2
2
3
h2. Principle of operation
4
5
The [[ReplicantSourceCode|Android 4.2 source code]] ships a @sdk/eclipse/@ directory with ADT build scripts.
6
The build script will also download Eclipse 3.6.2 files as build dependencies.
7
8
Note: as of 2015-07, ADT is "deprecated":http://android-developers.blogspot.fr/2015/06/an-update-on-eclipse-android-developer.html in favor of Android Studio, based on IntelliJ. 
9
10
h2. Recreate matching build environment
11
12
Replicant 4.2 is based on CyanogenMod 10.1 which is based on AOSP 4.2.2, released 2013-02.
13
The build environment used by NDK release managers should be Ubuntu LTS 10.04.
14
15
To recreate it easily with LXC, follow:
16 2 Beuc Beuc
* [[BuildEnvironments#Trisquel-41-Taranis-based-on-Ubuntu-1004-Lucid-with-LXC|Trisquel 4.1 Taranis (based on Ubuntu 10.04) with LXC]]
17 1 Beuc Beuc
* [[BuildEnvironments#Non-privileged-user-setup|Non-privileged user setup]]
18
19
h2. Build dependencies
20
21
<pre>
22
# Based on https://web.archive.org/web/20121201011547/http://source.android.com/source/initializing.html
23
# git recompiled manually, mingw32 dropped
24
apt-get install gnupg flex bison gperf build-essential \
25
  zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
26
  x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
27
  libgl1-mesa-dev g++-multilib python-markdown \
28
  libxml2-utils xsltproc
29
apt-get install openjdk-6-jdk
30
</pre>
31
32
h2. Preparing the sources
33
34
Based on [[ReplicantSourceCode]] with additional configuration.
35
Login as user @replicant@ and:
36
37
<pre>
38
mkdir ~/tools/
39
cd ~/tools/
40
wget http://commondatastorage.googleapis.com/git-repo-downloads/repo
41
chmod a+x repo
42
cd ~
43
44
cat <<EOF >> ~/.bashrc
45
export USE_CCACHE=1
46
EOF
47
48
# Avoid prompts
49
git config --global user.email "you@example.com"
50
git config --global user.name "Your Name"
51
git config --global color.ui true
52
53
mkdir replicant-4.2/
54
cd replicant-4.2/
55
../tools/repo init -u git://git.replicant.us/manifest.git -b replicant-4.2
56
../tools/repo sync -j4 
57
# > 1h, 27GB (inc. 17GB .repo)
58
</pre>
59
60
h2. Building ADT 21
61
62
<pre>
63
. build/envsetup.sh
64
lunch sdk-eng
65
cd sdk/eclipse/
66
67
# Complies with setup_eclipse.sh and fix download URL
68
sudo mkdir -p /buildbot/eclipse-android
69
sudo chown replicant /buildbot/eclipse-android
70
sed -i -e '/eclipse-rcp-helios-SR2/ s/download.eclipse.org/archive.eclipse.org/' \
71
  scripts/setup_eclipse.sh
72 2 Beuc Beuc
# Note: I tried with 'apt-get install eclipse-rcp eclipse-pde' and ECLIPSE_HOME=/usr/lib/eclipse
73
# but it lacks org.eclipse.wst.* plugins aka eclipse-wtp-xmltools
74 1 Beuc Beuc
75
scripts/build_server.sh ~/adt
76
# ~1h with 4 cores, 32GB (inc. 17GB .repo), 1GB .ccache
77
</pre>
78
79
The ADK release is in @~/adt/android-eclipse-v201507252158.zip@ :)
80
81
82
h2. Testing
83
84
See the nice Eclipse tutorial at [[SDK#Usage-guides]].
85 2 Beuc Beuc
86 1 Beuc Beuc
87
h2. TODOs
88
89
* warning on installation, maybe we can sign the package:
90
<pre>
91
Warning: You are installing software that contains unsigned content.
92
The authenticity or validity of this software cannot be established. Do
93
you want to continue with the installation?
94
</pre>
95
96
* Note: error in Eclipse 3.8.1 in the layout edition view. Needs testing with an older Eclipse:
97
<pre>
98
This version of the rendering library is more recent than your version of ADT plug-in. Please update ADT plug-in
99
</pre>
100
101
* Do we rely on prebuilt/prebuilts dirs?