diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 0c84ef93d9..36aaa5da58 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -125,9 +125,14 @@ def _openvino_verify_device_type(device_read): def parse_arguments(): - parser = argparse.ArgumentParser( + class Parser(argparse.ArgumentParser): + # override argument file line parsing behavior - allow multiple arguments per line and handle quotes + def convert_arg_line_to_args(self, arg_line): + return shlex.split(arg_line) + + parser = Parser( description="ONNXRuntime CI build driver.", - usage=""" # noqa + usage=""" Default behavior is --update --build --test for native architecture builds. Default behavior is --update --build for cross-compiled builds. @@ -136,7 +141,10 @@ def parse_arguments(): The Test phase will run all unit tests, and optionally the ONNX tests. Use the individual flags to only run the specified stages. - """) + """, + # files containing arguments can be specified on the command line with "@" and the arguments within + # will be included at that point + fromfile_prefix_chars="@") # Main arguments parser.add_argument( "--build_dir", required=True, help="Path to the build directory.")