Add a script to optimize Test Mapping builds
Move the test build command to a script that lives in-source and
intended to be called by the Android CI build system.
This script optimizes the build when change information is available by
only building relevant test modules. More specifically, only 'affected'
test modules listed in Test Mapping configuration files are built.
Using this script is expected to reduce build times and generate a
smaller `general-tests.zip` file which had increased to over 30 GB.
Test: ./build/make/ci/build_test_suites --target_product aosp_x86_64
--target_release trunk_staging --with_dexpreopt_boot_img_and_system_server_only --dist_dir <dist_dir> --change_info <change_info_file> <extra_targets>
Bug: 314171817
Change-Id: Ie2f8c066f5dd1cd13454141e55956328303fd79d
diff --git a/ci/build_test_suites b/ci/build_test_suites
new file mode 100755
index 0000000..861065a
--- /dev/null
+++ b/ci/build_test_suites
@@ -0,0 +1,22 @@
+# Copyright 2024, The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import sys
+
+import build_test_suites
+
+if __name__ == '__main__':
+ sys.dont_write_bytecode = True
+
+ build_test_suites.main(sys.argv)