platform_build_soong/scripts
Cole Faust 8d47c48082 Use soong's finder to find included makefiles in mk2rbc
Having soong generate a list of makefiles for mk2rbc
to look through is much faster than having mk2rbc search
itself. Profiling the readLinesFromeFile() function that
reads the list of makefiles shows it takes on the order
of 200 microseconds, much faster than the ~5 seconds
it takes for mk2rbc to search the tree itself.

This CL also allows include statements that are prefixed
with a variable. The concern with this was that there
would be a lot of load statemnts emitted for generic
include statements, causing the generated code to look
ugly, and converting and loading all those files could
cause performance issues. On the performance issues
front, there's already a check that it doesn't result
in over 150 potentially included files. We can lower
that number if necessary, but it's probably good for now.
On the generated code front, while it's true that it's
ugly, it's better to have working but ugly generated
code than refusing to generate anything working at all.

To ensure the soong finder step isn't slowed down due
to having to find a bunch of new makefiles, I profiled
the combination of newSourceFinder and FindSources in main.go:

Baseline incremental:
338.011634ms
340.853335ms
348.541762ms
333.229644ms
349.124824ms

Baseline clean:
1.003836419s
1.006203912s
996.193648ms
1.031005604s
1.03691152s

Modified incremental:
349.029285ms
349.264496ms
351.774948ms
337.63187ms
359.425306ms

Modified clean:
1.028238704s
1.053103506s
1.032757506s
1.016631201s
1.04288108s

So we can see the times are barely affected by this change.

Fixes: 213508006
Test: go test
Change-Id: Iab18bfb127ba3b7e63f2c01f69064805a8398764
2022-02-07 11:41:28 -08:00
..
check_boot_jars Add jdk.internal.ref to package_allowed_list.txt (OpenJDK 11) 2021-11-24 17:15:30 +00:00
hiddenapi Allow implementation details to be excluded from signature patterns file 2021-10-05 15:47:05 +01:00
Android.bp Remove python 2 support from manifest_utils 2021-11-30 12:24:02 -08:00
archive_repack.sh Repack libgcc.a to only include required objects 2019-10-24 16:34:54 -07:00
build-aml-prebuilts.sh Use --skip-config --soong-only instead of --skip-make 2021-10-29 16:34:55 -07:00
build-ndk-prebuilts.sh Use --skip-config --soong-only instead of --skip-make 2021-10-29 16:34:55 -07:00
build-rustdocs.sh rust: doc: Zip up docs when done 2021-08-20 13:08:16 -07:00
build_broken_logs.go Update build_broken_logs script 2020-01-29 10:50:41 -08:00
check_do_not_merge.sh Disallow using error-prone merge strategies 2021-02-19 13:05:54 +00:00
construct_context.py Apply pylint to scripts/construct_context*.py 2021-08-26 01:06:48 +00:00
construct_context_test.py Apply pylint to scripts/construct_context*.py 2021-08-26 01:06:48 +00:00
conv_linker_config.py Apply pylint to conv_linker_config.py 2021-08-26 16:48:59 +00:00
diff_build_graphs.sh Fix location of host tools 2021-11-05 14:10:01 -07:00
freeze-sysprop-api-files.sh Implement sysprop_library API stability check 2019-08-23 06:28:34 +00:00
gen-java-current-api-files.sh java_sdk_library: Allow api dir to be specified 2020-01-02 15:38:42 +00:00
gen-kotlin-build-file.py Move gen-kotlin-build-file.sh to python 2020-06-26 22:41:34 -07:00
gen-sysprop-api-files.sh Implement sysprop_library API stability check 2019-08-23 06:28:34 +00:00
gen_java_usedby_apex.sh Java used-by API list generation 2021-12-14 14:52:58 -08:00
gen_ndk_backedby_apex.sh Save all the detected native shared library backing by mainline modules. 2021-10-19 14:33:57 -07:00
gen_ndk_usedby_apex.sh NDK API coverage 2021-03-25 22:12:04 +00:00
generate-notice-files.py Make the script python3. 2021-09-13 14:54:01 -07:00
get_clang_version.py [get_clang_version] Make the version regex permissive 2021-10-06 09:44:15 -07:00
get_clang_version_test.py [scripts] Add script to print clang prebuilts version 2021-06-25 11:57:16 -07:00
jar-args.sh Add license headers to all go and shell files 2017-11-17 23:05:26 +00:00
jar-wrapper.sh Allow jar wrapper to take quoted arguments 2019-07-16 11:12:04 -07:00
jars-to-module-info-java.sh Add license headers to all go and shell files 2017-11-17 23:05:26 +00:00
jsonmodify.py Output json without trailing whitespaces but with trailing newlines. 2020-02-24 22:20:49 +00:00
lint_project_xml.py Fix minor issues in updatability lint CLs. 2021-04-22 13:40:41 -07:00
lint_project_xml_test.py Add lint_project_xml_test.py 2021-04-20 11:04:51 -07:00
manifest.py Convert soong scripts to python 3 2021-11-10 13:49:27 -08:00
manifest_check.py Convert soong scripts to python 3 2021-11-10 13:49:27 -08:00
manifest_check_test.py Apply pylint to scripts/manifest_check*.py 2021-09-08 03:59:40 +00:00
manifest_fixer.py Add testOnly attribute to AndroidManifest file of apex_test 2022-02-01 12:03:48 +00:00
manifest_fixer_test.py Add testOnly attribute to AndroidManifest file of apex_test 2022-02-01 12:03:48 +00:00
mergenotice.py Make a soong-only copy of generate-notice-files.py 2020-03-03 13:50:53 -08:00
microfactory.bash Upgrade to golang protobuf api v2 2021-07-23 11:12:05 -07:00
ninja_rsp.py Move gen-kotlin-build-file.sh to python 2020-06-26 22:41:34 -07:00
OWNERS Remove OWNERS for deleted build-mainline-modules.sh 2021-12-15 18:45:22 +00:00
package-check.sh Fix script for package check to work on macOS 2021-10-04 15:29:06 +00:00
rbc-run Use soong's finder to find included makefiles in mk2rbc 2022-02-07 11:41:28 -08:00
reverse-deps.sh Account for "validations:" 2021-11-23 12:12:06 -08:00
rustfmt.toml Add standard rustfmt.toml 2020-06-22 13:34:59 +02:00
setup-android-build.sh Script to set up android build directory 2020-01-30 19:18:54 -08:00
setup_go_workspace_for_soong.sh Upgrade to golang protobuf api v2 2021-07-23 11:12:05 -07:00
strip.sh Use create_minidebuginfo tool instead of bash script. 2021-05-01 00:06:07 +01:00
system-clang-format system-clang-format: Add Standard: Cpp11 2019-07-10 15:04:04 -07:00
system-clang-format-2 system-clang-format: Add Standard: Cpp11 2019-07-10 15:04:04 -07:00
test_config_fixer.py Convert soong scripts to python 3 2021-11-10 13:49:27 -08:00
test_config_fixer_test.py Convert soong scripts to python 3 2021-11-10 13:49:27 -08:00
toc.sh Fix toc.sh, llvm-nm does not recognise '-f P' option 2021-04-03 03:21:24 +08:00
transitive-deps.sh Account for "validations:" 2021-11-23 12:12:06 -08:00
unpack-prebuilt-apex.sh Silence unpack-prebuilt-apex 2021-11-22 15:07:35 +00:00
update_out A script to update the file contents with the command output. 2021-11-18 15:15:45 -08:00