DeprecatedReplicant42ADTBuild » History » Version 10
Wolfgang Wiedmeyer, 04/16/2017 02:59 PM
link to rdt issue
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 | Based on [[ReplicantSourceCode]] with additional configuration. |
||
37 | Login as user @replicant@ and: |
||
38 | |||
39 | <pre> |
||
40 | mkdir ~/tools/ |
||
41 | cd ~/tools/ |
||
42 | wget http://commondatastorage.googleapis.com/git-repo-downloads/repo |
||
43 | chmod a+x repo |
||
44 | 4 | Beuc Beuc | cd ~ |
45 | 1 | Beuc Beuc | |
46 | # Avoid prompts |
||
47 | git config --global user.email "you@example.com" |
||
48 | git config --global user.name "Your Name" |
||
49 | git config --global color.ui true |
||
50 | |||
51 | mkdir replicant-4.2/ |
||
52 | cd replicant-4.2/ |
||
53 | ../tools/repo init -u git://git.replicant.us/manifest.git -b replicant-4.2 |
||
54 | ../tools/repo sync -j4 |
||
55 | # > 1h, 27GB (inc. 17GB .repo) |
||
56 | </pre> |
||
57 | |||
58 | h2. Building ADT 21 |
||
59 | |||
60 | <pre> |
||
61 | . build/envsetup.sh |
||
62 | cd sdk/eclipse/ |
||
63 | |||
64 | # Complies with setup_eclipse.sh and fix download URL |
||
65 | sudo mkdir -p /buildbot/eclipse-android |
||
66 | sudo chown replicant /buildbot/eclipse-android |
||
67 | sed -i -e '/eclipse-rcp-helios-SR2/ s/download.eclipse.org/archive.eclipse.org/' \ |
||
68 | scripts/setup_eclipse.sh |
||
69 | # Note: I tried with 'apt-get install eclipse-rcp eclipse-pde' and ECLIPSE_HOME=/usr/lib/eclipse |
||
70 | 2 | Beuc Beuc | # but it lacks org.eclipse.wst.* plugins aka eclipse-wtp-xmltools |
71 | |||
72 | 3 | Beuc Beuc | mkdir ~/adt/ |
73 | 1 | Beuc Beuc | scripts/build_server.sh ~/adt |
74 | 6 | Beuc Beuc | # 15mn with 4 cores, 32GB (inc. 17GB .repo) |
75 | 1 | Beuc Beuc | </pre> |
76 | |||
77 | The ADK release is in @~/adt/android-eclipse-v201507252158.zip@ :) |
||
78 | |||
79 | |||
80 | 8 | Beuc Beuc | h2. Signing ADT |
81 | 1 | Beuc Beuc | |
82 | 8 | Beuc Beuc | By default, Eclipse display on install: |
83 | 1 | Beuc Beuc | <pre> |
84 | Warning: You are installing software that contains unsigned content. |
||
85 | The authenticity or validity of this software cannot be established. Do |
||
86 | you want to continue with the installation? |
||
87 | </pre> |
||
88 | 8 | Beuc Beuc | |
89 | Let's sign the package. |
||
90 | Make sure you have @keytool@ (@openjdk-6-jre-headless@) and @jarsigner@ (@openjdk-6-jdk@), and: |
||
91 | <pre> |
||
92 | # generate self-signed certificate |
||
93 | keytool -genkey -dname 'cn=Builder,ou=ADT,o=Replicant,c=FR' -keystore ~/adt/cacerts -validity 3650 -storepass 'changeme' -keypass 'changeme' -alias 'replicant' |
||
94 | # sign the JARs and repack |
||
95 | unzip -d t/ android-eclipse-v201507261317.zip |
||
96 | find t/features/ t/plugins/ -name "*.jar" -exec jarsigner -keystore ~/adt/cacerts -storepass 'changeme' -verbose {} 'replicant' \; |
||
97 | (cd t/ && zip -r ../android-eclipse-v201507261317.zip *) |
||
98 | rm -rf t/ |
||
99 | </pre> |
||
100 | |||
101 | |||
102 | At install time, Eclipse will ask the user if she trusts "Builder; ADT; Replicant". |
||
103 | |||
104 | h2. Testing |
||
105 | |||
106 | See the nice Eclipse tutorial at [[SDK#Usage-guides]]. |
||
107 | |||
108 | |||
109 | h2. TODOs |
||
110 | 1 | Beuc Beuc | |
111 | 7 | Beuc Beuc | * Note: partial incompatibility in Eclipse 3.8.1, in the layout edition view. Needs testing with an older Eclipse: |
112 | 1 | Beuc Beuc | <pre> |
113 | This version of the rendering library is more recent than your version of ADT plug-in. Please update ADT plug-in |
||
114 | </pre> |
||
115 | 7 | Beuc Beuc | ADT 21 should work with 3.6.2 (used for compilation) and possibly with 3.7 (to be tested). |
116 | |||
117 | 5 | Beuc Beuc | |
118 | * Do we rely on prebuilt/prebuilts dirs? |