Test: m <tab><tab> before having done a full build.
Test: m <tab><tab> after having done a full build.
Change-Id: I35154151e6902d0337a26eab27d9d4fc797beed7
An old TARGET_PRODUCT value pointing to a removed product or an invalid
TARGET_BUILD_VARIANT value cause lunch to fail to read
COMMON_LUNCH_CHOICES, clear them before calling into the build with
get_build_var.
Test: TARGET_PRODUCT=foobar TARGET_BUILD_VARIANT=foobar lunch
Change-Id: I53d205784149ba7e32cc093f9d81d1a82c08bfc0
Necessary since the products used for APEX modules are different in
internal builds.
Test: banchan com.android.art
Test: banchan com.android.art arm
Test: banchan com.android.art art_module_arm
Test: banchan com.android.art module_arm
Test: banchan com.android.art x86_64
Test: banchan com.android.art art_module_x86_64
Bug: 179779520
Change-Id: Ib59a86b70e409537aaad7258465b6874b589b858
It currently uses TARGET_BUILD_APPS just like tapas, but the use case is
different and it may diverge more in the future.
Test: banchan com.android.art
Test: banchan help
Test: banchan
Test: hmm
Bug: 179779520
Change-Id: Iae718e65a2a7212c741c397e03c6f9a6d5ee8951
New ktgrep is added and sgrep/treegrep also scan *.kt files.
Test: kgrep/sgrep/treegrep for Kotlin files.
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: Ie615aa86c4958310785392f18ee7bddaf64706a9
It will query module-info.json for modules inside a given directory.
Test: . build/envsetup.sh ; dirmods frameworks/base
Change-Id: Iad3dcb038315f49c156764e34fb5f52ec3ad29be
rgrep is a common alias for 'grep -r' and this new macro was confusing.
Test: cd external/rust/crates
rsgrep test
Change-Id: If71cdcc926455983a04a80982356e9feb61968fe
These are analogs to pathmod/gomod that find/install
the module's apk instead of cd'ing to its source
directory.
Bug: None
Change-Id: Iad750e154397f7cfcdd620f1ed6478b05c1225bb
Test: Manually, with bash and zsh
Some host tools (launch_cvd, etc.) have been using HOST_OUT.
As their dependencies are now installed by soong, the tools should refer
to SOONG_HOST_OUT. Export it as ANDROID_SOONG_HOST_OUT.
Bug: 172065015
Test: build aosp_cf_x86_phone, execute launch_cvd
Change-Id: Ie175049f15b89485feec0d33d82e756b12a7ad8a
Get a relative path to out by using $(get_build_var PRODUCT_OUT)
instead of hardcoding it to out/target/product/$TARGET_DEVICE.
That will correctly return the path to the out directory
when setting an external OUT_DIR_COMMON_BASE.
Change-Id: I8a990b710222bc72755c6b6b88fd0c9e80711e14
When sourcing the envsetup.sh script from a deep directory
inside of the repo, the vendorsetup.sh scripts are not being
sourced. This was causing the ANDROID_ENABLE_METRICS_UPLOAD
not to be set and developer's metrics were not being uploaded.
Provided the top directory to each directory path. Also cleaned
up the function to handle whitespacing correctly.
Bug: b/169699936
Test: *Ran source ../../build/envsetup.sh from external/libchrome dir
*Renamed repo dir to "aosp master" and source build/envsetup.sh
*Ran the script in zsh command line interpretor
*Ran the script in MacOS
Change-Id: I96eb73d50a1923cdda782792778b0d185a341cf9
oh-my-zsh common-aliases plugin defines `alias -g T='| tail'`, which causes an
error with the line `local T dir f`.
Making these lines more explicit resolves this issue, while also being clearer
that the intent is to clear out the local variables.
Bug: 169191000
Fix: 169191000
Test: source build/envsetup.sh; lunch <target>; m
Change-Id: Ief27aa3d9f541d0c39c6c11d7d771818d6493d31
This function:
- disables verity on the device
- reboots the device only if it is needed
- remounts partitions on the device
Bug: 167697453
Test: syswrite
Change-Id: I23c3e88daaa2b334233f4faf7fe8f8244cd56225
This is similar to the old `m showcommands`, but operates on specific
output paths instead and does not require a build aside from the
initial invocation of soong to generate the ninja files. The
`--regenerate` option is accepted that causes the ninja file to be
regenerated first, but this is not the default because it is slow.
Just note that without this flag results may be stale.
It unfortunately doesn't work for everything in out. For example,
`$OUT/system/lib/libc.so` won't work because it is a symlink that
isn't in the build graph, but `$OUT/system/lib/bootstrap/libc.so`
works.
Test: showcommands out/target/product/walleye/system/lib/libz.so
Bug: None
Change-Id: I4cfded3db994044870fc71ae4bcf9a69224b1e15
This reverts commit d92718356d.
Reason for revert: Adding the opening brace to the end of the function breaks lunch.
Change-Id: Ia3a9ff01964de0e616a534058d568150de32558a
This also affects pathmod here.
Since it's updating module-info.json, we could say that as well (this
should affect any tools which parse this file), but I haven't seen any
indication it's necessary in this context.
Bug: N/A
Test: N/A
Change-Id: Iecb6f454112b5c0095ee7063bc5442fdb1e3bd09
In some environments (e.g. with the master-art branch), the default
product (aosp_arm-eng) cannot be built, and thus prevents `lunch` from
printing the lunch menu (as it cannot initialize the build system in
order to fetch the common lunch choices). When this happens, show an
explicit error message from `lunch` instead of a Soong UI error.
Test: Check that this command line displays the expected error message:
unset TARGET_PRODUCT && . build/envsetup.sh && lunch
Bug: 152762648
Change-Id: I40c66bca5b075d88dbc8364b36b2db713e6ad93e
Make it explicit that we will build *and* install all the modules under
the directories. And that 'mm[m]' is now the same as 'mm[m][a]'.
Test: hmm
Change-Id: I86c42229f8cdc24922fb3014777ad13d72a1c0ea
zsh doesn't split variables (by default), but it will split command
output. bash will split both. Apparently a portable way to do this in
both is to just turn it into another command: "$(echo $var)".
Test: source build/envsetup.sh; lunch (see list; repeat in bash and zsh)
Change-Id: I9716a8d77aefdf05da8923deb9e37e0b6132b549
Arrays are zero indexed in bash and one indexed in zsh by default. This
leads to an off-by-one issue in the `godir` and `choosevariant` commands: when
prompted to chose an option, in order to pick option "n" you have to input
"n+1".
In those two specific instances, by using "substring expansion" instead of
array indexing, one can get consistent behaviour between bash and zsh
(equivalent to zero indexing).
Test: manual -
# godir
$ zsh
$ source build/envsetup.sh
$ godir SurfaceFlinger # There should be many options
# Pick 1, check that you end up in the right location
$ godir SurfaceFlinger.cpp # There should be only one possibility
# make sure you end up in the right location
# repeat with bash (to ensure compatibility is not broken)
# choosevariant
$ zsh
$ source build/envsetup.h
$ choosevariant # pick whatever variant you want
$ printconfig # make sure the variant matches your choice
# repeat with bash (to ensure compatibility is not broken)
Change-Id: I998d8fb48b708066b6db28a2129a2b09785fb0b1
Right now, leaks are disabled globally on host. This is problematic
because:
a). people write leaks in new code
b). if we fix leaks in old code, it doesn't get tested
c). fixing leaks in old code is harder because when we set
ASAN_OPTIONS="" locally, other targets start hitting errors,
and we have to set __asan_default_options there
Fixes: 141313466
Test: host ASAN build passes
Change-Id: I89298c7518c016e6a30884c75d7b791db16a5217
Get the lunch choices before starting to print the lunch menu prompt
so that it doesn't sit at `Lunch menu... pick a combo:` with no
choices for a few seconds.
Fixes: 138719635
Test: lunch
Change-Id: I2bb373ec037bff0ab1d7e4f5ff8a8bd3b57f3263
Currently when switching between internal to aosp, PYTHONPATH will be
contaminated. This CL is to ensure PYTHONPATH will be as clean as
opening a new terminal and source/lunch.
Bug: 121106770
Test: internal:
$ source build/envsetup.sh; lunch; echo $PYTHONPATH| sed 's/:/\n/g'
will see VENDOR_PYTHONPATH in PYTHONPATH.
switch to aosp:
$ source build/envsetup.sh; lunch; echo $PYTHONPATH| sed 's/:/\n/g'
won't see VENDOR_PYTHONPATH in PYTHONPATH.
Change-Id: Id1916673000ee3fad55e9611d0c47cc80de86645
Fix this error:
rprichard@cashew:/x/aosp/out/target/product/walleye/system/bin$ ls
bash: ./ls: cannot execute binary file: Exec format error
Bug: none
Test: lunch a target, "echo $PATH | grep ::"
Test: lunch an arm target, cd $OUT/system/bin, ls (
Change-Id: I2c0d5ece85964dffa14d6ac8df168dd4e733162e
This reverts commit 610b6302cf.
Reason for revert: m mlibc from root dir works. Create a tmp dir and then cd in to tmp. Run the same command and it fails.
Change-Id: I0f0c056d7e668da621ae99d347a055ecdf2dec07
The functionality of m* envsetup.sh commands has been implemented in
soong_ui. The bash functionality of m* commands can be replaced by
soong's modules-in* build commands.
Fixes: b/130049705
Test: * Loaded the envsetup.sh on a new environment
* Executed each m* command.
* Verified with "type <build command>" to make sure
the function generation is correct.
* Ran on Darwin environment.
Change-Id: I8792e4f1f1727aba2ca6ee4bdfe657f6ac42302a