Add --build-release option to mainline_modules_sdks.sh am: 14c6bd8c38 am: aee5bf605a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032129 Change-Id: I755749ceef97928aa9d962e9de81770dfc9ec23d
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
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.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import dataclasses
|
||||
import io
|
||||
import os
|
||||
@@ -775,16 +775,34 @@ def filter_modules(modules):
|
||||
return modules
|
||||
|
||||
|
||||
def main():
|
||||
def main(args):
|
||||
"""Program entry point."""
|
||||
if not os.path.exists("build/make/core/Makefile"):
|
||||
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()
|
||||
modules = filter_modules(MAINLINE_MODULES)
|
||||
|
||||
producer.produce_dist(modules, ALL_BUILD_RELEASES)
|
||||
producer.produce_dist(modules, build_releases)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main(sys.argv[1:])
|
||||
|
||||
@@ -56,7 +56,7 @@ function main() {
|
||||
# provided by the build to ensure consistency across build environments.
|
||||
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 "$@"
|
||||
|
||||
Reference in New Issue
Block a user