Generate header file of Linux version information (currently gyp-only).

This isn't yet #included in file_version_info_linux.cc since we haven't
officially cutover to the gyp build.

BUG=8132

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


git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12369 0039d316-1c4b-4281-b951-d872f2087c98
Esse commit está contido em:
mmoss@chromium.org
2009-03-24 18:03:55 +00:00
commit 8072db4100
3 arquivos alterados com 106 adições e 0 exclusões
+30
Ver Arquivo
@@ -320,6 +320,36 @@
],
'conditions': [
[ 'OS == "linux"', {
'actions': [
{
'action_name': 'linux_version',
'variables': {
'template_input_path': 'file_version_info_linux.h.version'
},
'inputs': [
'<(template_input_path)',
'../chrome/VERSION',
'../chrome/tools/build/linux/version.sh',
],
'conditions': [
[ 'branding == "Chrome"', {
'inputs': ['../chrome/app/theme/google_chrome/BRANDING']
}, { # else branding!="Chrome"
'inputs': ['../chrome/app/theme/chromium/BRANDING']
}],
],
'outputs': [
'<(INTERMEDIATE_DIR)/base/file_version_info_linux.h',
],
'action': [
'../chrome/tools/build/linux/version.sh',
'<(template_input_path)', '<@(_outputs)', '../chrome'
],
},
],
'include_dirs': [
'<(INTERMEDIATE_DIR)',
],
'sources/': [ ['exclude', '_(mac|win)\\.cc$'],
['exclude', '\\.mm?$' ] ],
'sources!': [
+26
Ver Arquivo
@@ -0,0 +1,26 @@
// Copyright (c) 2009 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.
#ifndef BASE_FILE_VERSION_INFO_LINUX_H_
#define BASE_FILE_VERSION_INFO_LINUX_H_
#define COMPANY_NAME L"@COMPANY_FULLNAME@"
#define FILE_DESCRIPTION L"@PRODUCT_FULLNAME@"
#define FILE_VERSION L"@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
#define LEGAL_COPYRIGHT L"@COPYRIGHT@"
#define PRODUCT_NAME L"@PRODUCT_FULLNAME@"
#define PRODUCT_VERSION L"@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
#define COMPANY_SHORT_NAME L"@COMPANY_SHORTNAME@"
#define PRODUCT_SHORT_NAME L"@PRODUCT_SHORTNAME@"
#define LAST_CHANGE L"@LASTCHANGE@"
#define OFFICIAL_BUILD @OFFICIAL_BUILD@
// TODO(mmoss) Do these have values for Linux?
#define INTERNAL_NAME L""
#define ORIGINAL_FILENAME L""
#define PRIVATE_BUILD L""
#define SPECIAL_BUILD L""
#define COMMENTS L""
#define LEGAL_TRADEMARKS L""
#endif // BASE_FILE_VERSION_INFO_LINUX_H_
+50
Ver Arquivo
@@ -0,0 +1,50 @@
#!/bin/sh
#
# Copyright (c) 2009 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.
# TODO(mmoss) This is (mostly) just a conversion to sh syntax of
# tools/build/win/version.bat. Rewrite both as common python.
TMPL="$1"
OUTFILE="$2"
CHROMEDIR="$3"
# Load version digits as environment variables.
source "$CHROMEDIR/VERSION"
# Load branding strings as environment variables
DISTRIBUTION="chromium"
if [ "$CHROMIUM_BUILD" = "_google_chrome" ]; then
DISTRIBUTION="google_chrome"
fi
# Make sure the string values are quoted.
eval $(sed -e 's/\([^=]*\)=\(.*\)/\1="\2"/' \
"$CHROMEDIR/app/theme/$DISTRIBUTION/BRANDING")
# Determine the current repository revision number.
LASTCHANGE=$(svn info 2>/dev/null | grep "Revision:" | cut -d" " -f2-)
if [ -z "$LASTCHANGE" ]; then
# Maybe it's a git client
LASTCHANGE=$(git-svn info 2>/dev/null | grep "Revision:" | cut -d" " -f2-)
fi
OFFICIAL_BUILD="false"
if [ "$CHROME_BUILD_TYPE" = "_official" ]; then
OFFICIAL_BUILD="true"
fi
# TODO(mmoss) Make sure no sed special chars in substitutions.
sed -e "s/@MAJOR@/$MAJOR/" \
-e "s/@MINOR@/$MINOR/" \
-e "s/@BUILD@/$BUILD/" \
-e "s/@PATCH@/$PATCH/" \
-e "s/@COMPANY_FULLNAME@/$COMPANY_FULLNAME/" \
-e "s/@COMPANY_SHORTNAME@/$COMPANY_SHORTNAME/" \
-e "s/@PRODUCT_FULLNAME@/$PRODUCT_FULLNAME/" \
-e "s/@PRODUCT_SHORTNAME@/$PRODUCT_SHORTNAME/" \
-e "s/@PRODUCT_EXE@/$PRODUCT_EXE/" \
-e "s/@COPYRIGHT@/$COPYRIGHT/" \
-e "s/@OFFICIAL_BUILD@/$OFFICIAL_BUILD/" \
-e "s/@LASTCHANGE@/$LASTCHANGE/" "$TMPL" > "$OUTFILE"