$ cd <project directory root>/kernel/goldfish $ ARCH=x86 make -j8 goldfish_defconfig $ ARCH=x86 make -j8
There are two types of total compilations.
The first, shall we call it Lazy Compilation, is the one you should preferably do, as it only compiles your recent modifications.
This option basically iterates through all AOSP's jars and recreates the ones that should contain your modified classes.
The second option, Thorough Compilation, is more time consuming, but it also helps you eliminate any doubts regarding whether or not your “bugs” really come from your code, or from conflicts with already compilled files.
This type of compilation should proceed as follows:
$ cd <project directory root> $ . build/envsetup.sh $ lunch 2
The envsetup.sh script will basically provide us a lot of useful commands we'll be using from now on.
For a complete list of commands provided by this script click here.
$ m
The m command will essentially make sure all jars containing all AOSP's classes get updated.
This type of compilation should proceed as follows:
$ cd <project directory root> $ . build/envsetup.sh $ lunch 2
The envsetup.sh script will basically provide us a lot of useful commands we'll be using from now on.
For a complete list of commands provided by this script click here.
$ m
The m
command will essentially make sure all jars containing all AOSP's classes get updated.
Most of the times we are interested in testing only small changes in our code.
Rebuilding the Middleware everytime we want to make those changes would be impractical.
Here are some tips on how to save time:
$ cd <project directory root> $ . build/envsetup.sh $ lunch 2
The envsetup.sh script will basically provide us a lot of useful commands we'll be using for now on.
For a complete list of commands provided by this script click here.
There are four commands you can use to compile your modified files.
Here we illustrate how to use all of them.
As an example we assume we made a change in the android.os.AsyncTask class and want to compile it.
The complete path to this file is: <project directory root>/frameworks/base/core/java/android/os/AsyncTask.java
$ cd <project directory root>/frameworks/base/core/java/android/os/ $ mm
The mm
command will essentially compile every file from this directory.
$ cd <project directory root>/frameworks/base/core/java/android/os/ $ mma
The mma
command will compile every file from this directory as well as their dependencies.
$ mmm <project directory root>/frameworks/base/core/java/android/os/
The mmm
command will essentially compile every file from the provided directory.
$ mmma <project directory root>/frameworks/base/core/java/android/os/
The mmma
command will compile every file from the provided directory as well as their dependencies.