Add --build-release option to mainline_modules_sdks.sh am: 14c6bd8c38

Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032129

Change-Id: I754e7e884cf926e8657d9c8b176628bb780da9d9
This commit is contained in:
Paul Duffin
2022-03-21 14:24:18 +00:00
committed by Automerger Merge Worker
2 changed files with 23 additions and 5 deletions

View File

@@ -18,7 +18,7 @@
If the environment variable TARGET_BUILD_APPS is nonempty then only the SDKs for If the environment variable TARGET_BUILD_APPS is nonempty then only the SDKs for
the APEXes in it are built, otherwise all configured SDKs are built. the APEXes in it are built, otherwise all configured SDKs are built.
""" """
import argparse
import dataclasses import dataclasses
import io import io
import os import os
@@ -761,16 +761,34 @@ def filter_modules(modules):
return modules return modules
def main(): def main(args):
"""Program entry point.""" """Program entry point."""
if not os.path.exists("build/make/core/Makefile"): if not os.path.exists("build/make/core/Makefile"):
sys.exit("This script must be run from the top of the tree.") sys.exit("This script must be run from the top of the tree.")
args_parser = argparse.ArgumentParser(
description="Build snapshot zips for consumption by Gantry.")
args_parser.add_argument(
"--build-release",
action="append",
choices=[br.name for br in ALL_BUILD_RELEASES],
help="A target build for which snapshots are required.",
)
args = args_parser.parse_args(args)
build_releases = ALL_BUILD_RELEASES
if args.build_release:
selected_build_releases = {b.lower() for b in args.build_release}
build_releases = [
b for b in build_releases
if b.name.lower() in selected_build_releases
]
producer = create_producer() producer = create_producer()
modules = filter_modules(MAINLINE_MODULES) modules = filter_modules(MAINLINE_MODULES)
producer.produce_dist(modules, ALL_BUILD_RELEASES) producer.produce_dist(modules, build_releases)
if __name__ == "__main__": if __name__ == "__main__":
main() main(sys.argv[1:])

View File

@@ -56,7 +56,7 @@ function main() {
# provided by the build to ensure consistency across build environments. # provided by the build to ensure consistency across build environments.
export DIST_DIR OUT_DIR export DIST_DIR OUT_DIR
prebuilts/build-tools/linux-x86/bin/py3-cmd -u "${py3script}" prebuilts/build-tools/linux-x86/bin/py3-cmd -u "${py3script}" "$@"
} }
init "$@" init "$@"