TP 2: Android module¶
Instructions¶
- Subject tag:
TP2 - Deadline: 08/07/2018 23h42
Subject objectives¶
- Be able to use Android build system.
- Be able to write an Android makefile for a given project.
Subject¶
Add abootimg tool to AOSP source tree.
Note
For parts 1. to 3., you are allowed to bypass the review system.
Documentation:
- Lecture slides
- Google documentation:
1. Android sources setup¶
- CRI Android mirror:
git@git.cri.epita.net:sand/aosp/- Git repository name:
- module-manifest-<login>
Normally, you should have synced Android sources from CRI mirror, pointing to
android-8.1.0_r33.
However, on gerrit, you have your own manifest repository module-manifest.
On the side:
- Clone your Gerrit manifest repository.
- Fix your manifest so that:
- Your work must be based on
android-8.1.0_r33revision in a dedicated branchabootimg.aospremote must be set to CRI mirror. Do not forget the review URL.
In your sync directory:
- Reinitialize
repo. - Sync sources.
2. Add abootimg project in AOSP sources¶
- Git repository name:
- abootimg-<login>
From now on, you can work locally in your sync directory. In your manifest:
- Add a
sandremote correctly pointing to gerrit. - Add
abootimgproject.
Hint
Be careful where you put abootimg project in the source tree ! It does matter
(at least, for me) !
3. Write a dummy Android makefile¶
The objective is to translate the local Makefile into a very simple Android
makefile.
Your work must be available in a branch called aosp, bases on master.
- Create a
version.hheader file where the version must beaosp. - Write the Android makefile:
- You must respect the original makefile.
abootimgbinary must be built only for host.- Find which tag(s) you should apply to this Android module.
Hint
Do not forget to test abootimg binary: read the README file. You need a boot image. With lunch, choose a device and generated the image.
Question 1
What are the build commands you need for your development and tests ?
4. Write an advanced Android makefile¶
In the last part, I asked you to generate manually the version header. Now, the Android makefile must generate it by itself.
- Remove the
version.hfromabootimgsources. - Take a look to
LOCAL_GENERATED_SOURCESmacro. It will be your best friend.
Use Gerrit pull request system to submit your patches.