Project

General

Profile

DeprecatedReplicant42ADTBuild » History » Version 11

Wolfgang Wiedmeyer, 05/02/2017 10:25 PM
only link to source code page (information needs to be consolidated, so it's less likely to be outdated as in this case)

1 1 Beuc Beuc
h1. Build the Android Development Tools for Eclipse (ADT) with Replicant 4.2
2
3 10 Wolfgang Wiedmeyer
See feature #657 for the discussion about a ADT for Replicant and this page.
4
5 1 Beuc Beuc
h2. Principle of operation
6
7
The [[ReplicantSourceCode|Android 4.2 source code]] ships a @sdk/eclipse/@ directory with ADT build scripts.
8
The build script will also download Eclipse 3.6.2 files as build dependencies.
9
10
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. 
11
12
h2. Recreate matching build environment
13
14
Replicant 4.2 is based on CyanogenMod 10.1 which is based on AOSP 4.2.2, released 2013-02.
15
The build environment used by NDK release managers should be Ubuntu LTS 10.04.
16
17
To recreate it easily with LXC, follow:
18 6 Beuc Beuc
* [[BuildEnvironments#Trisquel-41-Taranis-based-on-Ubuntu-1004-Lucid-with-LXC|Trisquel 4.1 Taranis (based on Ubuntu 10.04) with LXC]]
19 1 Beuc Beuc
* [[BuildEnvironments#Non-privileged-user-setup|Non-privileged user setup]]
20
21
h2. Build dependencies
22
23
<pre>
24
# Based on https://web.archive.org/web/20121201011547/http://source.android.com/source/initializing.html
25
# git recompiled manually, mingw32 dropped
26 9 Beuc Beuc
apt-get install wget gnupg flex bison gperf build-essential \
27 1 Beuc Beuc
  zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
28
  x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
29
  libgl1-mesa-dev g++-multilib python-markdown \
30
  libxml2-utils xsltproc
31 6 Beuc Beuc
apt-get install openjdk-6-jdk libasm-java
32 1 Beuc Beuc
</pre>
33
34
h2. Preparing the sources
35
36 11 Wolfgang Wiedmeyer
Login as user @replicant@ and prepare the Replicant 4.2 source code as described in [[ReplicantSourceCode]].
37
.
38 1 Beuc Beuc
39
h2. Building ADT 21
40
41
<pre>
42
. build/envsetup.sh
43
cd sdk/eclipse/
44
45
# Complies with setup_eclipse.sh and fix download URL
46
sudo mkdir -p /buildbot/eclipse-android
47
sudo chown replicant /buildbot/eclipse-android
48
sed -i -e '/eclipse-rcp-helios-SR2/ s/download.eclipse.org/archive.eclipse.org/' \
49
  scripts/setup_eclipse.sh
50
# Note: I tried with 'apt-get install eclipse-rcp eclipse-pde' and ECLIPSE_HOME=/usr/lib/eclipse
51 2 Beuc Beuc
# but it lacks org.eclipse.wst.* plugins aka eclipse-wtp-xmltools
52
53 3 Beuc Beuc
mkdir ~/adt/
54 1 Beuc Beuc
scripts/build_server.sh ~/adt
55 6 Beuc Beuc
# 15mn with 4 cores, 32GB (inc. 17GB .repo)
56 1 Beuc Beuc
</pre>
57
58
The ADK release is in @~/adt/android-eclipse-v201507252158.zip@ :)
59
60
61 8 Beuc Beuc
h2. Signing ADT
62 1 Beuc Beuc
63 8 Beuc Beuc
By default, Eclipse display on install:
64 1 Beuc Beuc
<pre>
65
Warning: You are installing software that contains unsigned content.
66
The authenticity or validity of this software cannot be established. Do
67
you want to continue with the installation?
68
</pre>
69 8 Beuc Beuc
70
Let's sign the package.
71
Make sure you have @keytool@ (@openjdk-6-jre-headless@) and @jarsigner@ (@openjdk-6-jdk@), and:
72
<pre>
73
# generate self-signed certificate
74
keytool -genkey -dname 'cn=Builder,ou=ADT,o=Replicant,c=FR' -keystore ~/adt/cacerts -validity 3650 -storepass 'changeme' -keypass 'changeme' -alias 'replicant'
75
# sign the JARs and repack
76
unzip -d t/ android-eclipse-v201507261317.zip
77
find t/features/ t/plugins/ -name "*.jar" -exec jarsigner -keystore ~/adt/cacerts -storepass 'changeme' -verbose {} 'replicant' \;
78
(cd t/ && zip -r ../android-eclipse-v201507261317.zip *)
79
rm -rf t/
80
</pre>
81
82
83
At install time, Eclipse will ask the user if she trusts "Builder; ADT; Replicant".
84
85
h2. Testing
86
87
See the nice Eclipse tutorial at [[SDK#Usage-guides]].
88
89
90
h2. TODOs
91 1 Beuc Beuc
92 7 Beuc Beuc
* Note: partial incompatibility in Eclipse 3.8.1, in the layout edition view. Needs testing with an older Eclipse:
93 1 Beuc Beuc
<pre>
94
This version of the rendering library is more recent than your version of ADT plug-in. Please update ADT plug-in
95
</pre>
96 7 Beuc Beuc
ADT 21 should work with 3.6.2 (used for compilation) and possibly with 3.7 (to be tested).
97
98 5 Beuc Beuc
99
* Do we rely on prebuilt/prebuilts dirs?