switch to using DIST_DIR env var for dist

the dist dir should not be passed in as an argument, it should be picked
up from the environment.

Test: ./build/make/ci/build_test_suites --target_product aosp_x86_64 --target_release trunk_staging --with_dexpreopt_boot_img_and_system_server_only
Bug: 314171817
Change-Id: I32c007677cf1d81bb7b263b5c69e5510bf8dccfe
diff --git a/ci/build_test_suites.py b/ci/build_test_suites.py
index 23e896d..1d5b377 100644
--- a/ci/build_test_suites.py
+++ b/ci/build_test_suites.py
@@ -57,7 +57,6 @@
   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 @@
 
   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 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 @@
   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.