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

Side by Side Diff: native_client_sdk/src/build_tools/build_utils.py

Issue 13488007: [NaCl SDK] Make the SDK examples buildable as a packaged app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix license headers Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Small utility library of python functions used during SDK building. 5 """Small utility library of python functions used during SDK building.
6 """ 6 """
7 7
8 import os 8 import os
9 import sys 9 import sys
10 10
(...skipping 13 matching lines...) Expand all
24 def ChromeVersion(): 24 def ChromeVersion():
25 '''Extract chrome version from src/chrome/VERSION + svn. 25 '''Extract chrome version from src/chrome/VERSION + svn.
26 26
27 Returns: 27 Returns:
28 Chrome version string or trunk + svn rev. 28 Chrome version string or trunk + svn rev.
29 ''' 29 '''
30 info = lastchange.FetchVersionInfo(None) 30 info = lastchange.FetchVersionInfo(None)
31 if info.url.startswith('/trunk/'): 31 if info.url.startswith('/trunk/'):
32 return 'trunk.%s' % info.revision 32 return 'trunk.%s' % info.revision
33 else: 33 else:
34 exec(open(VERSION_PATH).read()) 34 return ChromeVersionNoTrunk()
35 return '%s.%s.%s.%s' % (MAJOR, MINOR, BUILD, PATCH) 35
36
37 def ChromeVersionNoTrunk():
38 '''Extract the chrome version from src/chrome/VERSION.
39 Ignore whether this is a trunk build.
40
41 Returns:
42 Chrome version string.
43 '''
44 exec(open(VERSION_PATH).read())
45 return '%s.%s.%s.%s' % (MAJOR, MINOR, BUILD, PATCH)
36 46
37 47
38 def ChromeMajorVersion(): 48 def ChromeMajorVersion():
39 '''Extract chrome major version from src/chrome/VERSION. 49 '''Extract chrome major version from src/chrome/VERSION.
40 50
41 Returns: 51 Returns:
42 Chrome major version. 52 Chrome major version.
43 ''' 53 '''
44 exec(open(VERSION_PATH, 'r').read()) 54 exec(open(VERSION_PATH, 'r').read())
45 return str(MAJOR) 55 return str(MAJOR)
46 56
47 57
48 def ChromeRevision(): 58 def ChromeRevision():
49 '''Extract chrome revision from svn. 59 '''Extract chrome revision from svn.
50 60
51 Returns: 61 Returns:
52 The Chrome revision as a string. e.g. "12345" 62 The Chrome revision as a string. e.g. "12345"
53 ''' 63 '''
54 return lastchange.FetchVersionInfo(None).revision 64 return lastchange.FetchVersionInfo(None).revision
OLDNEW
« no previous file with comments | « native_client_sdk/src/build_tools/build_app.py ('k') | native_client_sdk/src/build_tools/generate_index.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698