summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormad@google.com <mad@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-07 20:41:38 +0000
committermad@google.com <mad@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-07 20:41:38 +0000
commit4d91cbc7507d85971368202326bcb58531374a8d (patch)
tree27e562b041ec74fa21b2a479ab7f358bdb68c984
parent4ae3d4e71fcd94412d9957a0be05a3479e332b8d (diff)
downloadchromium_src-4d91cbc7507d85971368202326bcb58531374a8d.zip
chromium_src-4d91cbc7507d85971368202326bcb58531374a8d.tar.gz
chromium_src-4d91cbc7507d85971368202326bcb58531374a8d.tar.bz2
Committing for jeffbailey.
Excerpt from: http://codereview.chromium.org/1991004/show ---------------- Put version information into header file for easy consumption by RC files. RC files can use an #include to pull in this header, rather than being each dynamically generated. BUG=none TEST=none ---------------- Review URL: http://codereview.chromium.org/2020003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46736 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/common.gypi5
-rw-r--r--chrome/chrome.gyp43
-rw-r--r--chrome/version.h.in130
-rw-r--r--chrome_frame/chrome_frame.gyp48
-rw-r--r--chrome_frame/chrome_tab_version.rc52
-rw-r--r--chrome_frame/chrome_tab_version.rc.version46
6 files changed, 231 insertions, 93 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 93b2320..05adc1a 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -1250,7 +1250,10 @@
},
'VCResourceCompilerTool': {
'Culture' : '1033',
- 'AdditionalIncludeDirectories': ['<(DEPTH)'],
+ 'AdditionalIncludeDirectories': [
+ '<(DEPTH)',
+ '<(SHARED_INTERMEDIATE_DIR)',
+ ],
},
},
},
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index a622be2..d66de827 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -1405,6 +1405,49 @@
],
},
{
+ 'target_name': 'chrome_version_header',
+ 'type': 'none',
+ 'actions': [
+ {
+ 'action_name': 'version_header',
+ 'variables': {
+ 'lastchange_path':
+ '<(SHARED_INTERMEDIATE_DIR)/build/LASTCHANGE',
+ },
+ 'conditions': [
+ [ 'branding == "Chrome"', {
+ 'variables': {
+ 'branding_path': 'app/theme/google_chrome/BRANDING',
+ },
+ }, { # else branding!="Chrome"
+ 'variables': {
+ 'branding_path': 'app/theme/chromium/BRANDING',
+ },
+ }],
+ ],
+ 'inputs': [
+ '<(version_path)',
+ '<(branding_path)',
+ '<(lastchange_path)',
+ 'version.h.in',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/version.h',
+ ],
+ 'action': [
+ 'python',
+ '<(version_py_path)',
+ '-f', '<(version_path)',
+ '-f', '<(branding_path)',
+ '-f', '<(lastchange_path)',
+ 'version.h.in',
+ '<@(_outputs)',
+ ],
+ 'message': 'Generating version header file: <@(_outputs)',
+ },
+ ],
+ },
+ {
'target_name': 'automation',
'type': '<(library)',
'msvs_guid': '1556EF78-C7E6-43C8-951F-F6B43AC0DD12',
diff --git a/chrome/version.h.in b/chrome/version.h.in
new file mode 100644
index 0000000..022c360
--- /dev/null
+++ b/chrome/version.h.in
@@ -0,0 +1,130 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// version.h is generated from version.h.in. Edit the source!
+
+#pragma once
+
+// Version Information
+
+#define CHROME_VERSION @MAJOR@,@MINOR@,@BUILD@,@PATCH@
+#define CHROME_VERSION_STRING "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
+
+// Branding Information
+
+#define COMPANY_FULLNAME_STRING "@COMPANY_FULLNAME@"
+#define COMPANY_SHORTNAME_STRING "@COMPANY_SHORTNAME@"
+#define PRODUCT_FULLNAME_STRING "@PRODUCT_FULLNAME@"
+#define PRODUCT_SHORTNAME_STRING "@PRODUCT_SHORTNAME@"
+#define COPYRIGHT_STRING "@COPYRIGHT@"
+#define OFFICIAL_BUILD_STRING "@OFFICIAL_BUILD@"
+
+// Changelist Information
+
+#define LASTCHANGE_STRING "@LASTCHANGE@"
+
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// version.h is generated from version.h.in. Edit the source!
+
+#pragma once
+
+// Version Information
+
+#define CHROME_VERSION @MAJOR@,@MINOR@,@BUILD@,@PATCH@
+#define CHROME_VERSION_STRING "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
+
+// Branding Information
+
+#define COMPANY_FULLNAME_STRING "@COMPANY_FULLNAME@"
+#define COMPANY_SHORTNAME_STRING "@COMPANY_SHORTNAME@"
+#define PRODUCT_FULLNAME_STRING "@PRODUCT_FULLNAME@"
+#define PRODUCT_SHORTNAME_STRING "@PRODUCT_SHORTNAME@"
+#define COPYRIGHT_STRING "@COPYRIGHT@"
+#define OFFICIAL_BUILD_STRING "@OFFICIAL_BUILD@"
+
+// Changelist Information
+
+#define LASTCHANGE_STRING "@LASTCHANGE@"
+
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// version.h is generated from version.h.in. Edit the source!
+
+#pragma once
+
+// Version Information
+
+#define CHROME_VERSION @MAJOR@,@MINOR@,@BUILD@,@PATCH@
+#define CHROME_VERSION_STRING "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
+
+// Branding Information
+
+#define COMPANY_FULLNAME_STRING "@COMPANY_FULLNAME@"
+#define COMPANY_SHORTNAME_STRING "@COMPANY_SHORTNAME@"
+#define PRODUCT_FULLNAME_STRING "@PRODUCT_FULLNAME@"
+#define PRODUCT_SHORTNAME_STRING "@PRODUCT_SHORTNAME@"
+#define COPYRIGHT_STRING "@COPYRIGHT@"
+#define OFFICIAL_BUILD_STRING "@OFFICIAL_BUILD@"
+
+// Changelist Information
+
+#define LASTCHANGE_STRING "@LASTCHANGE@"
+
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// version.h is generated from version.h.in. Edit the source!
+
+#pragma once
+
+// Version Information
+
+#define CHROME_VERSION @MAJOR@,@MINOR@,@BUILD@,@PATCH@
+#define CHROME_VERSION_STRING "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
+
+// Branding Information
+
+#define COMPANY_FULLNAME_STRING "@COMPANY_FULLNAME@"
+#define COMPANY_SHORTNAME_STRING "@COMPANY_SHORTNAME@"
+#define PRODUCT_FULLNAME_STRING "@PRODUCT_FULLNAME@"
+#define PRODUCT_SHORTNAME_STRING "@PRODUCT_SHORTNAME@"
+#define COPYRIGHT_STRING "@COPYRIGHT@"
+#define OFFICIAL_BUILD_STRING "@OFFICIAL_BUILD@"
+
+// Changelist Information
+
+#define LASTCHANGE_STRING "@LASTCHANGE@"
+
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// version.h is generated from version.h.in. Edit the source!
+
+#pragma once
+
+// Version Information
+
+#define CHROME_VERSION @MAJOR@,@MINOR@,@BUILD@,@PATCH@
+#define CHROME_VERSION_STRING "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
+
+// Branding Information
+
+#define COMPANY_FULLNAME_STRING "@COMPANY_FULLNAME@"
+#define COMPANY_SHORTNAME_STRING "@COMPANY_SHORTNAME@"
+#define PRODUCT_FULLNAME_STRING "@PRODUCT_FULLNAME@"
+#define PRODUCT_SHORTNAME_STRING "@PRODUCT_SHORTNAME@"
+#define COPYRIGHT_STRING "@COPYRIGHT@"
+#define OFFICIAL_BUILD_STRING "@OFFICIAL_BUILD@"
+
+// Changelist Information
+
+#define LASTCHANGE_STRING "@LASTCHANGE@"
+
diff --git a/chrome_frame/chrome_frame.gyp b/chrome_frame/chrome_frame.gyp
index 091352d..b3cafe3 100644
--- a/chrome_frame/chrome_frame.gyp
+++ b/chrome_frame/chrome_frame.gyp
@@ -753,6 +753,7 @@
'chrome_launcher',
'xulrunner_sdk',
'../chrome/chrome.gyp:chrome_version_info',
+ '../chrome/chrome.gyp:chrome_version_header',
'../chrome/chrome.gyp:common',
'../chrome/chrome.gyp:utility',
'../build/temp_gyp/googleurl.gyp:googleurl',
@@ -769,7 +770,7 @@
# figure out something more gyp-ish.
'resources/tlb_resource.rc',
'chrome_tab.rgs',
- 'chrome_tab_version.rc.version',
+ 'chrome_tab_version.rc',
'resource.h',
],
'include_dirs': [
@@ -817,51 +818,6 @@
},
}],
],
- 'rules': [
- # Borrowed from chrome.gyp:chrome_dll_version, branding references
- # removed
- {
- 'rule_name': 'version',
- 'extension': 'version',
- 'variables': {
- 'version_py': '../chrome/tools/build/version.py',
- 'version_path': '../chrome/VERSION',
- 'lastchange_path':
- '<(SHARED_INTERMEDIATE_DIR)/build/LASTCHANGE',
- 'template_input_path': 'chrome_tab_version.rc.version',
- },
- 'conditions': [
- [ 'branding == "Chrome"', {
- 'variables': {
- 'branding_path': '../chrome/app/theme/google_chrome/BRANDING',
- },
- }, { # else branding!="Chrome"
- 'variables': {
- 'branding_path': '../chrome/app/theme/chromium/BRANDING',
- },
- }],
- ],
- 'inputs': [
- '<(template_input_path)',
- '<(version_path)',
- '<(branding_path)',
- ],
- 'outputs': [
- '<(INTERMEDIATE_DIR)/chrome_tab_version.rc',
- ],
- 'action': [
- 'python',
- '<(version_py)',
- '-f', '<(version_path)',
- '-f', '<(branding_path)',
- '-f', '<(lastchange_path)',
- '<(template_input_path)',
- '<@(_outputs)',
- ],
- 'process_outputs_as_sources': 1,
- 'message': 'Generating version information in <(_outputs)'
- },
- ],
},
],
}
diff --git a/chrome_frame/chrome_tab_version.rc b/chrome_frame/chrome_tab_version.rc
new file mode 100644
index 0000000..e9d38a1
--- /dev/null
+++ b/chrome_frame/chrome_tab_version.rc
@@ -0,0 +1,52 @@
+#include "version.h"
+
+#ifdef APSTUDIO_INVOKED
+# error Don't open this in the GUI, it'll be massacred on save.
+#endif // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION CHROME_VERSION
+ PRODUCTVERSION CHROME_VERSION
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ // Note that Firefox 3.0 requires the charset to be 04e4 (multi-lingual).
+ BLOCK "040904e4"
+ BEGIN
+ VALUE "CompanyName", COMPANY_FULLNAME_STRING
+ VALUE "CompanyShortName", COMPANY_SHORTNAME_STRING
+ VALUE "ProductName", "Google Chrome Frame"
+ VALUE "ProductShortName", "ChromeFrame"
+ VALUE "ProductVersion", CHROME_VERSION_STRING
+ VALUE "FileDescription", "Chrome Frame renders the Web of the future in the browsers of the past. It's like strapping a rocket engine to a minivan."
+ VALUE "FileVersion", CHROME_VERSION_STRING
+ VALUE "InternalName", "Google Chrome Frame"
+ VALUE "LegalCopyright", COPYRIGHT_STRING
+ VALUE "MIMEType", "application/chromeframe"
+ VALUE "FileExtents", "chromeframe"
+ VALUE "FileOpenName", "chromeframe"
+ VALUE "OriginalFilename", "npchrome_frame.dll"
+ VALUE "LastChange", LASTCHANGE_STRING
+ VALUE "Official Build", OFFICIAL_BUILD_STRING
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ // Note that Firefox 3.0 requires the charset to be 1252 (multi-lingual).
+ VALUE "Translation", 0x409, 1252
+ END
+END
diff --git a/chrome_frame/chrome_tab_version.rc.version b/chrome_frame/chrome_tab_version.rc.version
index 52312ff..e69de29 100644
--- a/chrome_frame/chrome_tab_version.rc.version
+++ b/chrome_frame/chrome_tab_version.rc.version
@@ -1,46 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION @MAJOR@,@MINOR@,@BUILD@,@PATCH@
- PRODUCTVERSION @MAJOR@,@MINOR@,@BUILD@,@PATCH@
- FILEFLAGSMASK 0x17L
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- // Note that Firefox 3.0 requires the charset to be 04e4 (multi-lingual).
- BLOCK "040904e4"
- BEGIN
- VALUE "CompanyName", "@COMPANY_FULLNAME@"
- VALUE "CompanyShortName", "@COMPANY_SHORTNAME@"
- VALUE "ProductName", "Google Chrome Frame"
- VALUE "ProductShortName", "ChromeFrame"
- VALUE "ProductVersion", "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
- VALUE "FileDescription", "Chrome Frame renders the Web of the future in the browsers of the past. It's like strapping a rocket engine to a minivan."
- VALUE "FileVersion", "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
- VALUE "InternalName", "Google Chrome Frame"
- VALUE "LegalCopyright", "@COPYRIGHT@"
- VALUE "MIMEType", "application/chromeframe"
- VALUE "FileExtents", "chromeframe"
- VALUE "FileOpenName", "chromeframe"
- VALUE "OriginalFilename", "npchrome_frame.dll"
- VALUE "LastChange", "@LASTCHANGE@"
- VALUE "Official Build", "@OFFICIAL_BUILD@"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- // Note that Firefox 3.0 requires the charset to be 1252 (multi-lingual).
- VALUE "Translation", 0x409, 1252
- END
-END