Commit 97f52dc5 authored by Ben Joyce's avatar Ben Joyce Committed by Commit Bot

Add option to print classpath to script.

This will be read by the test runner when sharding junit tests.

Bug: 1138506, 1141757
Change-Id: I050064f4b0c4ef766246b60469f59ee69a3893ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2506172Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: benjamin joyce <bjoyce@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822736}
parent fbe2a834
......@@ -44,8 +44,15 @@ parser = argparse.ArgumentParser()
parser.add_argument('--jar-args')
parser.add_argument('--jvm-args')
parser.add_argument('--classpath')
# Test_runner parses the classpath for sharding junit tests.
parser.add_argument('--print-classpath', action='store_true',
help='Prints the classpass. Used by test_runner.')
known_args, unknown_args = parser.parse_known_args(sys.argv[1:])
if known_args.print_classpath:
sys.stdout.write(':'.join(classpath))
sys.exit(0)
if known_args.jvm_args:
jvm_arguments = known_args.jvm_args.strip('"').split()
java_cmd.extend(jvm_arguments)
......@@ -96,12 +103,11 @@ def main(argv):
with build_utils.AtomicOutput(options.output) as script:
script.write(
script_template.format(
classpath=('"%s"' % '", "'.join(classpath)),
java_path=repr(java_path),
main_class=options.main_class,
extra_program_args=repr(extra_program_args),
noverify_flag=noverify_flag))
script_template.format(classpath=('"%s"' % '", "'.join(classpath)),
java_path=repr(java_path),
main_class=options.main_class,
extra_program_args=repr(extra_program_args),
noverify_flag=noverify_flag))
os.chmod(options.output, 0750)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment