DeprecatedReplicant42ADTBuild » History » Version 6
Beuc Beuc, 07/26/2015 01:41 PM
Trisquel disables Recommended packages by default, requiring more precise deps; ditch ccache instructions for a 15mn build
| 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 | 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]] |
| 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 | 6 | Beuc Beuc | apt-get install openjdk-6-jdk libasm-java |
| 30 | 1 | Beuc Beuc | </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 | 4 | Beuc Beuc | cd ~ |
| 43 | 1 | Beuc Beuc | |
| 44 | # Avoid prompts |
||
| 45 | git config --global user.email "you@example.com" |
||
| 46 | git config --global user.name "Your Name" |
||
| 47 | git config --global color.ui true |
||
| 48 | |||
| 49 | mkdir replicant-4.2/ |
||
| 50 | cd replicant-4.2/ |
||
| 51 | ../tools/repo init -u git://git.replicant.us/manifest.git -b replicant-4.2 |
||
| 52 | ../tools/repo sync -j4 |
||
| 53 | # > 1h, 27GB (inc. 17GB .repo) |
||
| 54 | </pre> |
||
| 55 | |||
| 56 | h2. Building ADT 21 |
||
| 57 | |||
| 58 | <pre> |
||
| 59 | . build/envsetup.sh |
||
| 60 | cd sdk/eclipse/ |
||
| 61 | |||
| 62 | # Complies with setup_eclipse.sh and fix download URL |
||
| 63 | sudo mkdir -p /buildbot/eclipse-android |
||
| 64 | sudo chown replicant /buildbot/eclipse-android |
||
| 65 | sed -i -e '/eclipse-rcp-helios-SR2/ s/download.eclipse.org/archive.eclipse.org/' \ |
||
| 66 | scripts/setup_eclipse.sh |
||
| 67 | # Note: I tried with 'apt-get install eclipse-rcp eclipse-pde' and ECLIPSE_HOME=/usr/lib/eclipse |
||
| 68 | 2 | Beuc Beuc | # but it lacks org.eclipse.wst.* plugins aka eclipse-wtp-xmltools |
| 69 | |||
| 70 | 3 | Beuc Beuc | mkdir ~/adt/ |
| 71 | 1 | Beuc Beuc | scripts/build_server.sh ~/adt |
| 72 | 6 | Beuc Beuc | # 15mn with 4 cores, 32GB (inc. 17GB .repo) |
| 73 | 1 | Beuc Beuc | </pre> |
| 74 | |||
| 75 | The ADK release is in @~/adt/android-eclipse-v201507252158.zip@ :) |
||
| 76 | |||
| 77 | |||
| 78 | h2. Testing |
||
| 79 | |||
| 80 | See the nice Eclipse tutorial at [[SDK#Usage-guides]]. |
||
| 81 | 2 | Beuc Beuc | |
| 82 | 1 | Beuc Beuc | |
| 83 | h2. TODOs |
||
| 84 | |||
| 85 | * warning on installation, maybe we can sign the package: |
||
| 86 | <pre> |
||
| 87 | Warning: You are installing software that contains unsigned content. |
||
| 88 | The authenticity or validity of this software cannot be established. Do |
||
| 89 | you want to continue with the installation? |
||
| 90 | </pre> |
||
| 91 | |||
| 92 | * Note: error in Eclipse 3.8.1 in the layout edition view. Needs testing with an older Eclipse: |
||
| 93 | <pre> |
||
| 94 | This version of the rendering library is more recent than your version of ADT plug-in. Please update ADT plug-in |
||
| 95 | 5 | Beuc Beuc | </pre> |
| 96 | |||
| 97 | * Do we rely on prebuilt/prebuilts dirs? |