summaryrefslogtreecommitdiffstats
path: root/o3d/plugin
diff options
context:
space:
mode:
authortschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-06 20:32:56 +0000
committertschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-06 20:32:56 +0000
commitbbf362b447de9cdd023e933ae219731fc01d0571 (patch)
tree86c70036905763d6e4718fcd7bb6e731536e2d7a /o3d/plugin
parent9776400c727f886197fb538546edca2331252fb2 (diff)
downloadchromium_src-bbf362b447de9cdd023e933ae219731fc01d0571.zip
chromium_src-bbf362b447de9cdd023e933ae219731fc01d0571.tar.gz
chromium_src-bbf362b447de9cdd023e933ae219731fc01d0571.tar.bz2
Axe the o3d_version.py script and turn it into a .gypi file. This fixes a bug where bumping the version wasn't always picked up by the build slaves because hooks are only re-run when a GYP file changes.
Also axe the o3d_kill_version.py and the separate SDK version logic, which was not used anymore. TEST=built on Linux; trybots BUG=none Review URL: http://codereview.chromium.org/2017004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin')
-rw-r--r--o3d/plugin/plugin.gyp10
-rw-r--r--o3d/plugin/version.gypi9
-rw-r--r--o3d/plugin/version_info.py40
3 files changed, 24 insertions, 35 deletions
diff --git a/o3d/plugin/plugin.gyp b/o3d/plugin/plugin.gyp
index 1f162bf..bcc3401 100644
--- a/o3d/plugin/plugin.gyp
+++ b/o3d/plugin/plugin.gyp
@@ -62,6 +62,7 @@
'includes': [
'../build/common.gypi',
'branding.gypi',
+ 'version.gypi',
],
'target_defaults': {
'include_dirs': [
@@ -70,11 +71,11 @@
'../../<(gtestdir)',
],
'defines': [
- 'O3D_PLUGIN_DESCRIPTION="<!(python version_info.py --set_name="<(plugin_name)" --set_npapi_mimetype="<(plugin_npapi_mimetype)" --description)"',
+ 'O3D_PLUGIN_DESCRIPTION="<!(python version_info.py --set_name="<(plugin_name)" --set_version="<(plugin_version)" --set_npapi_mimetype="<(plugin_npapi_mimetype)" --description)"',
'O3D_PLUGIN_NPAPI_FILENAME="<(plugin_npapi_filename)"',
'O3D_PLUGIN_NPAPI_MIMETYPE="<(plugin_npapi_mimetype)"',
'O3D_PLUGIN_NAME="<(plugin_name)"',
- 'O3D_PLUGIN_VERSION="<!(python version_info.py --version)"',
+ 'O3D_PLUGIN_VERSION="<(plugin_version)"',
'O3D_PLUGIN_INSTALLDIR_CSIDL=<(plugin_installdir_csidl)',
'O3D_PLUGIN_VENDOR_DIRECTORY="<(plugin_vendor_directory)"',
'O3D_PLUGIN_PRODUCT_DIRECTORY="<(plugin_product_directory)"',
@@ -208,6 +209,7 @@
'action': ['python',
'version_info.py',
'--set_name=<(plugin_name)',
+ '--set_version=<(plugin_version)',
'--set_npapi_mimetype=<(plugin_npapi_mimetype)',
'mac/o3d_plugin.r',
'${BUILT_PRODUCTS_DIR}/O3D.r',
@@ -533,6 +535,7 @@
'action': ['python',
'version_info.py',
'--set_name=<(plugin_name)',
+ '--set_version=<(plugin_version)',
'--set_npapi_filename=<(plugin_npapi_filename)',
'--set_npapi_mimetype=<(plugin_npapi_mimetype)',
'win/o3dPlugin.rc_template',
@@ -550,6 +553,7 @@
'action': ['python',
'version_info.py',
'--set_name=<(plugin_name)',
+ '--set_version=<(plugin_version)',
'--set_npapi_filename=<(plugin_npapi_filename)',
'--set_npapi_mimetype=<(plugin_npapi_mimetype)',
'mac/Info.plist',
@@ -605,6 +609,7 @@
],
'action': ['python',
'version_info.py',
+ '--set_version=<(plugin_version)',
'--set_activex_hostcontrol_clsid=' +
'<(plugin_activex_hostcontrol_clsid)',
'--set_activex_typelib_clsid=<(plugin_activex_typelib_clsid)',
@@ -632,6 +637,7 @@
],
'action': ['python',
'version_info.py',
+ '--set_version=<(plugin_version)',
'--set_activex_hostcontrol_clsid=' +
'<(plugin_activex_hostcontrol_clsid)',
'--set_activex_typelib_clsid=<(plugin_activex_typelib_clsid)',
diff --git a/o3d/plugin/version.gypi b/o3d/plugin/version.gypi
new file mode 100644
index 0000000..447d46f
--- /dev/null
+++ b/o3d/plugin/version.gypi
@@ -0,0 +1,9 @@
+# Copyright (c) 2010 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.
+
+{
+ 'variables': {
+ 'plugin_version': '0.1.43.2',
+ }
+}
diff --git a/o3d/plugin/version_info.py b/o3d/plugin/version_info.py
index 23d4acc..58c8229 100644
--- a/o3d/plugin/version_info.py
+++ b/o3d/plugin/version_info.py
@@ -28,21 +28,18 @@ sys.path.append(gflags_dir)
import gflags
FLAGS = gflags.FLAGS
-gflags.DEFINE_boolean('kill_switch', False,
- 'Generate version numbers for kill switch binary.')
-
gflags.DEFINE_boolean('description', False,
'Print out the plugin description and exit.')
-gflags.DEFINE_boolean('version', False,
- 'Print out the plugin version and exit.')
-
gflags.DEFINE_boolean('commaversion', False,
'Print out the plugin version with commas and exit.')
gflags.DEFINE_string('set_name', '',
'Sets the plugin name to use.')
+gflags.DEFINE_string('set_version', '',
+ 'Sets the plugin version to use.')
+
gflags.DEFINE_string('set_npapi_filename', '',
'Sets the plugin NPAPI filename to use.')
@@ -61,14 +58,9 @@ gflags.DEFINE_string('set_activex_hostcontrol_name', '',
gflags.DEFINE_string('set_activex_typelib_name', '',
'Sets the ActiveX TypeLib\'s name to use.')
-def GetDotVersion(version):
- return '%d.%d.%d.%d' % version
-
-def GetCommaVersion(version):
- return '%d,%d,%d,%d' % version
-
def DoReplace(in_filename, out_filename, replacements):
- '''Replace the version number in the given filename with the replacements.'''
+ '''Replace the version placeholders in the given filename with the
+ replacements.'''
if not os.path.exists(in_filename):
raise Exception(r'''Input template file %s doesn't exist.''' % in_filename)
input_file = open(in_filename, 'r')
@@ -92,27 +84,13 @@ def main(argv):
# Strip off argv[0]
files = files[1:]
- # Get version string from o3d_version.py
- o3d_version_vars = {}
- if FLAGS.kill_switch:
- execfile(os.path.join(script_dir, '..', 'installer', 'win',
- 'o3d_kill_version.py'), o3d_version_vars)
- else:
- execfile(os.path.join(script_dir, '..', 'installer', 'win',
- 'o3d_version.py'), o3d_version_vars)
-
- plugin_version = o3d_version_vars['plugin_version']
- sdk_version = o3d_version_vars['sdk_version']
-
# This name is used by Javascript to find the plugin therefore it must
# not change. If you change this you must change the name in
# samples/o3djs/util.js but be aware, changing the name
# will break all apps that use o3d on the web.
O3D_PLUGIN_NAME = FLAGS.set_name
- O3D_PLUGIN_VERSION = GetDotVersion(plugin_version)
- O3D_PLUGIN_VERSION_COMMAS = GetCommaVersion(plugin_version)
- O3D_SDK_VERSION = GetDotVersion(sdk_version)
- O3D_SDK_VERSION_COMMAS = GetCommaVersion(sdk_version)
+ O3D_PLUGIN_VERSION = FLAGS.set_version
+ O3D_PLUGIN_VERSION_COMMAS = O3D_PLUGIN_VERSION.replace('.', ',')
O3D_PLUGIN_DESCRIPTION = '%s version:%s' % (O3D_PLUGIN_NAME,
O3D_PLUGIN_VERSION)
O3D_PLUGIN_NPAPI_FILENAME = FLAGS.set_npapi_filename
@@ -126,10 +104,6 @@ def main(argv):
print '%s' % O3D_PLUGIN_DESCRIPTION
sys.exit(0)
- if FLAGS.version:
- print '%s' % O3D_PLUGIN_VERSION
- sys.exit(0)
-
if FLAGS.commaversion:
print '%s' % O3D_PLUGIN_VERSION_COMMAS
sys.exit(0)