1#!/bin/bash 2 3# locate some directories 4cd "$(dirname $0)" 5SCRIPT_DIR="${PWD}" 6cd ../.. 7TOP="${PWD}" 8 9message='The basic Android build process is: 10 11cd '"${TOP}"' 12source build/envsetup.sh # Add "lunch" (and other utilities and variables) 13 # to the shell environment. 14lunch [<product>-<variant>] # Choose the device to target. 15m [<goals>] # Execute the configured build. 16 17Usage of "m" imitates usage of the program "make". 18See '"${SCRIPT_DIR}"'/Usage.txt for more info about build usage and concepts. 19 20The parallelism of the build can be set with a -jN argument to "m". If you 21don'\''t provide a -j argument, the build system automatically selects a parallel 22task count that it thinks is optimal for your system. 23 24Common goals are: 25 26 clean (aka clobber) equivalent to rm -rf out/ 27 checkbuild Build every module defined in the source tree 28 droid Default target 29 nothing Do not build anything, just parse and validate the build structure 30 31 java Build all the java code in the source tree 32 native Build all the native code in the source tree 33 34 host Build all the host code (not to be run on a device) in the source tree 35 target Build all the target code (to be run on the device) in the source tree 36 37 (java|native)-(host|target) 38 (host|target)-(java|native) 39 Build the intersection of the two given arguments 40 41 snod Quickly rebuild the system image from built packages 42 Stands for "System, NO Dependencies" 43 vnod Quickly rebuild the vendor image from built packages 44 Stands for "Vendor, NO Dependencies" 45 pnod Quickly rebuild the product image from built packages 46 Stands for "Product, NO Dependencies" 47 senod Quickly rebuild the system_ext image from built packages 48 Stands for "SystemExt, NO Dependencies" 49 onod Quickly rebuild the odm image from built packages 50 Stands for "Odm, NO Dependencies" 51 vdnod Quickly rebuild the vendor_dlkm image from built packages 52 Stands for "VendorDlkm, NO Dependencies" 53 odnod Quickly rebuild the odm_dlkm image from built packages 54 Stands for "OdmDlkm, NO Dependencies" 55 56 57So, for example, you could run: 58 59cd '"${TOP}"' 60source build/envsetup.sh 61lunch aosp_arm-userdebug 62m -j java 63 64to build all of the java code for the userdebug variant of the aosp_arm device. 65' 66 67echo "$message" 68