| # Copyright 2019 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. |
| |
| import("//build/config/chrome_build.gni") |
| import("//build/config/sanitizers/sanitizers.gni") |
| import("//build/util/process_version.gni") |
| import("//chrome/updater/branding.gni") |
| import("//testing/test.gni") |
| |
| # Run 'gn check out\Default --check-generated //chrome/updater/*' every time |
| # dependencies are modified until a presubmit is written to automatically |
| # check that the C++ includes match the build dependency graph. |
| |
| set_sources_assignment_filter([]) |
| |
| # TODO(sorin): make the code build on Linux. https://crbug.com/1014320 |
| group("updater") { |
| if (is_win) { |
| deps = [ "//chrome/updater/win" ] |
| } |
| if (is_mac) { |
| deps = [ "//chrome/updater/mac" ] |
| } |
| if (is_win || is_mac) { |
| deps += [ "//chrome/updater/tools:tools" ] |
| } |
| } |
| |
| # Conditional build is needed, otherwise the analyze script on Linux |
| # requires all targets and it is going to include the targets below. |
| if (is_win || is_mac) { |
| # This target must only have platform-neutral sources. Generally speaking, |
| # these sources are related to common, cross-platfrom aspects of the code, |
| # such as crash handling, or interfaces to cross platform dependencies from |
| # Chromium. If the sources are in platform-specific directories or their |
| # names contain platform-specific suffixes, they must go into the :lib |
| # target, or to targets in their platform directories. |
| source_set("base") { |
| sources = [ |
| "action_handler.h", |
| "constants.cc", |
| "constants.h", |
| "crash_client.cc", |
| "crash_client.h", |
| "crash_reporter.cc", |
| "crash_reporter.h", |
| "patcher.cc", |
| "patcher.h", |
| "persisted_data.cc", |
| "persisted_data.h", |
| "policy_manager.cc", |
| "policy_manager.h", |
| "registration_data.cc", |
| "registration_data.h", |
| "unzipper.cc", |
| "unzipper.h", |
| "update_service.cc", |
| "update_service.h", |
| "util.cc", |
| "util.h", |
| ] |
| |
| deps = [ |
| ":version_header", |
| "//base", |
| "//components/crash/core/common:crash_key_lib", |
| "//components/prefs", |
| "//components/update_client", |
| "//courgette:bsdiff", |
| "//courgette:courgette_lib", |
| "//third_party/crashpad/crashpad/client", |
| "//third_party/crashpad/crashpad/handler", |
| "//third_party/zlib/google:zip", |
| "//url", |
| ] |
| } |
| |
| # Use this source set for code which has platform-specific modules. |
| source_set("lib") { |
| sources = [ |
| "app/app.cc", |
| "app/app.h", |
| "app/app_server.cc", |
| "app/app_server.h", |
| "app/app_uninstall.cc", |
| "app/app_uninstall.h", |
| "app/app_wake.cc", |
| "app/app_wake.h", |
| "configurator.cc", |
| "configurator.h", |
| "dm_cached_policy_info.cc", |
| "dm_cached_policy_info.h", |
| "dm_policy_manager.cc", |
| "dm_policy_manager.h", |
| "dm_storage.cc", |
| "dm_storage.h", |
| "external_constants.cc", |
| "external_constants.h", |
| "external_constants_impl.h", |
| "installer.cc", |
| "installer.h", |
| "lib_util.h", |
| "prefs.cc", |
| "prefs.h", |
| "prefs_impl.h", |
| "tag.cc", |
| "tag.h", |
| "update_apps.h", |
| "update_service_in_process.cc", |
| "update_service_in_process.h", |
| "updater.cc", |
| "updater.h", |
| ] |
| |
| if (is_mac) { |
| sources += [ |
| "app/server/mac/app_server.h", |
| "app/server/mac/server.h", |
| "app/server/mac/server.mm", |
| "app/server/mac/service_delegate.h", |
| "app/server/mac/service_delegate.mm", |
| "app/server/mac/service_protocol.mm", |
| "app/server/mac/update_service_wrappers.h", |
| "app/server/mac/update_service_wrappers.mm", |
| "dm_storage_mac.mm", |
| "external_constants_mac.mm", |
| "installer_mac.cc", |
| "lib_util_mac.mm", |
| "mac/update_service_out_of_process.h", |
| "mac/update_service_out_of_process.mm", |
| "prefs_mac.mm", |
| "update_apps_mac.mm", |
| ] |
| } |
| |
| if (is_win) { |
| sources += [ |
| "app/server/win/com_classes.cc", |
| "app/server/win/com_classes.h", |
| "app/server/win/com_classes_legacy.cc", |
| "app/server/win/com_classes_legacy.h", |
| "app/server/win/server.cc", |
| "app/server/win/server.h", |
| "app/server/win/service_main.cc", |
| "app/server/win/service_main.h", |
| "dm_storage_win.cc", |
| "external_constants_win.cc", |
| "installer_win.cc", |
| "lib_util_win.cc", |
| "prefs_win.cc", |
| "update_apps_win.cc", |
| ] |
| } |
| |
| deps = [ |
| ":base", |
| ":version_header", |
| "//base", |
| "//chrome/updater/protos:omaha_proto", |
| "//components/crash/core/common:crash_key", |
| "//components/crx_file:crx_file", |
| "//components/prefs", |
| "//components/update_client", |
| "//components/version_info", |
| "//url", |
| ] |
| public_deps = [ "//components/policy/proto" ] |
| |
| if (is_win) { |
| deps += [ |
| "//chrome/updater/app/server/win:updater_idl_idl", |
| "//chrome/updater/win:constants", |
| "//chrome/updater/win:lib", |
| ] |
| } |
| |
| if (is_mac) { |
| deps += [ |
| "//chrome/updater/app/server/mac:protocol", |
| "//chrome/updater/mac:installer_sources", |
| "//chrome/updater/mac:network_fetcher_sources", |
| "//chrome/updater/mac:updater_setup_sources", |
| "//chrome/updater/mac:xpc_names", |
| ] |
| } |
| |
| if (is_mac) { |
| libs = [ "Foundation.framework" ] |
| } |
| |
| if (is_win) { |
| configs -= [ "//build/config/win:winver" ] |
| configs += [ "//chrome/updater/app/server/win:winver" ] |
| } |
| } |
| |
| process_version("version_header") { |
| sources = [ "//chrome/VERSION" ] |
| |
| extra_args = [ |
| "-e", |
| "COMPANY_FULLNAME=\"$updater_company_full_name\"", |
| "-e", |
| "COMPANY_SHORTNAME=\"$updater_company_short_name\"", |
| "-e", |
| "PRODUCT_FULLNAME=\"$updater_product_full_name\"", |
| "-e", |
| "COPYRIGHT=\"updater_copyright\"", |
| "-e", |
| "MAC_BUNDLE_IDENTIFIER=\"$mac_updater_bundle_identifier\"", |
| "-e", |
| "BROWSER_NAME=\"$browser_name\"", |
| "-e", |
| "MAC_BROWSER_BUNDLE_IDENTIFIER=\"$mac_browser_bundle_identifier\"", |
| ] |
| |
| template_file = "updater_version.h.in" |
| output = "$target_gen_dir/updater_version.h" |
| } |
| |
| test("updater_tests") { |
| testonly = true |
| |
| sources = [ |
| "app/app_server_unittest.cc", |
| "dm_policy_manager_unittest.cc", |
| "dm_storage_unittest.cc", |
| "external_constants_unittest.cc", |
| "external_constants_unittest.h", |
| "lib_util_unittest.cc", |
| "persisted_data_unittest.cc", |
| "policy_manager_unittest.cc", |
| "prefs_unittest.cc", |
| "run_all_unittests.cc", |
| "tag_unittest.cc", |
| "test/integration_tests.cc", |
| "test/integration_tests.h", |
| "unittest_util.cc", |
| "unittest_util.h", |
| "unittest_util_unittest.cc", |
| "updater_unittest.cc", |
| ] |
| |
| deps = [ |
| ":base", |
| ":lib", |
| ":updater", |
| ":version_header", |
| "//base", |
| "//base/test:test_support", |
| "//chrome/common:constants", |
| "//chrome/updater/test/test_app", |
| "//chrome/updater/tools:unittest", |
| "//components/prefs:test_support", |
| "//components/update_client", |
| "//testing/gtest", |
| "//url", |
| ] |
| |
| public_deps = [ "//chrome/updater/protos:omaha_proto" ] |
| |
| if (is_win) { |
| sources += [ |
| "external_constants_win_unittest.cc", |
| "test/integration_tests_win.cc", |
| ] |
| |
| deps += [ |
| "//chrome/updater/win:constants", |
| "//chrome/updater/win:updater_tests", |
| ] |
| |
| data_deps = [ |
| "//chrome/updater/win:updater", |
| "//chrome/updater/win/installer", |
| ] |
| } |
| |
| if (is_mac) { |
| sources += [ |
| "external_constants_mac_unittest.mm", |
| "mac/scoped_xpc_service_mock.h", |
| "mac/scoped_xpc_service_mock.mm", |
| "mac/update_service_out_of_process_test.mm", |
| "test/integration_tests_mac.mm", |
| ] |
| |
| deps += [ |
| "//chrome/common/mac:launchd", |
| "//chrome/updater/app/server/mac:protocol", |
| "//chrome/updater/mac:enterprise_tests", |
| "//chrome/updater/mac:updater_bundle", |
| "//chrome/updater/mac:updater_setup_tests", |
| "//chrome/updater/mac:updater_tests", |
| "//chrome/updater/mac:xpc_names", |
| "//third_party/ocmock", |
| ] |
| |
| data_deps = [ "//chrome/updater/mac:updater_bundle" ] |
| } |
| } |
| } |