blob: a0fb15f9b8b7438dc8f460ac6d1fda80ce76e492 [file] [log] [blame]
[email protected]273ae5ab2014-07-09 21:10:251# Copyright 2014 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
ttuttlefa7aae512014-11-06 00:42:055# Paths to the JSON files are kind of gross. They're stored in the gypi
6# relative to //components, since that's the working directory gyp seems
7# to use for all of the components. When we depend on them here, we need
8# to remove the leading domain_reliability, since *our* working directory
9# is one level deeper. When we call bake_in_configs.py, we need to give
10# it a properly-rebased path to //components so it can properly join the
11# paths relative to that and find the JSON files.
12
scottmgac0ea0312014-12-03 19:21:0513baked_in_configs_gypi = exec_script("//build/gypi_to_gn.py",
14 [ rebase_path("baked_in_configs.gypi") ],
15 "scope",
16 [ "baked_in_configs.gypi" ])
brettwd6763a732015-11-11 00:11:5217
18# The config file names in the .gypi are relative to "//components".
scottmgac0ea0312014-12-03 19:21:0519baked_in_configs =
brettwd6763a732015-11-11 00:11:5220 rebase_path(baked_in_configs_gypi.baked_in_configs, ".", "//components")
ttuttlefa7aae512014-11-06 00:42:0521
brettw9c9c0322015-11-12 23:53:5822action("bake_in_configs") {
23 visibility = [ ":*" ]
24 script = "bake_in_configs.py"
[email protected]273ae5ab2014-07-09 21:10:2525
brettw9c9c0322015-11-12 23:53:5826 inputs = baked_in_configs
27 output_file = "$target_gen_dir/baked_in_configs.cc"
28 outputs = [
29 output_file,
30 ]
[email protected]273ae5ab2014-07-09 21:10:2531
brettw9c9c0322015-11-12 23:53:5832 # The JSON file list is too long for the command line on Windows, so put
33 # them in a response file.
34 response_file_contents = rebase_path(inputs, root_build_dir)
35 args = [
36 "--file-list",
37 "{{response_file_name}}",
38 "--output",
39 rebase_path(output_file, root_build_dir),
40 ]
[email protected]273ae5ab2014-07-09 21:10:2541}
42
43component("domain_reliability") {
44 sources = [
45 "baked_in_configs.h",
46 "beacon.cc",
47 "beacon.h",
48 "clear_mode.h",
49 "config.cc",
50 "config.h",
51 "context.cc",
52 "context.h",
ttuttleca1ac312015-03-12 17:07:0053 "context_manager.cc",
54 "context_manager.h",
[email protected]273ae5ab2014-07-09 21:10:2555 "dispatcher.cc",
56 "dispatcher.h",
57 "domain_reliability_export.h",
ttuttleccdd6cc52015-11-22 06:09:4058 "google_configs.cc",
59 "google_configs.h",
ttuttle2935096c2016-02-09 22:31:4460 "header.cc",
61 "header.h",
[email protected]273ae5ab2014-07-09 21:10:2562 "monitor.cc",
63 "monitor.h",
ttuttleb1607372016-02-09 16:27:1664 "quic_error_mapping.cc",
65 "quic_error_mapping.h",
[email protected]273ae5ab2014-07-09 21:10:2566 "scheduler.cc",
67 "scheduler.h",
68 "service.cc",
69 "service.h",
70 "uploader.cc",
71 "uploader.h",
72 "util.cc",
73 "util.h",
74 ]
75 sources += get_target_outputs(":bake_in_configs")
76
77 defines = [ "DOMAIN_RELIABILITY_IMPLEMENTATION" ]
78
79 deps = [
80 ":bake_in_configs",
81 "//base",
amohammadkhanf76ae112015-09-14 17:34:4382 "//components/data_use_measurement/core",
[email protected]273ae5ab2014-07-09 21:10:2583 "//components/keyed_service/core",
ttuttle2935096c2016-02-09 22:31:4484 "//content/public/common",
[email protected]273ae5ab2014-07-09 21:10:2585 "//net",
86 "//url",
87 ]
88}
[email protected]a439c142014-07-21 17:24:4889
90source_set("unit_tests") {
Brett Wilson0c8745a2014-09-08 22:59:4991 testonly = true
[email protected]a439c142014-07-21 17:24:4892 sources = [
93 "config_unittest.cc",
94 "context_unittest.cc",
95 "dispatcher_unittest.cc",
ttuttleccdd6cc52015-11-22 06:09:4096 "google_configs_unittest.cc",
ttuttle2935096c2016-02-09 22:31:4497 "header_unittest.cc",
[email protected]a439c142014-07-21 17:24:4898 "monitor_unittest.cc",
99 "scheduler_unittest.cc",
100 "test_util.cc",
101 "test_util.h",
102 "uploader_unittest.cc",
103 "util_unittest.cc",
104 ]
105
dpranke8ec93a3a2015-02-20 23:36:08106 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
107
[email protected]a439c142014-07-21 17:24:48108 deps = [
109 ":domain_reliability",
brettw462851f72014-11-26 18:38:55110 "//base",
111 "//base/test:test_support",
112 "//net:test_support",
[email protected]a439c142014-07-21 17:24:48113 "//testing/gtest",
114 ]
115}