Differences between revisions 7 and 8
Revision 7 as of 2016-06-06 09:33:55
Size: 1879
Editor: ChirayuDesai
Comment:
Revision 8 as of 2016-06-06 16:04:05
Size: 2848
Editor: ChirayuDesai
Comment:
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:

= Some general android build system info =
Android currently (as of 6.0) uses a GNU make based build system. The majority of it's code lives in the build repo, with per-module rules included in their specific repositories (or multiple, as we'll see later)
<<BR>>
To get a gist of how a specific Android components is built, an easy way is to run `make showcommands <target>`, where target is something like 'aapt'. This shows every command used to build that particular target, so it can be logged and replicated for a Debian build.
<<BR>>
It is best to use the same android branch as the debian version, and to use releases in general. The Android master branch is something which moves fast, and as of now (6.0) it has a new, faster build system.
Line 11: Line 18:
`make showcommands api-stubs-doc` output from Android 6.0: http://sprunge.us/QOgR
Line 15: Line 23:
 * Built for Debian as: (TODO)  * Can be easily built for Debian with `aapt package -x -M core/res/AndroidManifest.xml -S core/res/res -A core/res/assets -F framework-res.apk`
 * Needed by [[https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824933|apktool]]
 * TODO: [[https://developer.android.com/studio/publish/app-signing.html|Sign]] it?
Line 25: Line 35:

== TODO: ==
 * Make this elaborate
 * Include links to the relevant android build system files
 * Give a brief into about the android build system.

This page describes the build process of various Android development tools. It is intended to serve as a reference to create Debian specific rules.

Some general android build system info

Android currently (as of 6.0) uses a GNU make based build system. The majority of it's code lives in the build repo, with per-module rules included in their specific repositories (or multiple, as we'll see later)
To get a gist of how a specific Android components is built, an easy way is to run make showcommands <target>, where target is something like 'aapt'. This shows every command used to build that particular target, so it can be logged and replicated for a Debian build.
It is best to use the same android branch as the debian version, and to use releases in general. The Android master branch is something which moves fast, and as of now (6.0) it has a new, faster build system.

android.jar

This file contains the public API of the android framework, used when compiling apps. Since it only contains the public parts from the source which also includes private APIs, it's build process is a bit complex.

  1. doclava processes the public parts of the API and puts the relevant files in a folder.

  2. framework-res.apk is built from framework/base/core/res, which includes all the common image and string resources.

  3. Both of the above are then used to create an android.jar including only the public API.

make showcommands api-stubs-doc output from Android 6.0: http://sprunge.us/QOgR

framework-res.apk

  • Contains the common resources used by the system and apps.
  • Source is in frameworks/base/core/res

  • Can be easily built for Debian with aapt package -x -M core/res/AndroidManifest.xml  -S core/res/res -A core/res/assets -F framework-res.apk

  • Needed by apktool

  • TODO: Sign it?

doclava

Used to build the SDK docs, and also generate public API stubs for android.jar.
Upstream: https://code.google.com/archive/p/doclava/
Android fork's changes: https://android.googlesource.com/platform/external/doclava/+/android-6.0.1_r43/android-changes.txt
Built with gradle