Lines Matching +full:ninja +full:- +full:linux
7 - lunch: lunch <product_name>-<build_variant>
11 - tapas: tapas [<App1> <App2> ...] [arm|x86|arm64|x86_64] [eng|userdebug|user]
13 - banchan: banchan <module1> [<module2> ...] [arm|x86|arm64|x86_64] [eng|userdebug|user]
15 - croot: Changes directory to the top of the tree, or a subdirectory thereof.
16 - m: Makes from the top of the tree.
17 - mm: Builds and installs all of the modules in the current directory, and their
19 - mmm: Builds and installs all of the modules in the supplied directories, and their
22 - mma: Same as 'mm'
23 - mmma: Same as 'mmm'
24 - provision: Flash device with all required partitions. Options will be passed on to fastboot.
25 - cgrep: Greps on all local C/C++ files.
26 - ggrep: Greps on all local Gradle files.
27 - gogrep: Greps on all local Go files.
28 - jgrep: Greps on all local Java files.
29 - ktgrep: Greps on all local Kotlin files.
30 - resgrep: Greps on all local res/*.xml files.
31 - mangrep: Greps on all local AndroidManifest.xml files.
32 - mgrep: Greps on all local Makefiles and *.bp files.
33 - owngrep: Greps on all local OWNERS files.
34 - rsgrep: Greps on all local Rust files.
35 - sepgrep: Greps on all local sepolicy files.
36 - sgrep: Greps on all local source files.
37 - godir: Go to the directory containing a file.
38 - allmod: List all modules.
39 - gomod: Go to the directory containing a module.
40 - pathmod: Get the directory containing a module.
41 - outmod: Gets the location of a module's installed outputs with a certain extension.
42 - dirmods: Gets the modules defined in a given directory.
43 - installmod: Adb installs a module's built APK.
44 - refreshmod: Refresh list of modules for allmod/gomod/pathmod/outmod/installmod.
45 - syswrite: Remount partitions (e.g. system.img) as writable, rebooting if necessary.
48 - SANITIZE_HOST: Set to 'address' to use ASAN for all host modules.
49 - ANDROID_QUIET_BUILD: set to 'true' to display only the essential messages.
56 …for i in `cat $T/build/envsetup.sh | sed -n "/^[[:blank:]]*function /s/function \([a-z_]*\).*/\1/p…
67 …()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/get_build_var/) print $(i+1)}' | sort -u | tr '\n' ' '`)
68 …' ' | awk '{for(i=1;i<=NF;i++) if($i~/get_abs_build_var/) print $(i+1)}' | sort -u | tr '\n' ' '`)
70 build_dicts_script=`\builtin cd $T; build/soong/soong_ui.bash --dumpvars-mode \
71 --vars="${cached_vars[*]}" \
72 --abs-vars="${cached_abs_vars[*]}" \
73 --var-prefix=var_cache_ \
74 --abs-var-prefix=abs_var_cache_`
76 if [ $ret -ne 0 ]
85 if [ $ret -ne 0 ]
122 (\cd $T; build/soong/soong_ui.bash --dumpvar-mode --abs $1)
139 (\cd $T; build/soong/soong_ui.bash --dumpvar-mode $1)
197 if [ -n "$ANDROID_BUILD_PATHS" ] ; then
200 if [ -n "$ANDROID_PRE_BUILD_PATHS" ] ; then
221 x86) toolchaindir=x86/x86_64-linux-android-$targetgccversion/bin
223 x86_64) toolchaindir=x86/x86_64-linux-android-$targetgccversion/bin
225 arm) toolchaindir=arm/arm-linux-androideabi-$targetgccversion/bin
227 arm64) toolchaindir=aarch64/aarch64-linux-android-$targetgccversion/bin;
228 toolchaindir2=arm/arm-linux-androideabi-$targetgccversion2/bin
235 if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
239 if [ "$toolchaindir2" -a -d "$gccprebuiltdir/$toolchaindir2" ]; then
246 case $(uname -s) in
247 Linux)
248 …DROID_DEV_SCRIPTS=$ANDROID_DEV_SCRIPTS:$T/prebuilts/misc/linux-x86/dtc:$T/prebuilts/misc/linux-x86…
255 if [ -n "$ANDROID_TOOLCHAIN_2ND_ARCH" ]; then
261 local ANDROID_LLVM_BINUTILS=$(get_abs_build_var ANDROID_CLANG_PREBUILTS)/llvm-binutils-stable
265 export ASAN_SYMBOLIZER_PATH=$ANDROID_LLVM_BINUTILS/llvm-symbolizer
267 # If prebuilts/android-emulator/<system>/ exists, prepend it to our PATH
269 case $(uname -s) in
271 ANDROID_EMULATOR_PREBUILTS=$T/prebuilts/android-emulator/darwin-x86_64
273 Linux)
274 ANDROID_EMULATOR_PREBUILTS=$T/prebuilts/android-emulator/linux-x86_64
280 if [ -n "$ANDROID_EMULATOR_PREBUILTS" -a -d "$ANDROID_EMULATOR_PREBUILTS" ]; then
295 if [ -n $ANDROID_PYTHONPATH ]; then
299 export ANDROID_PYTHONPATH=$T/development/python-packages:
300 if [ -n $VENDOR_PYTHONPATH ]; then
327 # needed for building linux on MacOS
329 #export HOST_EXTRACFLAGS="-I "$T/system/kernel_headers/host_include
389 if [ -z "$BASH_VERSION" -a -z "$ZSH_VERSION" ]; then
394 if [ -n "$BASH_VERSION" -a ${BASH_VERSINFO[0]} -lt 3 ]; then
403 # Completion can be disabled selectively to allow users to use non-standard completion.
405 # ENVSETUP_NO_COMPLETION=adb # -> disable adb completion
406 # ENVSETUP_NO_COMPLETION=adb:bit # -> disable adb and bit completion
408 if [ -f "$f" ] && should_add_completion "$f"; then
414 complete -C "bit --tab" bit
416 if [ -z "$ZSH_VERSION" ]; then
418 complete -o nospace -F _croot croot
420 complete -F _lunch lunch
422 complete -F _complete_android_module_names pathmod
423 complete -F _complete_android_module_names gomod
424 complete -F _complete_android_module_names outmod
425 complete -F _complete_android_module_names installmod
426 complete -F _complete_android_module_names m
442 while [ -z $TARGET_BUILD_TYPE ]
444 echo -n "Which would you like? ["$DEFAULT_NUM"] "
445 if [ -z "$1" ] ; then
473 if [ -n "$1" ] ; then
501 while [ -z "$TARGET_PRODUCT" ]
503 echo -n "Which product would you like? [$default_value] "
504 if [ -z "$1" ] ; then
511 if [ -z "$ANSWER" ] ; then
521 if [ -n "$1" ] ; then
548 while [ -z "$TARGET_BUILD_VARIANT" ]
550 echo -n "Which would you like? [$default_value] "
551 if [ -z "$1" ] ; then
558 if [ -z "$ANSWER" ] ; then
560 elif (echo -n $ANSWER | grep -q -e "^[0-9][0-9]*$") ; then
561 if [ "$ANSWER" -le "${#VARIANT_CHOICES[@]}" ] ; then
562 export TARGET_BUILD_VARIANT=${VARIANT_CHOICES[@]:$(($ANSWER-1)):1}
572 if [ -n "$1" ] ; then
599 if [ -n "$ZSH_VERSION" ]; then
600 echo -n "${funcfiletrace[1]}: "
602 echo -n "${BASH_SOURCE[1]}:${BASH_LINENO[0]}: "
618 if [ $ret -ne 0 ]
646 if [[ $# -gt 1 ]]; then
655 echo -n "Which would you like? [aosp_arm-eng] "
661 if [ -z "$answer" ]
663 selection=aosp_arm-eng
664 elif (echo -n $answer | grep -q -e "^[0-9][0-9]*$")
667 if [ $answer -le ${#choices[@]} ]
670 if [ -n "$ZSH_VERSION" ]
674 selection=${choices[$(($answer-1))]}
684 product=${selection%%-*} # Trim everything after first dash
685 variant_and_version=${selection#*-} # Trim everything up to first dash
687 variant=${variant_and_version%%-*}
689 version=${variant_and_version#*-}
693 if [ -z "$product" ]
704 if [ $? -ne 0 ]
710 if [ -n "$version" ]; then
717 [[ -n "${ANDROID_QUIET_BUILD:-}" ]] || echo
720 [[ -n "${ANDROID_QUIET_BUILD:-}" ]] || printconfig
731 prev="${COMP_WORDS[COMP_CWORD-1]}"
733 if [ -z "$COMMON_LUNCH_CHOICES_CACHE" ]; then
737 COMPREPLY=( $(compgen -W "${COMMON_LUNCH_CHOICES_CACHE}" -- ${cur}) )
745 local showHelp="$(echo $* | xargs -n 1 echo | \grep -E '^(help)$' | xargs)"
746 local arch="$(echo $* | xargs -n 1 echo | \grep -E '^(arm|x86|arm64|x86_64)$' | xargs)"
747 local variant="$(echo $* | xargs -n 1 echo | \grep -E '^(user|userdebug|eng)$' | xargs)"
748 …local density="$(echo $* | xargs -n 1 echo | \grep -E '^(ldpi|mdpi|tvdpi|hdpi|xhdpi|xxhdpi|xxxhdpi…
749 …local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|arm|x86|arm64|x86_64|l…
756 if [ $(echo $arch | wc -w) -gt 1 ]; then
760 if [ $(echo $variant | wc -w) -gt 1 ]; then
764 if [ $(echo $density | wc -w) -gt 1 ]; then
775 if [ -z "$variant" ]; then
778 if [ -z "$apps" ]; then
781 if [ -z "$density" ]; then
801 local showHelp="$(echo $* | xargs -n 1 echo | \grep -E '^(help)$' | xargs)"
802 local product="$(echo $* | xargs -n 1 echo | \grep -E '^(.*_)?(arm|x86|arm64|x86_64)$' | xargs)"
803 local variant="$(echo $* | xargs -n 1 echo | \grep -E '^(user|userdebug|eng)$' | xargs)"
804 …local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|(.*_)?(arm|x86|arm64|x…
811 if [ -z "$product" ]; then
813 elif [ $(echo $product | wc -w) -gt 1 ]; then
817 if [ $(echo $variant | wc -w) -gt 1 ]; then
821 if [ -z "$apps" ]; then
832 if [ -z "$variant" ]; then
854 if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ] ; then
858 if [ -f $TOPFILE ] ; then
866 while [ \( ! \( -f $TOPFILE \) \) -a \( "$PWD" != "/" \) ]; do
868 T=`PWD= /bin/pwd -P`
871 if [ -f "$T/$TOPFILE" ]; then
898 for c in $(compgen -d ${T}/${cur}); do
909 while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
911 if [ -f "$T/Android.mk" ]; then
926 if [ "$1" = "--exact" ]; then
930 elif [ "$1" = "--help" -o "$1" = "-h" ]; then
931 echo "usage: qpid [[--exact] <process name|pid>"
940 | tr -d '\r' \
941 | sed -e 1d -e 's/^[^ ]* *\([0-9]*\).* \([^ ]*\)$/\1 \2/'
945 # syswrite - disable verity, reboot if needed, and remount image
949 adb wait-for-device && adb root || return 1
950 if [[ $(adb disable-verity | grep "reboot") ]]; then
952 adb reboot && adb wait-for-device && adb root || return 1
954 adb wait-for-device && adb remount || return 1
957 # coredump_setup - enable core dumps globally for any process
958 # that has the core-file-size limit set correctly
961 # if its core-file-size limit is not set already.
968 adb wait-for-device;
970 echo "Remounting root partition read-write...";
971 adb shell mount -w -o remount -t rootfs rootfs;
973 adb wait-for-device;
974 adb shell mkdir -p /cores;
975 adb shell mount -t tmpfs tmpfs /cores;
979 adb shell restorecon -R /cores;
987 # coredump_enable - enable core dumps for the specified process
996 if [ -z "$PID" ]; then
1001 adb shell /system/bin/ulimit -p $PID -c unlimited
1004 # core - send SIGV and pull the core for process
1014 if [ -z "$PID" ]; then
1026 while [ $(adb shell "[ -d /proc/$PID ] && echo -n yes") ]; do
1028 adb shell kill -$SIG $PID;
1032 …adb shell "while [ ! -f $COREPATH ] ; do echo waiting for $COREPATH to be generated; sleep 1; done"
1036 # systemstack - dump the current stack trace of all threads in the system process
1044 # 64-bit.
1049 if [[ "$(adb shell cat /proc/$PID/exe | xxd -l 1 -s 4 -p)" -eq "02" ]] ; then
1059 case `uname -s` in
1063 …find -E . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.(c|h|cc|cpp|hpp|S|java|…
1064 -exec grep --color -n "$@" {} +
1071 …find . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.\(c\|h\|cc\|cpp\|hpp\|S\|j…
1072 -exec grep --color -n "$@" {} +
1084 … find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.gradle" \
1085 -exec grep --color -n "$@" {} +
1090 find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.go" \
1091 -exec grep --color -n "$@" {} +
1096 find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.java" \
1097 -exec grep --color -n "$@" {} +
1102 find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.rs" \
1103 -exec grep --color -n "$@" {} +
1108 find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.kt" \
1109 -exec grep --color -n "$@" {} +
1114 …find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f \( -name '*.c' -o -n…
1115 -exec grep --color -n "$@" {} +
1121 …for dir in `find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -name res -type …
1122 find $dir -type f -name '*\.xml' -exec grep --color -n "$@" {} +
1128 …find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o -type f -name 'AndroidMani…
1129 -exec grep --color -n "$@" {} +
1134 find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o -type f -name 'OWNERS' \
1135 -exec grep --color -n "$@" {} +
1140 find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o -name sepolicy -type d \
1141 -exec grep --color -n -r --exclude-dir=\.git "$@" {} +
1146 find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.rc*" \
1147 -exec grep --color -n "$@" {} +
1150 case `uname -s` in
1154 …-E . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o \( -iregex '.*/(Makefile|Mak…
1155 -exec grep --color -n "$@" {} +
1160 …find -E . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.(c|h|cpp|hpp|S|java|kt|x…
1161 -exec grep --color -n -i "$@" {} +
1168 …-name .repo -prune -o -name .git -prune -o -path ./out -prune -o \( -regextype posix-egrep -iregex…
1169 -exec grep --color -n "$@" {} +
1174 …find . -name .repo -prune -o -name .git -prune -o -regextype posix-egrep -iregex '.*\.(c|h|cpp|hpp…
1175 -exec grep --color -n -i "$@" {} +
1195 local KERNEL=$T/prebuilts/qemu-kernel/$arch/vmlinux-qemu
1203 if [ ! -r "$KERNEL" ] ; then
1213 echo "post-processing traces..."
1214 rm -f $TRACE/qtrace.dexlist
1216 if [ $? -ne 0 ]; then
1225 q2dm -r $ANDROID_PRODUCT_OUT/symbols $TRACE $KERNEL $TRACE/dmtrace || return
1227 dmtracedump -h $TRACE/dmtrace >| $TRACE/dmtrace.html || return
1239 if [ "$1" = "-d" -o "$1" = "-e" ]; then
1242 elif [ "$1" = "-s" ]; then
1253 echo "Usage: runhat [ -d | -e | -s serial ] target-pid"
1258 if [ -z $(which hat) ]; then
1264 local devFile=/data/local/tmp/hprof-$targetPid
1269 echo -n "> "
1272 local localFile=/tmp/$$-hprof
1282 hat -JXmx512m $localFile
1287 local reports=(`adb shell ls /sdcard/bugreports | tr -d '\r'`)
1305 adb ${adbOptions} shell echo -n \$\{EXTERNAL_STORAGE\}
1316 …ptions} ls ${screenshot_path} | grep Screenshot_[0-9-]*.*\.png | sort -rk 3 | cut -d " " -f 4 | he…
1328 if [ $# -gt 0 ]; then
1376 adb shell am instrument -w com.android.smoketest.tests/android.test.InstrumentationTestRunner
1391 if [[ -z "$1" ]]; then
1398 mkdir -p $OUT_DIR
1403 if [[ ! -f $FILELIST ]]; then
1404 echo -n "Creating index..."
1405 (\cd $T; find . -wholename ./out -prune -o -wholename ./.repo -prune -o -type f > $FILELIST)
1410 lines=($(\grep "$1" $FILELIST | sed -e 's/\/[^/]*$//' | sort | uniq))
1418 while [[ -z "$pathname" ]]; do
1426 echo -n "Select one: "
1429 if [[ $choice -gt ${#lines[@]} || $choice -lt 1 ]]; then
1433 pathname=${lines[@]:$(($choice-1)):1}
1441 # Update module-info.json in out.
1448 …echo "Refreshing modules (building module-info.json). Log at $ANDROID_PRODUCT_OUT/module-info.json…
1451 mkdir -p $ANDROID_PRODUCT_OUT || return 1
1454 m $(get_build_var PRODUCT_OUT)/module-info.json \
1455 > $ANDROID_PRODUCT_OUT/module-info.json.build.log 2>&1
1458 # Verifies that module-info.txt exists, creating it if it doesn't.
1467 if [ ! -f "$ANDROID_PRODUCT_OUT/module-info.json" ]; then
1469 …echo "Could not find module-info.json. It will only be built once, and it can be updated with 'ref…
1475 # List all modules for the current device, as cached in module-info.json. If any build change is
1480 …python3 -c "import json; print('\n'.join(sorted(json.load(open('$ANDROID_PRODUCT_OUT/module-info.j…
1483 # Get the path of a specific module in the android tree, as cached in module-info.json.
1487 if [[ $# -ne 1 ]]; then
1494 local relpath=$(python3 -c "import json, os
1496 module_info = json.load(open('$ANDROID_PRODUCT_OUT/module-info.json'))
1501 if [ -z "$relpath" ]; then
1509 # Get the path of a specific module in the android tree, as cached in module-info.json.
1513 if [[ $# -ne 1 ]]; then
1520 python3 -c "import json, os
1523 dir = dir[:-1]
1525 module_info = json.load(open('$ANDROID_PRODUCT_OUT/module-info.json'))
1539 # Go to a specific module in the android tree, as cached in module-info.json. If any build change
1542 if [[ $# -ne 1 ]]; then
1548 if [ -z "$path" ]; then
1554 # Gets the list of a module's installed outputs, as cached in module-info.json.
1557 if [[ $# -ne 1 ]]; then
1565 relpath=$(python3 -c "import json, os
1567 module_info = json.load(open('$ANDROID_PRODUCT_OUT/module-info.json'))
1573 if [ $? -ne 0 ]; then
1576 elif [ ! -z "$relpath" ]; then
1581 # adb install a module's apk, as cached in module-info.json. If any build change
1584 # For example: installmod -r Dialer -> adb install -r /path/to/Dialer.apk
1586 if [[ $# -eq 0 ]]; then
1593 if [ $? -ne 0 ]; then
1597 _path=$(echo "$_path" | grep -E \\.apk$ | head -n 1)
1598 if [ -z "$_path" ]; then
1602 local length=$(( $# - 1 ))
1609 COMPREPLY=( $(QUIET_VERIFYMODINFO=true allmod | grep -E "^$word") )
1616 if [ $retval -ne 0 ]
1628 if [ -f build/soong/soong_ui.bash ]; then
1629 # Always use the real make if -C is passed in
1631 if [[ $arg == -C* ]]; then
1636 echo build/soong/soong_ui.bash --make-mode
1644 if [[ "${ANDROID_QUIET_BUILD:-}" == true ]]; then
1652 local tdiff=$(($end_time-$start_time))
1657 if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then
1667 if [ $ret -eq 0 ] ; then
1668 echo -n "${color_success}#### build completed successfully "
1670 echo -n "${color_failed}#### failed to build some targets "
1672 if [ $hours -gt 0 ] ; then
1674 elif [ $mins -gt 0 ] ; then
1676 elif [ $secs -gt 0 ] ; then
1686 local -r bc="$1"; shift
1688 _wrap_build "$T/build/soong/soong_ui.bash" --build-mode --${bc} --dir="$(pwd)" "$@"
1696 _trigger_build "all-modules" "$@"
1701 _trigger_build "modules-in-a-dir-no-deps" "$@"
1706 _trigger_build "modules-in-dirs-no-deps" "$@"
1711 _trigger_build "modules-in-a-dir" "$@"
1716 _trigger_build "modules-in-dirs" "$@"
1730 if [ ! -e "$ANDROID_PRODUCT_OUT/provision-device" ]; then
1736 if [ "$1" = "--no-confirmation" ]; then
1743 echo -n "Are you sure you want to do this (yes/no)? "
1750 "$ANDROID_PRODUCT_OUT/provision-device" "$@"
1753 # Zsh needs bashcompinit called to support bash-style completion.
1755 # Don't override user's options if bash-style completion is already enabled.
1756 if ! declare -f complete >/dev/null; then
1757 autoload -U compinit && compinit
1758 autoload -U bashcompinit && bashcompinit
1763 local current_sh="$(ps -o command -p $$)"
1766 function check_type() { type -t "$1"; }
1772 …echo -e "WARNING: Only bash and zsh are supported.\nUse of other shell would lead to erroneous res…
1778 # Unless we find an allowed-vendorsetup_sh-files file, in which case we'll only
1786 …for f in $(cd "$T" && find -L device vendor product -maxdepth 4 -name 'allowed-vendorsetup_sh-file…
1787 if [ -n "$allowed" ]; then
1788 …echo "More than one 'allowed_vendorsetup_sh-files' file found, not including any vendorsetup.sh fi…
1797 [ -n "$allowed" ] && allowed_files=$(cat "$allowed")
1799 for f in $(cd "$T" && test -d $dir && \
1800 find -L $dir -maxdepth 4 -name 'vendorsetup.sh' 2>/dev/null | sort); do
1802 if [[ -z "$allowed" || "$allowed_files" =~ $f ]]; then
1813 if [[ -z "$TARGET_PRODUCT" ]]; then
1817 case $(uname -s) in
1819 PREBUILT_NAME=darwin-x86
1821 Linux)
1822 PREBUILT_NAME=linux-x86
1825 >&2 echo Unknown host $(uname -s)
1829 if [[ -z "$OUT_DIR" ]]; then
1830 if [[ -z "$OUT_DIR_COMMON_BASE" ]]; then
1836 if [[ "$1" == "--regenerate" ]]; then
1838 NINJA_ARGS="-t commands $@" m
1840 (cd $T && prebuilts/build-tools/$PREBUILT_NAME/bin/ninja \
1841 -f $OUT_DIR/combined-${TARGET_PRODUCT}.ninja \
1842 -t commands "$@")