DeprecatedReplicant42ADTBuild » History » Version 8
Beuc Beuc, 07/29/2015 05:30 PM
Signing ADT
| 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 | 8 | Beuc Beuc | h2. Signing ADT |
| 79 | 1 | Beuc Beuc | |
| 80 | 8 | Beuc Beuc | By default, Eclipse display on install: |
| 81 | 1 | Beuc Beuc | <pre> |
| 82 | Warning: You are installing software that contains unsigned content. |
||
| 83 | The authenticity or validity of this software cannot be established. Do |
||
| 84 | you want to continue with the installation? |
||
| 85 | </pre> |
||
| 86 | 8 | Beuc Beuc | |
| 87 | Let's sign the package. |
||
| 88 | Make sure you have @keytool@ (@openjdk-6-jre-headless@) and @jarsigner@ (@openjdk-6-jdk@), and: |
||
| 89 | <pre> |
||
| 90 | # generate self-signed certificate |
||
| 91 | keytool -genkey -dname 'cn=Builder,ou=ADT,o=Replicant,c=FR' -keystore ~/adt/cacerts -validity 3650 -storepass 'changeme' -keypass 'changeme' -alias 'replicant' |
||
| 92 | # sign the JARs and repack |
||
| 93 | unzip -d t/ android-eclipse-v201507261317.zip |
||
| 94 | find t/features/ t/plugins/ -name "*.jar" -exec jarsigner -keystore ~/adt/cacerts -storepass 'changeme' -verbose {} 'replicant' \; |
||
| 95 | (cd t/ && zip -r ../android-eclipse-v201507261317.zip *) |
||
| 96 | rm -rf t/ |
||
| 97 | </pre> |
||
| 98 | |||
| 99 | |||
| 100 | At install time, Eclipse will ask the user if she trusts "Builder; ADT; Replicant". |
||
| 101 | |||
| 102 | h2. Testing |
||
| 103 | |||
| 104 | See the nice Eclipse tutorial at [[SDK#Usage-guides]]. |
||
| 105 | |||
| 106 | |||
| 107 | h2. TODOs |
||
| 108 | 1 | Beuc Beuc | |
| 109 | 7 | Beuc Beuc | * Note: partial incompatibility in Eclipse 3.8.1, in the layout edition view. Needs testing with an older Eclipse: |
| 110 | 1 | Beuc Beuc | <pre> |
| 111 | This version of the rendering library is more recent than your version of ADT plug-in. Please update ADT plug-in |
||
| 112 | </pre> |
||
| 113 | 7 | Beuc Beuc | ADT 21 should work with 3.6.2 (used for compilation) and possibly with 3.7 (to be tested). |
| 114 | |||
| 115 | 5 | Beuc Beuc | |
| 116 | * Do we rely on prebuilt/prebuilts dirs? |