| Jeff Gaston | c6dfc4e | 2017-05-30 17:12:37 -0700 | [diff] [blame] | 1 | #!/bin/bash | 
|  | 2 |  | 
|  | 3 | # locate some directories | 
|  | 4 | cd "$(dirname $0)" | 
|  | 5 | SCRIPT_DIR="${PWD}" | 
|  | 6 | cd ../.. | 
|  | 7 | TOP="${PWD}" | 
|  | 8 |  | 
|  | 9 | message='The basic Android build process is: | 
|  | 10 |  | 
|  | 11 | cd '"${TOP}"' | 
|  | 12 | source build/envsetup.sh    # Add "lunch" (and other utilities and variables) | 
|  | 13 | # to the shell environment. | 
|  | 14 | lunch [<product>-<variant>] # Choose the device to target. | 
|  | 15 | m -j [<goals>]              # Execute the configured build. | 
|  | 16 |  | 
|  | 17 | Usage of "m" imitates usage of the program "make". | 
| Dan Willemsen | 7733862 | 2017-11-08 16:39:18 -0800 | [diff] [blame] | 18 | See '"${SCRIPT_DIR}"'/Usage.txt for more info about build usage and concepts. | 
| Jeff Gaston | c6dfc4e | 2017-05-30 17:12:37 -0700 | [diff] [blame] | 19 |  | 
|  | 20 | Common goals are: | 
|  | 21 |  | 
|  | 22 | clean                   (aka clobber) equivalent to rm -rf out/ | 
|  | 23 | checkbuild              Build every module defined in the source tree | 
|  | 24 | droid                   Default target | 
|  | 25 | nothing                 Do not build anything, just parse and validate the build structure | 
|  | 26 |  | 
|  | 27 | java                    Build all the java code in the source tree | 
|  | 28 | native                  Build all the native code in the source tree | 
|  | 29 |  | 
|  | 30 | host                    Build all the host code (not to be run on a device) in the source tree | 
|  | 31 | target                  Build all the target code (to be run on the device) in the source tree | 
|  | 32 |  | 
|  | 33 | (java|native)-(host|target) | 
|  | 34 | (host|target)-(java|native) | 
|  | 35 | Build the intersection of the two given arguments | 
|  | 36 |  | 
|  | 37 | snod                    Quickly rebuild the system image from built packages | 
|  | 38 | Stands for "System, NO Dependencies" | 
|  | 39 | vnod                    Quickly rebuild the vendor image from built packages | 
|  | 40 | Stands for "Vendor, NO Dependencies" | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 41 | pnod                    Quickly rebuild the product image from built packages | 
|  | 42 | Stands for "Product, NO Dependencies" | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 43 | psnod                   Quickly rebuild the product-services image from built packages | 
|  | 44 | Stands for "ProductServices, NO Dependencies" | 
| Jeff Gaston | c6dfc4e | 2017-05-30 17:12:37 -0700 | [diff] [blame] | 45 |  | 
|  | 46 |  | 
|  | 47 | So, for example, you could run: | 
|  | 48 |  | 
|  | 49 | cd '"${TOP}"' | 
|  | 50 | source build/envsetup.sh | 
|  | 51 | lunch aosp_arm-userdebug | 
|  | 52 | m -j java | 
|  | 53 |  | 
|  | 54 | to build all of the java code for the userdebug variant of the aosp_arm device. | 
|  | 55 | ' | 
|  | 56 |  | 
|  | 57 | echo "$message" |