Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: tools/push-to-trunk/generate_version.py

Issue 797503007: Auto-generate v8 version based on tags. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« BUILD.gn ('K') | « tools/gyp/v8.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/generate_version.py
diff --git a/tools/push-to-trunk/generate_version.py b/tools/push-to-trunk/generate_version.py
index b4a0221eae5c10224a18d79bf8067ca3df958177..4f0ba501783fc87dcdc21b32f2b746d3a5f2b106 100755
--- a/tools/push-to-trunk/generate_version.py
+++ b/tools/push-to-trunk/generate_version.py
@@ -19,6 +19,12 @@ CWD = os.path.abspath(
VERSION_CC = os.path.join(CWD, "src", "version.cc")
def main():
+ if len(sys.argv) != 2:
+ print "Error: Specify the output file path for version.cc"
+ return 1
+ version_out = sys.argv[1]
+ assert os.path.exists(os.path.dirname(version_out))
+
tag = subprocess.check_output(
"git describe --tags",
shell=True,
@@ -63,7 +69,7 @@ def main():
if line.startswith("#define %s" % definition):
line = re.sub("\d+$", substitute, line)
output.append(line)
- with open(VERSION_CC, "w") as f:
+ with open(version_out, "w") as f:
f.write("\n".join(output))
# Log what was done.
« BUILD.gn ('K') | « tools/gyp/v8.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698