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

Side by Side Diff: build/generate_version.py

Issue 860163002: Ensure tags are fetched when generating the V8 version. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix win 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 the V8 project authors. All rights reserved. 2 # Copyright 2014 the V8 project authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ 6 """
7 Script to set v8's version file to the version given by the latest tag. 7 Script to set v8's version file to the version given by the latest tag.
8 8
9 The script is intended to be run as a gclient hook. The script will write a 9 The script is intended to be run as a gclient hook. The script will write a
10 generated version file into the checkout. 10 generated version file into the checkout.
(...skipping 10 matching lines...) Expand all
21 import subprocess 21 import subprocess
22 import sys 22 import sys
23 23
24 24
25 CWD = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) 25 CWD = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
26 VERSION_CC = os.path.join(CWD, "src", "version.cc") 26 VERSION_CC = os.path.join(CWD, "src", "version.cc")
27 VERSION_GEN_CC = os.path.join(CWD, "src", "version_gen.cc") 27 VERSION_GEN_CC = os.path.join(CWD, "src", "version_gen.cc")
28 28
29 29
30 def generate_version_file(): 30 def generate_version_file():
31 # Make sure the tags are fetched.
32 subprocess.check_output(
33 "git fetch origin +refs/tags/*:refs/tags/*",
34 shell=True,
35 cwd=CWD)
31 tag = subprocess.check_output( 36 tag = subprocess.check_output(
32 "git describe --tags", 37 "git describe --tags",
33 shell=True, 38 shell=True,
34 cwd=CWD, 39 cwd=CWD,
35 ).strip() 40 ).strip()
36 assert tag 41 assert tag
37 42
38 # Check for commits not exactly matching a tag. Those are candidate builds 43 # Check for commits not exactly matching a tag. Those are candidate builds
39 # for the next version. The output has the form 44 # for the next version. The output has the form
40 # <tag name>-<n commits>-<hash>. 45 # <tag name>-<n commits>-<hash>.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 with open(VERSION_GEN_CC, "w") as f: 114 with open(VERSION_GEN_CC, "w") as f:
110 f.write(version_file_content) 115 f.write(version_file_content)
111 # Log what was calculated. 116 # Log what was calculated.
112 print log_message 117 print log_message
113 118
114 return 0 119 return 0
115 120
116 121
117 if __name__ == "__main__": 122 if __name__ == "__main__":
118 sys.exit(main()) 123 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698