Include version information in Linux chrome.
This makes use of, and scons-enables, the Linux version header in Issue 45028. BUG=8132 Review URL: http://codereview.chromium.org/42542 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12387 0039d316-1c4b-4281-b951-d872f2087c98
Esse commit está contido em:
+9
-3
@@ -324,7 +324,9 @@
|
||||
{
|
||||
'action_name': 'linux_version',
|
||||
'variables': {
|
||||
'template_input_path': 'file_version_info_linux.h.version'
|
||||
'template_input_path': 'file_version_info_linux.h.version',
|
||||
'template_output_path':
|
||||
'<(INTERMEDIATE_DIR)/base/file_version_info_linux.h',
|
||||
},
|
||||
'inputs': [
|
||||
'<(template_input_path)',
|
||||
@@ -339,11 +341,15 @@
|
||||
}],
|
||||
],
|
||||
'outputs': [
|
||||
'<(INTERMEDIATE_DIR)/base/file_version_info_linux.h',
|
||||
# Use a non-existant output so this action always runs and
|
||||
# generates version information, e.g. to capture revision
|
||||
# changes, which aren't captured by file dependencies.
|
||||
'<(INTERMEDIATE_DIR)/base/file_version_info_linux.bogus',
|
||||
],
|
||||
'action': [
|
||||
'../chrome/tools/build/linux/version.sh',
|
||||
'<(template_input_path)', '<@(_outputs)', '../chrome'
|
||||
'<(template_input_path)', '<(template_output_path)',
|
||||
'../chrome'
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -404,6 +404,17 @@ if env.Bit('linux'):
|
||||
'worker_pool_linux.cc',
|
||||
])
|
||||
|
||||
linux_version = env.Command('$BASE_DIR/file_version_info_linux.h',
|
||||
'file_version_info_linux.h.version',
|
||||
('../chrome/tools/build/linux/version.sh'
|
||||
' ${SOURCE}'
|
||||
' ${TARGET}'
|
||||
' ../chrome'))
|
||||
env.AlwaysBuild(linux_version)
|
||||
# Always generate version information, e.g. to capture revision changes, which
|
||||
# aren't captured by file dependencies.
|
||||
env.Append(CPPPATH = ['$OBJ_ROOT'])
|
||||
|
||||
env.ChromeLibrary('base', input_files)
|
||||
|
||||
p = env.ChromeMSVSProject('build/base.vcproj',
|
||||
|
||||
@@ -3,13 +3,12 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "base/file_version_info.h"
|
||||
#include "base/file_version_info_linux.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
// TODO(port): This whole file is stubbed. We can't return NULL
|
||||
// because that is used as a catastrophic error code where the file
|
||||
// doesn't exist or can't be opened.
|
||||
//
|
||||
// TODO(mmoss) This only provides version info for the current binary, but it's
|
||||
// also called for arbitrary files (e.g. plugins).
|
||||
// See http://code.google.com/p/chromium/issues/detail?id=8132 for a discussion
|
||||
// on what we should do with this module.
|
||||
|
||||
@@ -23,65 +22,65 @@ FileVersionInfo* FileVersionInfo::CreateFileVersionInfoForCurrentModule() {
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::company_name() {
|
||||
return L"";
|
||||
return COMPANY_NAME;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::company_short_name() {
|
||||
return L"";
|
||||
return COMPANY_SHORT_NAME;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::product_name() {
|
||||
return L"";
|
||||
return PRODUCT_NAME;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::product_short_name() {
|
||||
return L"";
|
||||
return PRODUCT_SHORT_NAME;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::internal_name() {
|
||||
return L"";
|
||||
return INTERNAL_NAME;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::product_version() {
|
||||
return L"0.1.2.3.4.5.6-lie";
|
||||
return PRODUCT_VERSION;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::private_build() {
|
||||
return L"";
|
||||
return PRIVATE_BUILD;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::special_build() {
|
||||
return L"";
|
||||
return SPECIAL_BUILD;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::comments() {
|
||||
return L"";
|
||||
return COMMENTS;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::original_filename() {
|
||||
return L"";
|
||||
return ORIGINAL_FILENAME;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::file_description() {
|
||||
return L"";
|
||||
return FILE_DESCRIPTION;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::file_version() {
|
||||
return L"0.1.2.3.4.5.6-lie";
|
||||
return FILE_VERSION;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::legal_copyright() {
|
||||
return L"";
|
||||
return LEGAL_COPYRIGHT;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::legal_trademarks() {
|
||||
return L"";
|
||||
return LEGAL_TRADEMARKS;
|
||||
}
|
||||
|
||||
std::wstring FileVersionInfo::last_change() {
|
||||
return L"Last Thursday";
|
||||
return LAST_CHANGE;
|
||||
}
|
||||
|
||||
bool FileVersionInfo::is_official_build() {
|
||||
return false;
|
||||
return OFFICIAL_BUILD;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,14 @@ if [ "$CHROME_BUILD_TYPE" = "_official" ]; then
|
||||
OFFICIAL_BUILD="true"
|
||||
fi
|
||||
|
||||
# Write to a temp file and only overwrite the target if it changes, to avoid
|
||||
# unnecessary compiles due to timestamp changes.
|
||||
TMPFILE=$(mktemp -q -t chromiumver-XXXX)
|
||||
if [ $? -ne 0 ]; then
|
||||
# Oops, just use the target file and suffer possibly unnecessary compile.
|
||||
TMPFILE="$OUTFILE"
|
||||
fi
|
||||
|
||||
# TODO(mmoss) Make sure no sed special chars in substitutions.
|
||||
sed -e "s/@MAJOR@/$MAJOR/" \
|
||||
-e "s/@MINOR@/$MINOR/" \
|
||||
@@ -47,4 +55,11 @@ sed -e "s/@MAJOR@/$MAJOR/" \
|
||||
-e "s/@PRODUCT_EXE@/$PRODUCT_EXE/" \
|
||||
-e "s/@COPYRIGHT@/$COPYRIGHT/" \
|
||||
-e "s/@OFFICIAL_BUILD@/$OFFICIAL_BUILD/" \
|
||||
-e "s/@LASTCHANGE@/$LASTCHANGE/" "$TMPL" > "$OUTFILE"
|
||||
-e "s/@LASTCHANGE@/$LASTCHANGE/" "$TMPL" > "$TMPFILE"
|
||||
|
||||
diff -q "$TMPFILE" "$OUTFILE" >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
mv -f "$TMPFILE" "$OUTFILE"
|
||||
else
|
||||
rm "$TMPFILE"
|
||||
fi
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário