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

Side by Side Diff: skia/commit_hash.py

Issue 2187533002: skia_commit_hash.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-28 (Thursday) 16:16:56 EDT Created 4 years, 4 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
OLDNEW
(Empty)
1 #!/usr/bin/python
2
3 # Copyright (c) 2016 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 '''
8 Usage: python commit_hash.py SKIA_DIR OUTPUT_FILE
9 '''
10
11 import os
12 import subprocess
13 import sys
14
15 assert len(sys.argv) == 3
16
17 template = '''#include "skia/ext/skia_commit_hash.h"
18 namespace skia {
19 const char* CommitHash() { return "%s"; }
20 }
21 '''
22
23 try:
24 commit = subprocess.check_output(
25 ['git', 'rev-parse', '--short=12', 'HEAD'],
26 cwd=sys.argv[1]).strip()
27 except (subprocess.CalledProcessError, OSError), e:
28 commit = 'UNKNOWN'
29
30 with open(sys.argv[2], 'w') as o:
31 o.write(template % commit)
OLDNEW
« skia/BUILD.gn ('K') | « skia/BUILD.gn ('k') | skia/ext/skia_commit_hash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698