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

Unified Diff: webkit/build/webkit_version.py

Issue 14973005: Generate and use LASTCHANGE for blink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 7 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
Index: webkit/build/webkit_version.py
diff --git a/webkit/build/webkit_version.py b/webkit/build/webkit_version.py
deleted file mode 100755
index 93def61317a9b59fb3c596227852ad975cd32c64..0000000000000000000000000000000000000000
--- a/webkit/build/webkit_version.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-'''Emits a webkit_version.h header file with
-WEBKIT_MAJOR_VERSION and WEBKIT_MINOR_VERSION macros.
-'''
-
-import os
-import re
-import sys
-
-# Get the full path of the current script which would be something like
-# src/webkit/build/webkit_version.py and navigate backwards twice to strip the
-# last two path components to get to the srcroot.
-# This is to ensure that the script can load the lastchange module by updating
-# the sys.path variable with the desired location.
-path = os.path.dirname(os.path.realpath(__file__))
-path = os.path.dirname(os.path.dirname(path))
-path = os.path.join(path, 'build', 'util')
-
-sys.path.insert(0, path)
-import lastchange
-
-
-def GetWebKitRevision(webkit_src_dir):
- """Get the WebKit revision, in the form 'trunk@1234'."""
-
- version_info = lastchange.FetchVersionInfo(
- default_lastchange=None,
- directory=webkit_src_dir,
- directory_regex_prior_to_src_url='webkit')
-
- if version_info.url == None:
- version_info.url = 'Unknown URL'
- version_info.url = version_info.url.strip('/')
-
- if version_info.revision == None:
- version_info.revision = '0'
-
- return "%s@%s" % (version_info.url, version_info.revision)
-
-
-def EmitVersionHeader(webkit_src_dir, output_dir):
- '''Emit a header file that we can use from within webkit_glue.cc.'''
-
- # These are hard-coded from when we forked Blink. Presumably these
- # would be better in a header somewhere.
- major, minor = (537, 36)
- webkit_revision = GetWebKitRevision(webkit_src_dir)
-
- fname = os.path.join(output_dir, "webkit_version.h")
- f = open(fname, 'wb')
- template = """// webkit_version.h
-// generated from %s
-
-#define WEBKIT_VERSION_MAJOR %d
-#define WEBKIT_VERSION_MINOR %d
-#define WEBKIT_SVN_REVISION "%s"
-""" % (webkit_src_dir, major, minor, webkit_revision)
- f.write(template)
- f.close()
- return 0
-
-
-def main():
- return EmitVersionHeader(*sys.argv[1:])
-
-
-if __name__ == "__main__":
- sys.exit(main())

Powered by Google App Engine
This is Rietveld 408576698