blob: c3d60fa4db59c3be87c3e54c9ef5345384ed699c [file] [log] [blame]
Joe Onorato9a0a2fc2024-05-17 12:31:06 -07001#!/bin/bash
2
3# Copyright (C) 2022 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17cat <<EOF
18
19Run "m help" for help with the build system itself.
20
21Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
22- lunch: lunch <product_name>-<release_type>-<build_variant>
23 Selects <product_name> as the product to build, and <build_variant> as the variant to
24 build, and stores those selections in the environment to be read by subsequent
25 invocations of 'm' etc.
26- tapas: tapas [<App1> <App2> ...] [arm|x86|arm64|x86_64] [eng|userdebug|user]
27 Sets up the build environment for building unbundled apps (APKs).
28- banchan: banchan <module1> [<module2> ...] \\
29 [arm|x86|arm64|riscv64|x86_64|arm64_only|x86_64only] [eng|userdebug|user]
30 Sets up the build environment for building unbundled modules (APEXes).
31- croot: Changes directory to the top of the tree, or a subdirectory thereof.
32- m: Makes from the top of the tree.
33- mm: Builds and installs all of the modules in the current directory, and their
34 dependencies.
35- mmm: Builds and installs all of the modules in the supplied directories, and their
36 dependencies.
37 To limit the modules being built use the syntax: mmm dir/:target1,target2.
38- mma: Same as 'mm'
39- mmma: Same as 'mmm'
40- provision: Flash device with all required partitions. Options will be passed on to fastboot.
41- cgrep: Greps on all local C/C++ files.
42- ggrep: Greps on all local Gradle files.
43- gogrep: Greps on all local Go files.
44- jgrep: Greps on all local Java files.
45- jsongrep: Greps on all local Json files.
46- ktgrep: Greps on all local Kotlin files.
47- resgrep: Greps on all local res/*.xml files.
48- mangrep: Greps on all local AndroidManifest.xml files.
49- mgrep: Greps on all local Makefiles and *.bp files.
50- owngrep: Greps on all local OWNERS files.
51- rsgrep: Greps on all local Rust files.
52- sepgrep: Greps on all local sepolicy files.
53- sgrep: Greps on all local source files.
54- tomlgrep: Greps on all local Toml files.
55- pygrep: Greps on all local Python files.
56- godir: Go to the directory containing a file.
57- allmod: List all modules.
58- gomod: Go to the directory containing a module.
59- bmod: Get the Bazel label of a Soong module if it is converted with bp2build.
60- pathmod: Get the directory containing a module.
61- outmod: Gets the location of a module's installed outputs with a certain extension.
62- dirmods: Gets the modules defined in a given directory.
63- installmod: Adb installs a module's built APK.
64- refreshmod: Refresh list of modules for allmod/gomod/pathmod/outmod/installmod.
65- syswrite: Remount partitions (e.g. system.img) as writable, rebooting if necessary.
66
67Environment options:
68- SANITIZE_HOST: Set to 'address' to use ASAN for all host modules.
69- ANDROID_QUIET_BUILD: set to 'true' to display only the essential messages.
70
71Look at build/make/envsetup for more functions:
72EOF
73 local T=$(gettop)
74 local A=""
75 local i
76 for i in `(cat $T/build/envsetup.sh | sed -n "/^[[:blank:]]*function /s/function \([a-z]*\).*/\1/p" | sort | uniq`; do
77 A="$A $i"
78 done
79 echo $A