From fe36ebadabfabd8623cd3b72d22aa567437cf147 Mon Sep 17 00:00:00 2001 From: "zra@google.com" Date: Wed, 21 Jan 2015 15:18:23 +0000 Subject: [PATCH] Disables printing a version string to the console for GN build. R=ricow@google.com Review URL: https://codereview.chromium.org//850053005 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43041 260f80e4-7a28-3924-810f-c04153c831b5 --- runtime/BUILD.gn | 1 + tools/make_version.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 4c122625216..440b574afef 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -73,6 +73,7 @@ action("generate_version_cc_file") { script = "../tools/make_version.py" args = [ + "--quiet", "--output", rebase_path(output, root_build_dir), "--input", rebase_path("vm/version_in.cc", root_build_dir), ] diff --git a/tools/make_version.py b/tools/make_version.py index 80ac418bf23..925e3a6010f 100644 --- a/tools/make_version.py +++ b/tools/make_version.py @@ -35,9 +35,10 @@ VM_SNAPSHOT_FILES=[ 'symbols.cc', ] -def makeVersionString(): +def makeVersionString(quiet): version_string = utils.GetVersion() - debugLog("Returning version string: %s " % version_string) + if not quiet: + debugLog("Returning version string: %s " % version_string) return version_string @@ -50,9 +51,9 @@ def makeSnapshotHashString(): return vmhash.hexdigest() -def makeFile(output_file, input_file): +def makeFile(quiet, output_file, input_file): version_cc_text = open(input_file).read() - version_string = makeVersionString() + version_string = makeVersionString(quiet) version_cc_text = version_cc_text.replace("{{VERSION_STR}}", version_string) version_time = time.ctime(time.time()) @@ -69,6 +70,9 @@ def main(args): try: # Parse input. parser = OptionParser() + parser.add_option("-q", "--quiet", + action="store_true", default=False, + help="disable console output") parser.add_option("--output", action="store", type="string", help="output file name") @@ -88,7 +92,7 @@ def main(args): for arg in args: files.append(arg) - if not makeFile(options.output, options.input): + if not makeFile(options.quiet, options.output, options.input): return -1 return 0