diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index 67431e3775835f..4693d6c2c23c12 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -425,22 +425,6 @@ group("child_dependencies") { } if (is_win) { - # TODO(brettw) this duplicates "//chrome/common:version" which applies to - # Linux. - process_version("version_header") { - # TODO(brettW) this should have more reduced visibility, but chrome/browser - # currently depends on this. - #visibility = [ ":*" ] - - # This one just uses the custom template and no separate sources. - sources = [] - template_file = "version.h.in" - - # TODO(brettw) this should move to $target_gen_dir/version.h and - # source files including it should reference it via "chrome/version.h" - output = "$root_gen_dir/version.h" - } - process_version("chrome_exe_version") { template_file = chrome_version_rc_template sources = [ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index cbe30c53db0f83..758104a099d1c4 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn @@ -766,7 +766,7 @@ source_set("browser") { ] deps += [ ":chrome_process_finder", - "//chrome:version_header", + "//chrome/common:version_header", "//chrome/installer/util:strings", "//chrome_elf", "//chrome_elf:constants", diff --git a/chrome/browser/chrome_elf_init_unittest_win.cc b/chrome/browser/chrome_elf_init_unittest_win.cc index dc32585fb70f69..0b3e806e4c92c0 100644 --- a/chrome/browser/chrome_elf_init_unittest_win.cc +++ b/chrome/browser/chrome_elf_init_unittest_win.cc @@ -10,13 +10,13 @@ #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "base/test/test_reg_util_win.h" +#include "chrome/common/chrome_version.h" #include "chrome_elf/chrome_elf_constants.h" #include "components/variations/entropy_provider.h" #include "components/variations/variations_associated_data.h" #include "components/version_info/version_info.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" -#include "version.h" // NOLINT namespace { diff --git a/chrome/browser/chrome_elf_init_win.cc b/chrome/browser/chrome_elf_init_win.cc index 3d568a69a46ae3..28af7f8228ac56 100644 --- a/chrome/browser/chrome_elf_init_win.cc +++ b/chrome/browser/chrome_elf_init_win.cc @@ -9,12 +9,12 @@ #include "base/strings/utf_string_conversions.h" #include "base/win/registry.h" #include "chrome/browser/chrome_elf_init_win.h" +#include "chrome/common/chrome_version.h" #include "chrome_elf/blacklist/blacklist.h" #include "chrome_elf/chrome_elf_constants.h" #include "chrome_elf/dll_hash/dll_hash.h" #include "components/variations/variations_associated_data.h" #include "content/public/browser/browser_thread.h" -#include "version.h" // NOLINT const char kBrowserBlacklistTrialName[] = "BrowserBlacklist"; const char kBrowserBlacklistTrialDisabledGroupName[] = "NoBlacklist"; diff --git a/chrome/browser/google/google_update_win_unittest.cc b/chrome/browser/google/google_update_win_unittest.cc index 700c10cfbeb3c7..16d23624198c56 100644 --- a/chrome/browser/google/google_update_win_unittest.cc +++ b/chrome/browser/google/google_update_win_unittest.cc @@ -22,6 +22,7 @@ #include "base/version.h" #include "base/win/registry.h" #include "base/win/scoped_comptr.h" +#include "chrome/common/chrome_version.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/google_update_settings.h" #include "chrome/installer/util/helper.h" @@ -29,7 +30,6 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/win/atl_module.h" -#include "version.h" using ::testing::DoAll; using ::testing::HasSubstr; diff --git a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc index 1a61a474682422..e2013cb46fb1fc 100644 --- a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc +++ b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc @@ -7,7 +7,7 @@ #include "base/files/file_path.h" #include "base/logging.h" #include "base/path_service.h" -#include "version.h" // NOLINT +#include "chrome/common/chrome_version.h" namespace safe_browsing { diff --git a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win_unittest.cc index 9ef043b27e65b6..b2055f162b5a1f 100644 --- a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win_unittest.cc +++ b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win_unittest.cc @@ -13,10 +13,10 @@ #include "chrome/browser/safe_browsing/incident_reporting/incident.h" #include "chrome/browser/safe_browsing/incident_reporting/mock_incident_receiver.h" #include "chrome/common/chrome_paths.h" +#include "chrome/common/chrome_version.h" #include "chrome/common/safe_browsing/csd.pb.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "version.h" // NOLINT using ::testing::_; using ::testing::StrictMock; diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 5fae3f0a61a3d5..c9986e18bf93c5 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -414,41 +414,6 @@ 'version_resource_rules.gypi', ], }, - { - # GN version: //chrome:version_header - 'target_name': 'chrome_version_header', - 'type': 'none', - 'hard_dependency': 1, - 'actions': [ - { - 'action_name': 'version_header', - 'variables': { - 'lastchange_path': - '<(DEPTH)/build/util/LASTCHANGE', - 'branding_path': 'app/theme/<(branding_path_component)/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': 'crash_service', 'type': 'executable', diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 57f1400c87400d..6f9221ccfe4b7d 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -3731,7 +3731,7 @@ 'chrome_process_finder', 'chrome_watcher_client', 'installer_util_strings', - '../chrome/chrome.gyp:chrome_version_header', + '../chrome/common_constants.gyp:version_header', '../chrome_elf/chrome_elf.gyp:chrome_elf', '../chrome_elf/chrome_elf.gyp:chrome_elf_constants', '../chrome_elf/chrome_elf.gyp:dll_hash', diff --git a/chrome/chrome_installer.gypi b/chrome/chrome_installer.gypi index b7b6a3c68071d4..9811b15f93b182 100644 --- a/chrome/chrome_installer.gypi +++ b/chrome/chrome_installer.gypi @@ -214,12 +214,12 @@ 'target_name': 'setup', 'type': 'executable', 'dependencies': [ - 'chrome_version_header', 'installer_util', 'installer_util_strings', '../base/base.gyp:base', '../breakpad/breakpad.gyp:breakpad_handler', '../chrome/common_constants.gyp:common_constants', + '../chrome/common_constants.gyp:version_header', '../chrome_elf/chrome_elf.gyp:chrome_elf_constants', '../rlz/rlz.gyp:rlz_lib', '../third_party/zlib/zlib.gyp:zlib', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 4ba21b9268b334..a3b0e193c5b2ac 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1962,6 +1962,7 @@ 'hard_dependency': 1, 'dependencies': [ 'automation_client_lib', + 'common_constants.gyp:version_header', '../base/base.gyp:base', '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '../crypto/crypto.gyp:crypto', diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index e1f8f3a3939bc1..97019946ded0b3 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn @@ -36,7 +36,7 @@ if (enable_extensions) { } } -# GYP version: chrome/chrome_common.gyp:common +# GYP version: chrome/chrome_common.gypi:common static_library("common") { sources = rebase_path(gypi_values.chrome_common_sources, ".", "//chrome") defines = [] @@ -269,12 +269,20 @@ static_library("common") { } } -process_version("make_chrome_version") { - template_file = "chrome_version.cc.version" - output = "$target_gen_dir/chrome_version.cc" +# GYP version: chrome/common_constants.gyp:version_header +process_version("version_header") { + # TODO(brettw) this should have more reduced visibility, but chrome/browser + # currently depends on this. + #visibility = [ ":*" ] + + # This one just uses the custom template and no separate sources. + sources = [] + template_file = "chrome_version.h.in" + + output = "$target_gen_dir/chrome_version.h" } -# GN version: chrome/common_constants.gyp:common_constants +# GYP version: chrome/common_constants.gyp:common_constants static_library("constants") { sources = [ "chrome_constants.cc", @@ -303,7 +311,7 @@ static_library("constants") { "//content/public/common:result_codes", ] deps = [ - ":make_chrome_version", + ":version_header", "//base", "//base/third_party/dynamic_annotations", "//components/bookmarks/common", diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc index 31fcdc8acd1442..206f8e2238feb1 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/common/chrome_constants.h" +#include "chrome/common/chrome_version.h" #define FPL FILE_PATH_LITERAL @@ -19,6 +20,8 @@ namespace chrome { +const char kChromeVersion[] = CHROME_VERSION_STRING; + #if defined(OS_WIN) const char kChromeVersionEnvVar[] = "CHROME_VERSION"; #endif diff --git a/chrome/common/chrome_version.cc.version b/chrome/common/chrome_version.cc.version deleted file mode 100644 index 54e062bb931046..00000000000000 --- a/chrome/common/chrome_version.cc.version +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2015 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. - -#include "chrome/common/chrome_constants.h" - -namespace chrome { - -const char kChromeVersion[] = "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"; - -} // namespace chrome diff --git a/chrome/version.h.in b/chrome/common/chrome_version.h.in similarity index 100% rename from chrome/version.h.in rename to chrome/common/chrome_version.h.in diff --git a/chrome/common_constants.gyp b/chrome/common_constants.gyp index 4e79cdd3319431..134878ea22c8ce 100644 --- a/chrome/common_constants.gyp +++ b/chrome/common_constants.gyp @@ -5,14 +5,7 @@ { 'variables': { 'chromium_code': 1, - }, - - 'includes': [ - '../build/util/version.gypi', - ], - - 'target_defaults': { - 'sources': [ + 'common_constants_sources': [ 'common/chrome_constants.cc', 'common/chrome_constants.h', 'common/chrome_icon_resources_win.cc', @@ -33,43 +26,60 @@ 'common/pref_names.cc', 'common/pref_names.h', ], - 'actions': [ - { - 'action_name': 'Make chrome_version.cc', - 'variables': { - 'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE', - 'template_input_path': 'common/chrome_version.cc.version', - }, - 'inputs': [ - '<(version_py_path)', - '<(version_path)', - '<(lastchange_path)', - '<(template_input_path)', - ], - 'outputs': [ - '<(INTERMEDIATE_DIR)/chrome_version.cc', - ], - 'action': [ - 'python', - '<(version_py_path)', - '-f', '<(version_path)', - '-f', '<(lastchange_path)', - '<(template_input_path)', - '<@(_outputs)', - ], - 'process_outputs_as_sources': 1, - }, - ], }, + + 'includes': [ + '../build/util/version.gypi', + ], + 'targets': [ + { + # GN version: //chrome/common:version_header + 'target_name': 'version_header', + 'type': 'none', + 'hard_dependency': 1, + 'actions': [ + { + 'action_name': 'version_header', + 'variables': { + 'lastchange_path': + '<(DEPTH)/build/util/LASTCHANGE', + 'branding_path': 'app/theme/<(branding_path_component)/BRANDING', + }, + 'inputs': [ + '<(version_path)', + '<(branding_path)', + '<(lastchange_path)', + 'common/chrome_version.h.in', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/chrome/common/chrome_version.h', + ], + 'action': [ + 'python', + '<(version_py_path)', + '-f', '<(version_path)', + '-f', '<(branding_path)', + '-f', '<(lastchange_path)', + 'common/chrome_version.h.in', + '<@(_outputs)', + ], + 'message': 'Generating version header file: <@(_outputs)', + }, + ], + }, { # GN version: //chrome/common:constants 'target_name': 'common_constants', 'type': 'static_library', + 'sources': [ + '<@(common_constants_sources)' + ], 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)', # Needed by chrome_paths.cc. ], 'dependencies': [ + 'version_header', '../base/base.gyp:base', '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '../components/components.gyp:bookmarks_common', @@ -99,10 +109,14 @@ { 'target_name': 'common_constants_win64', 'type': 'static_library', + 'sources': [ + '<@(common_constants_sources)' + ], 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)', # Needed by chrome_paths.cc. ], 'dependencies': [ + 'version_header', '../base/base.gyp:base_win64', '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64', '../components/nacl.gyp:nacl_switches_win64', diff --git a/chrome/installer/setup/BUILD.gn b/chrome/installer/setup/BUILD.gn index c09138eab888d7..8a9fde9f01cb7f 100644 --- a/chrome/installer/setup/BUILD.gn +++ b/chrome/installer/setup/BUILD.gn @@ -23,7 +23,7 @@ if (is_win) { deps = [ ":lib", "//build/config/sanitizers:deps", - "//chrome:version_header", + "//chrome/common:version_header", ] } diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index ae5065920ecb9e..94cab45ba3f589 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -40,6 +40,7 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/chrome_version.h" #include "chrome/installer/setup/archive_patch_helper.h" #include "chrome/installer/setup/install.h" #include "chrome/installer/setup/install_worker.h" @@ -68,7 +69,6 @@ #include "chrome/installer/util/self_cleaning_temp_dir.h" #include "chrome/installer/util/shell_util.h" #include "chrome/installer/util/user_experiment.h" -#include "version.h" // NOLINT #if defined(GOOGLE_CHROME_BUILD) #include "chrome/installer/util/updating_app_registration_data.h" diff --git a/chrome_elf/BUILD.gn b/chrome_elf/BUILD.gn index 64f5b7b32f3fc4..1a1af75ad312bb 100644 --- a/chrome_elf/BUILD.gn +++ b/chrome_elf/BUILD.gn @@ -90,7 +90,7 @@ source_set("breakpad") { deps = [ ":common", "//breakpad:breakpad_handler", - "//chrome:version_header", + "//chrome/common:version_header", ] } diff --git a/chrome_elf/DEPS b/chrome_elf/DEPS index 495665e10bf217..d838479ebeab7b 100644 --- a/chrome_elf/DEPS +++ b/chrome_elf/DEPS @@ -1,4 +1,5 @@ include_rules = [ "+sandbox", "+breakpad/src/client", + "+chrome/common/chrome_version.h", ] diff --git a/chrome_elf/blacklist/test/blacklist_test.cc b/chrome_elf/blacklist/test/blacklist_test.cc index b8f1ea210a0dcc..09d6a730c2bc08 100644 --- a/chrome_elf/blacklist/test/blacklist_test.cc +++ b/chrome_elf/blacklist/test/blacklist_test.cc @@ -13,11 +13,11 @@ #include "base/strings/utf_string_conversions.h" #include "base/test/test_reg_util_win.h" #include "base/win/registry.h" +#include "chrome/common/chrome_version.h" #include "chrome_elf/blacklist/blacklist.h" #include "chrome_elf/blacklist/test/blacklist_test_main_dll.h" #include "chrome_elf/chrome_elf_constants.h" #include "testing/gtest/include/gtest/gtest.h" -#include "version.h" // NOLINT const wchar_t kTestDllName1[] = L"blacklist_test_dll_1.dll"; const wchar_t kTestDllName2[] = L"blacklist_test_dll_2.dll"; diff --git a/chrome_elf/breakpad.cc b/chrome_elf/breakpad.cc index 3c95a4f8acba4a..d67b5dceb31e98 100644 --- a/chrome_elf/breakpad.cc +++ b/chrome_elf/breakpad.cc @@ -11,8 +11,8 @@ #include "base/macros.h" #include "breakpad/src/client/windows/handler/exception_handler.h" +#include "chrome/common/chrome_version.h" #include "chrome_elf/chrome_elf_util.h" -#include "version.h" // NOLINT google_breakpad::ExceptionHandler* g_elf_breakpad = NULL; diff --git a/chrome_elf/chrome_elf.gyp b/chrome_elf/chrome_elf.gyp index cbbb4b4b580717..5b7998dc289d75 100644 --- a/chrome_elf/chrome_elf.gyp +++ b/chrome_elf/chrome_elf.gyp @@ -165,7 +165,7 @@ 'dependencies': [ 'chrome_elf_common', '../breakpad/breakpad.gyp:breakpad_handler', - '../chrome/chrome.gyp:chrome_version_header', + '../chrome/common_constants.gyp:version_header', ], }, ], # targets @@ -202,4 +202,3 @@ }], ], } - diff --git a/cloud_print/cloud_print_resources.gyp b/cloud_print/cloud_print_resources.gyp index 8ebd5cdd9ac15a..aba2e1effdd9f6 100644 --- a/cloud_print/cloud_print_resources.gyp +++ b/cloud_print/cloud_print_resources.gyp @@ -68,7 +68,7 @@ '<(version_path)', '<(branding_path)', '<(lastchange_path)', - '<(DEPTH)/chrome/version.h.in', + '<(DEPTH)/chrome/common/chrome_version.h.in', 'BRANDING', ], 'outputs': [ @@ -81,7 +81,7 @@ '-f', '<(branding_path)', '-f', '<(lastchange_path)', '-f', 'BRANDING', - '<(DEPTH)/chrome/version.h.in', + '<(DEPTH)/chrome/common/chrome_version.h.in', '<@(_outputs)', ], 'message': 'Generating version header file: <@(_outputs)', diff --git a/cloud_print/service/service.gyp b/cloud_print/service/service.gyp index a6171a897e3d6c..1b8396f25014b9 100644 --- a/cloud_print/service/service.gyp +++ b/cloud_print/service/service.gyp @@ -60,9 +60,9 @@ 'conditions': [ ['OS=="win"', { 'dependencies': [ - '<(DEPTH)/chrome/chrome.gyp:chrome_version_header', '<(DEPTH)/chrome/chrome.gyp:launcher_support', '<(DEPTH)/chrome/common_constants.gyp:common_constants', + '<(DEPTH)/chrome/common_constants.gyp:version_header', ], }], ['OS=="win" and clang==1', { diff --git a/cloud_print/virtual_driver/win/port_monitor/BUILD.gn b/cloud_print/virtual_driver/win/port_monitor/BUILD.gn index f6e727f6df2efb..4365337dc61345 100644 --- a/cloud_print/virtual_driver/win/port_monitor/BUILD.gn +++ b/cloud_print/virtual_driver/win/port_monitor/BUILD.gn @@ -26,8 +26,8 @@ shared_library("port_monitor") { ":lib", ":resources", "//base", - "//chrome:version_header", "//chrome/common:constants", + "//chrome/common:version_header", ] libs = [ "userenv.lib" ] diff --git a/cloud_print/virtual_driver/win/virtual_driver.gypi b/cloud_print/virtual_driver/win/virtual_driver.gypi index 159588343af605..886f746e7d7808 100644 --- a/cloud_print/virtual_driver/win/virtual_driver.gypi +++ b/cloud_print/virtual_driver/win/virtual_driver.gypi @@ -51,7 +51,7 @@ ], 'dependencies': [ 'gcp_portmon_lib<(virtual_driver_suffix)', - '<(DEPTH)/chrome/chrome.gyp:chrome_version_header', + '<(DEPTH)/chrome/common_constants.gyp:version_header', '<(DEPTH)/cloud_print/cloud_print_resources.gyp:cloud_print_version_resources', ], 'include_dirs': [