Commit d97cfbb0 authored by wez@chromium.org's avatar wez@chromium.org

Source major & minor versions from remoting, build & patch versions from Chrome.

The version number now follows the form major.minor.build.patch.

Major & minor versions come from remoting/VERSION.
Build & patch versions come from chrome/VERSION.

BUG=122721
TEST=Remoting web-app, plugins and host component executables & DLLs have matching versions in the above form, if versioned.


Review URL: http://codereview.chromium.org/10075002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132353 0039d316-1c4b-4281-b951-d872f2087c98
parent 59036b59
MAJOR=1 MAJOR=1
MINOR=4 MINOR=4
BUILD=8
PATCH=0
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -13,16 +14,14 @@ ...@@ -13,16 +14,14 @@
'host_plugin_mime_type': 'application/vnd.chromium.remoting-host', 'host_plugin_mime_type': 'application/vnd.chromium.remoting-host',
'host_plugin_description': 'Allow another user to access your computer securely over the Internet.', 'host_plugin_description': 'Allow another user to access your computer securely over the Internet.',
# Borrow the scripts for generating version information for remoting # The version is composed from major & minor versions specific to remoting
# binaries from Chrome. # and build & patch versions inherited from Chrome.
'variables': { 'version_py_path': '../chrome/tools/build/version.py',
'version_py_path': '../chrome/tools/build/version.py', 'version_path': '../remoting/VERSION',
'version_path': '../remoting/VERSION', 'chrome_version_path': '../chrome/VERSION',
},
'version_py_path': '<(version_py_path)',
'version_path': '<(version_path)',
'version_full': 'version_full':
'<!(python <(version_py_path) -f <(version_path) -t "@MAJOR@.@MINOR@.@BUILD@.@PATCH@")', '<!(python <(version_py_path) -f <(version_path) -t "@MAJOR@.@MINOR@").'
'<!(python <(version_py_path) -f <(chrome_version_path) -t "@BUILD@.@PATCH@")',
'conditions': [ 'conditions': [
['OS=="mac"', { ['OS=="mac"', {
...@@ -332,9 +331,10 @@ ...@@ -332,9 +331,10 @@
# Generates the version information resources for the Windows binaries. # Generates the version information resources for the Windows binaries.
# The .RC files are generated from the "version.rc.version" template and # The .RC files are generated from the "version.rc.version" template and
# placed in the "<(SHARED_INTERMEDIATE_DIR)/remoting" folder. # placed in the "<(SHARED_INTERMEDIATE_DIR)/remoting" folder.
# The substiture strings are taken from: # The substitution strings are taken from:
# - remoting/VERSION - the current version of Chromoting.
# - build/util/LASTCHANGE - the last source code revision. # - build/util/LASTCHANGE - the last source code revision.
# - chrome/VERSION - the build & patch versions.
# - remoting/VERSION - the major & minor versions.
# - xxx_branding - UI/localizable strings. # - xxx_branding - UI/localizable strings.
# - xxx.ver - per-binary non-localizable strings such as the binary # - xxx.ver - per-binary non-localizable strings such as the binary
# name. # name.
...@@ -350,6 +350,7 @@ ...@@ -350,6 +350,7 @@
'version.rc.version', 'version.rc.version',
'<(DEPTH)/build/util/LASTCHANGE', '<(DEPTH)/build/util/LASTCHANGE',
'<(version_path)', '<(version_path)',
'<(chrome_version_path)',
], ],
'direct_dependent_settings': { 'direct_dependent_settings': {
'include_dirs': [ 'include_dirs': [
...@@ -384,6 +385,7 @@ ...@@ -384,6 +385,7 @@
'inputs': [ 'inputs': [
'<(template_input_path)', '<(template_input_path)',
'<(version_path)', '<(version_path)',
'<(chrome_version_path)',
'<(branding_path)', '<(branding_path)',
'<(lastchange_path)', '<(lastchange_path)',
], ],
...@@ -394,6 +396,7 @@ ...@@ -394,6 +396,7 @@
'python', 'python',
'<(version_py_path)', '<(version_py_path)',
'-f', '<(RULE_INPUT_PATH)', '-f', '<(RULE_INPUT_PATH)',
'-f', '<(chrome_version_path)',
'-f', '<(version_path)', '-f', '<(version_path)',
'-f', '<(branding_path)', '-f', '<(branding_path)',
'-f', '<(lastchange_path)', '-f', '<(lastchange_path)',
...@@ -638,6 +641,8 @@ ...@@ -638,6 +641,8 @@
'sources': [ 'sources': [
'webapp/build-webapp.py', 'webapp/build-webapp.py',
'webapp/verify-webapp.py', 'webapp/verify-webapp.py',
'<(version_path)',
'<(chrome_version_path)',
'<@(remoting_webapp_files)', '<@(remoting_webapp_files)',
'<@(remoting_webapp_locale_files)', '<@(remoting_webapp_locale_files)',
], ],
...@@ -688,6 +693,8 @@ ...@@ -688,6 +693,8 @@
'inputs': [ 'inputs': [
'webapp/build-webapp.py', 'webapp/build-webapp.py',
'<(_plugin_path)', '<(_plugin_path)',
'<(version_path)',
'<(chrome_version_path)',
'<@(remoting_webapp_files)', '<@(remoting_webapp_files)',
'<@(remoting_webapp_locale_files)', '<@(remoting_webapp_locale_files)',
], ],
...@@ -698,6 +705,7 @@ ...@@ -698,6 +705,7 @@
'action': [ 'action': [
'python', 'webapp/build-webapp.py', 'python', 'webapp/build-webapp.py',
'<(buildtype)', '<(buildtype)',
'<(version_full)',
'<(host_plugin_mime_type)', '<(host_plugin_mime_type)',
'<(_output_dir)', '<(_output_dir)',
'<(_zip_path)', '<(_zip_path)',
......
...@@ -47,8 +47,8 @@ def createZip(zip_path, directory): ...@@ -47,8 +47,8 @@ def createZip(zip_path, directory):
zip.close() zip.close()
def buildWebApp(buildtype, mimetype, destination, zip_path, plugin, files, def buildWebApp(buildtype, version, mimetype, destination, zip_path, plugin,
locales): files, locales):
"""Does the main work of building the webapp directory and zipfile. """Does the main work of building the webapp directory and zipfile.
Args: Args:
...@@ -155,19 +155,10 @@ def buildWebApp(buildtype, mimetype, destination, zip_path, plugin, files, ...@@ -155,19 +155,10 @@ def buildWebApp(buildtype, mimetype, destination, zip_path, plugin, files,
if ((platform.system() == 'Linux') and (buildtype == 'Official')): if ((platform.system() == 'Linux') and (buildtype == 'Official')):
subprocess.call(["strip", newPluginPath]) subprocess.call(["strip", newPluginPath])
# Add unique build numbers to manifest version. # Set the version number in the manifest version.
# For now, this is based on the system clock (seconds since 1/1/1970), since
# a previous attempt (based on build/utils/lastchange.py) was failing on Mac.
# TODO(lambroslambrou): Use the SVN revision number or an incrementing build
# number (http://crbug.com/90110).
timestamp = int(time.time())
# Version string must be 1-4 numbers separated by dots, with each number
# between 0 and 0xffff.
version1 = timestamp / 0x10000
version2 = timestamp % 0x10000
findAndReplace(os.path.join(destination, 'manifest.json'), findAndReplace(os.path.join(destination, 'manifest.json'),
'UNIQUE_VERSION', 'FULL_APP_VERSION',
'%d.%d' % (version1, version2)) version)
# Set the correct mimetype. # Set the correct mimetype.
findAndReplace(os.path.join(destination, 'plugin_settings.js'), findAndReplace(os.path.join(destination, 'plugin_settings.js'),
...@@ -212,16 +203,16 @@ def buildWebApp(buildtype, mimetype, destination, zip_path, plugin, files, ...@@ -212,16 +203,16 @@ def buildWebApp(buildtype, mimetype, destination, zip_path, plugin, files,
def main(): def main():
if len(sys.argv) < 6: if len(sys.argv) < 7:
print ('Usage: build-webapp.py ' print ('Usage: build-webapp.py '
'<build-type> <mime-type> <dst> <zip-path> <plugin> ' '<build-type> <version> <mime-type> <dst> <zip-path> <plugin> '
'<other files...> --locales <locales...>') '<other files...> --locales <locales...>')
return 1 return 1
reading_locales = False reading_locales = False
files = [] files = []
locales = [] locales = []
for arg in sys.argv[6:]: for arg in sys.argv[7:]:
if arg == "--locales": if arg == "--locales":
reading_locales = True; reading_locales = True;
elif reading_locales: elif reading_locales:
...@@ -230,7 +221,7 @@ def main(): ...@@ -230,7 +221,7 @@ def main():
files.append(arg) files.append(arg)
buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5],
files, locales) sys.argv[6], files, locales)
return 0 return 0
......
{ {
"name": "__MSG_PRODUCT_NAME__", "name": "__MSG_PRODUCT_NAME__",
"version": "1.3.UNIQUE_VERSION", "version": "FULL_APP_VERSION",
"description": "__MSG_PRODUCT_DESCRIPTION__", "description": "__MSG_PRODUCT_DESCRIPTION__",
"default_locale": "en", "default_locale": "en",
"app": { "app": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment