Passing "*" to --products is equivalent to passing the all_named_producs
build variable
Passing "*" to --modules passes the contents of
PRODUCT_OUT/all_modules.txt
The total length of the text of all_modules can easily exceed the
maximum argument size for the OS. The proper solution is likely to call
getconf ARG_MAX, then concatenate the command to be executed to check
against the limit. Instead, the modules are processed in batches of 40k
modules. As long as module names don't get extremely long, this should
keep us under the ARG_MAX limit. In testing, using --modules "*" gets
split into two batches.
Test: build/make/tools/whichgit --modules "*"
Test: build/make/tools/whichgit --modules "*" --unused
Test: build/make/tools/whichgit --modules "*" --products "*"
Existing use-cases should remain unchanged:
TEST: build/make/tools/whichgit --modules framework
Change-Id: Ifa947daea2d439df0145e6def92637b67a8b5d22
The --unused parameter inverts the output of whichgit, reporting which
git projects are not used for a given build target.
Test: build/make/tools/whichgit --unused
Test: build/make/tools/whichgit --unused --modules framework
Existing use-cases should remain unchanged:
Test: build/make/tools/whichgit --modules framework
Change-Id: Ia4e55a5cb0331d522fed76821fe813ef98c25a67