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

Unified Diff: native_client_sdk/src/build_tools/build_utils.py

Issue 8758013: Using chrome's VERSION file for branches, or the svn rev for trunk (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
« no previous file with comments | « native_client_sdk/src/DEPS ('k') | native_client_sdk/src/build_tools/buildbot_run.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/build_tools/build_utils.py
===================================================================
--- native_client_sdk/src/build_tools/build_utils.py (revision 112129)
+++ native_client_sdk/src/build_tools/build_utils.py (working copy)
@@ -19,29 +19,46 @@
from nacl_sdk_scons import nacl_utils
-def ChromeMilestone():
- '''Extract chrome_milestone from src/DEPS
+# Reuse last change utility code.
+SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
+SRC_DIR = os.path.dirname(os.path.dirname(os.path.dirname(SCRIPT_DIR)))
+sys.path.append(os.path.join(SRC_DIR, 'build/util'))
+import lastchange
+
+# Location of chrome's version file.
+VERSION_PATH = os.path.join(SRC_DIR, 'chrome', 'VERSION')
+
+
+def ChromeVersion():
+ '''Extract chrome version from src/chrome/VERSION + svn.
+
Returns:
- Chrome milestone variable value from src/DEPS.
+ Chrome version string or trunk + svn rev.
'''
- parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- def From(x, y):
- return ''
- def Var(x):
- return ''
- def File(x):
- return ''
- with open(os.path.join(parent_dir, 'DEPS'), 'r') as fh:
- exec(fh.read())
- return vars.get('chrome_milestone')
+ info = lastchange.FetchVersionInfo(None)
+ if info.url.startswith('/trunk/'):
+ return 'trunk.%s' % info.revision
+ else:
+ exec(open(VERSION_PATH, 'r').read())
+ return '%s.%s.%s.%s' % (MAJOR, MINOR, BUILD, PATCH)
+def ChromeMajorVersion():
+ '''Extract chrome major version from src/chrome/VERSION.
+
+ Returns:
+ Chrome major version.
+ '''
+ exec(open(VERSION_PATH, 'r').read())
+ return str(MAJOR)
+
+
#------------------------------------------------------------------------------
# Parameters
# Revision numbers for the SDK
-PLATFORM_VERSION = 'pepper_' + ChromeMilestone()
+PLATFORM_VERSION = 'pepper_' + ChromeMajorVersion()
TOOLCHAIN_AUTODETECT = "AUTODETECT"
« no previous file with comments | « native_client_sdk/src/DEPS ('k') | native_client_sdk/src/build_tools/buildbot_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698