DeprecatedReplicant42ADTBuild » History » Version 4
Beuc Beuc, 07/26/2015 11:18 AM
Take USE_CCACHE into account
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 | 4 | Beuc Beuc | exec bash |
48 | 1 | Beuc Beuc | |
49 | # Avoid prompts |
||
50 | git config --global user.email "you@example.com" |
||
51 | git config --global user.name "Your Name" |
||
52 | git config --global color.ui true |
||
53 | |||
54 | mkdir replicant-4.2/ |
||
55 | cd replicant-4.2/ |
||
56 | ../tools/repo init -u git://git.replicant.us/manifest.git -b replicant-4.2 |
||
57 | ../tools/repo sync -j4 |
||
58 | # > 1h, 27GB (inc. 17GB .repo) |
||
59 | </pre> |
||
60 | |||
61 | h2. Building ADT 21 |
||
62 | |||
63 | <pre> |
||
64 | . build/envsetup.sh |
||
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 | 3 | Beuc Beuc | mkdir ~/adt/ |
76 | 1 | Beuc Beuc | scripts/build_server.sh ~/adt |
77 | # ~1h with 4 cores, 32GB (inc. 17GB .repo), 1GB .ccache |
||
78 | </pre> |
||
79 | |||
80 | The ADK release is in @~/adt/android-eclipse-v201507252158.zip@ :) |
||
81 | |||
82 | |||
83 | h2. Testing |
||
84 | |||
85 | See the nice Eclipse tutorial at [[SDK#Usage-guides]]. |
||
86 | 2 | Beuc Beuc | |
87 | 1 | Beuc Beuc | |
88 | h2. TODOs |
||
89 | |||
90 | * warning on installation, maybe we can sign the package: |
||
91 | <pre> |
||
92 | Warning: You are installing software that contains unsigned content. |
||
93 | The authenticity or validity of this software cannot be established. Do |
||
94 | you want to continue with the installation? |
||
95 | </pre> |
||
96 | |||
97 | * Note: error in Eclipse 3.8.1 in the layout edition view. Needs testing with an older Eclipse: |
||
98 | <pre> |
||
99 | This version of the rendering library is more recent than your version of ADT plug-in. Please update ADT plug-in |
||
100 | </pre> |
||
101 | |||
102 | * Do we rely on prebuilt/prebuilts dirs? |