Refactor minify-tool.py and add run_bootstrap_benchmark.py
Rename to minify_tool.py so it can be imported in
run_bootstrap_benchmark.py.
Rename minify_tool.main() -> minify_tool.minify_tool(), and take
function parameters instead of using parser.parse_args().
Add non-None default values to the argument parser to make it possible
to keyword-argument unpacking `**vars(parser.parse_args())` for the main
invocation.
Add `debug` and `build` parameters, default True, that are set to False
in run_bootstrap_benchmark.py.
Change-Id: I61d70ae37b9ac433e13b107cc5c9d29225a7740c
diff --git a/tools/run_bootstrap_benchmark.py b/tools/run_bootstrap_benchmark.py
new file mode 100755
index 0000000..0c608f9
--- /dev/null
+++ b/tools/run_bootstrap_benchmark.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+# Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+import argparse
+import minify_tool
+import os
+import sys
+import utils
+
+
+PINNED_R8_JAR = os.path.join(utils.REPO_ROOT, 'third_party/r8/r8.jar')
+
+parser = argparse.ArgumentParser()
+parser.add_argument(
+ '--print-runtimeraw', metavar='BENCHMARKNAME',
+ help='Print "<BENCHMARKNAME>(RunTimeRaw): <elapsed> ms" at the end')
+
+
+if __name__ == '__main__':
+ sys.exit(minify_tool.minify_tool(input_jar=PINNED_R8_JAR, debug=False,
+ build=False, **vars(parser.parse_args())))