Merge "switch to using DIST_DIR env var for dist" into main

This commit is contained in:
Luca Farsi
2024-03-27 22:14:40 +00:00
committed by Gerrit Code Review

View File

@@ -57,7 +57,6 @@ def parse_args(argv):
argparser.add_argument(
'--with_dexpreopt_boot_img_and_system_server_only', action='store_true'
)
argparser.add_argument('--dist_dir')
argparser.add_argument('--change_info', nargs='?')
return argparser.parse_args()
@@ -92,16 +91,17 @@ def build_affected_modules(args: argparse.Namespace):
run_command(build_command, print_output=True)
zip_build_outputs(modules_to_build, args.dist_dir, args.target_release)
zip_build_outputs(modules_to_build, args.target_release)
def base_build_command(args: argparse.Namespace, extra_targets: set[str]) -> list:
def base_build_command(
args: argparse.Namespace, extra_targets: set[str]
) -> list:
build_command = []
build_command.append('time')
build_command.append('./build/soong/soong_ui.bash')
build_command.append('--make-mode')
build_command.append('dist')
build_command.append('DIST_DIR=' + args.dist_dir)
build_command.append('TARGET_PRODUCT=' + args.target_product)
build_command.append('TARGET_RELEASE=' + args.target_release)
if args.with_dexpreopt_boot_img_and_system_server_only:
@@ -220,7 +220,7 @@ def matches_file_patterns(
def zip_build_outputs(
modules_to_build: set[str], dist_dir: str, target_release: str
modules_to_build: set[str], target_release: str
):
src_top = os.environ.get('TOP', os.getcwd())
@@ -236,6 +236,7 @@ def zip_build_outputs(
product_out = pathlib.Path(get_soong_var('PRODUCT_OUT', target_release))
soong_host_out = pathlib.Path(get_soong_var('SOONG_HOST_OUT', target_release))
host_out = pathlib.Path(get_soong_var('HOST_OUT', target_release))
dist_dir = pathlib.Path(get_soong_var('DIST_DIR', target_release))
# Call the class to package the outputs.
# TODO(lucafarsi): Move this code into a replaceable class.