platform_build_soong/cmd
Bill Peckham c087be1e8b Automate dependency on inputs of genrule module type.
This change automates one of the best practices for
custom tools. The best practice says "Prefer to list
input files on the command line, otherwise we may not
know to re-run your command when a new input file is
added." [1]

Normally you'd reference these inputs with $(in) or
one of the forms of the $(location*) substituions on
the command line for the custom tool. However, if the
custom tool does not accept the list of inputs on the
command line, the build system could fail to re-run
the custom tool if the list changes.

This change adds a hash of the list of input names to
the sbox command that wraps the custom tool. If the
list of inputs change, the hash will change, and
therefore the sbox command will change, causing ninja
to re-run the custom tool. The hash is visible to
(but ignored by) the sbox command, and hidden from
your custom tool.

[1] https://android.googlesource.com/platform/build/soong/+/refs/heads/master/docs/best_practices.md#custom-build-tools

Test: TestGenruleHashInputs
Bug: 149397658
Change-Id: I18b547ea3c4296ee15bd6150a4778a8f376d80b7
2020-02-19 12:47:35 -08:00
..
dep_fixer Rewrite depfile from sbox to stay reproducible 2019-08-29 14:47:40 -07:00
diff_target_files Rename product_services to system_ext 2019-07-09 08:57:05 +00:00
extract_jar_packages Regenerate R.java files from LOCAL_STATIC_ANDROID_LIBRARIES 2018-05-02 13:11:01 -07:00
extract_linker Rework how linux_bionic is built with LLD 2018-10-22 15:46:03 -07:00
fileslist fileslist: hash the content of symlink, not the file it points to. 2017-03-29 13:43:41 -07:00
host_bionic_inject Fix the host bionic linker check; add tests 2018-11-12 22:29:44 -08:00
javac_wrapper Silence trailing "1 warning" message from javac when warning is silenced 2019-11-11 21:48:33 +00:00
merge_zips If input zip file cannot opened, print its name. 2020-01-22 10:21:43 -08:00
multiproduct_kati Take into account RAM usage for multiproduct_kati 2019-12-27 09:54:11 -08:00
path_interposer Fix lint errors caught by go test 2018-07-16 15:24:43 -07:00
pom2bp Allow other module types in androidx 2019-07-22 13:18:48 -07:00
pom2mk Add -jetifier to pom2mk and pom2bp 2019-04-20 21:47:14 -07:00
sbox Automate dependency on inputs of genrule module type. 2020-02-19 12:47:35 -08:00
soong_build Allow debugging with SOONG_DELVE=<listen addr> 2019-07-03 16:33:31 -07:00
soong_env Fix package path of android/soong/android pctx 2019-04-04 03:59:34 +00:00
soong_ui Create a highmem pool and put metalava into it 2020-01-24 11:44:23 -08:00
zip2zip Keep directories when moving glob results 2018-11-01 20:34:44 +00:00
zipsync Refactor .aar resource compilation 2019-05-29 16:54:43 -07:00