[email protected] | 273ae5ab | 2014-07-09 21:10:25 | [diff] [blame] | 1 | # 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 | |
ttuttle | fa7aae51 | 2014-11-06 00:42:05 | [diff] [blame] | 5 | # 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 | |
scottmg | ac0ea031 | 2014-12-03 19:21:05 | [diff] [blame] | 13 | baked_in_configs_gypi = exec_script("//build/gypi_to_gn.py", |
| 14 | [ rebase_path("baked_in_configs.gypi") ], |
| 15 | "scope", |
| 16 | [ "baked_in_configs.gypi" ]) |
brettw | d6763a73 | 2015-11-11 00:11:52 | [diff] [blame] | 17 | |
| 18 | # The config file names in the .gypi are relative to "//components". |
scottmg | ac0ea031 | 2014-12-03 19:21:05 | [diff] [blame] | 19 | baked_in_configs = |
brettw | d6763a73 | 2015-11-11 00:11:52 | [diff] [blame] | 20 | rebase_path(baked_in_configs_gypi.baked_in_configs, ".", "//components") |
ttuttle | fa7aae51 | 2014-11-06 00:42:05 | [diff] [blame] | 21 | |
brettw | 9c9c032 | 2015-11-12 23:53:58 | [diff] [blame] | 22 | action("bake_in_configs") { |
| 23 | visibility = [ ":*" ] |
| 24 | script = "bake_in_configs.py" |
[email protected] | 273ae5ab | 2014-07-09 21:10:25 | [diff] [blame] | 25 | |
brettw | 9c9c032 | 2015-11-12 23:53:58 | [diff] [blame] | 26 | inputs = baked_in_configs |
| 27 | output_file = "$target_gen_dir/baked_in_configs.cc" |
| 28 | outputs = [ |
| 29 | output_file, |
| 30 | ] |
[email protected] | 273ae5ab | 2014-07-09 21:10:25 | [diff] [blame] | 31 | |
brettw | 9c9c032 | 2015-11-12 23:53:58 | [diff] [blame] | 32 | # 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] | 273ae5ab | 2014-07-09 21:10:25 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | component("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", |
ttuttle | ca1ac31 | 2015-03-12 17:07:00 | [diff] [blame] | 53 | "context_manager.cc", |
| 54 | "context_manager.h", |
[email protected] | 273ae5ab | 2014-07-09 21:10:25 | [diff] [blame] | 55 | "dispatcher.cc", |
| 56 | "dispatcher.h", |
| 57 | "domain_reliability_export.h", |
ttuttle | ccdd6cc5 | 2015-11-22 06:09:40 | [diff] [blame] | 58 | "google_configs.cc", |
| 59 | "google_configs.h", |
ttuttle | 2935096c | 2016-02-09 22:31:44 | [diff] [blame] | 60 | "header.cc", |
| 61 | "header.h", |
[email protected] | 273ae5ab | 2014-07-09 21:10:25 | [diff] [blame] | 62 | "monitor.cc", |
| 63 | "monitor.h", |
ttuttle | b160737 | 2016-02-09 16:27:16 | [diff] [blame] | 64 | "quic_error_mapping.cc", |
| 65 | "quic_error_mapping.h", |
[email protected] | 273ae5ab | 2014-07-09 21:10:25 | [diff] [blame] | 66 | "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", |
amohammadkhan | f76ae11 | 2015-09-14 17:34:43 | [diff] [blame] | 82 | "//components/data_use_measurement/core", |
[email protected] | 273ae5ab | 2014-07-09 21:10:25 | [diff] [blame] | 83 | "//components/keyed_service/core", |
ttuttle | 2935096c | 2016-02-09 22:31:44 | [diff] [blame] | 84 | "//content/public/common", |
[email protected] | 273ae5ab | 2014-07-09 21:10:25 | [diff] [blame] | 85 | "//net", |
| 86 | "//url", |
| 87 | ] |
| 88 | } |
[email protected] | a439c14 | 2014-07-21 17:24:48 | [diff] [blame] | 89 | |
| 90 | source_set("unit_tests") { |
Brett Wilson | 0c8745a | 2014-09-08 22:59:49 | [diff] [blame] | 91 | testonly = true |
[email protected] | a439c14 | 2014-07-21 17:24:48 | [diff] [blame] | 92 | sources = [ |
| 93 | "config_unittest.cc", |
| 94 | "context_unittest.cc", |
| 95 | "dispatcher_unittest.cc", |
ttuttle | ccdd6cc5 | 2015-11-22 06:09:40 | [diff] [blame] | 96 | "google_configs_unittest.cc", |
ttuttle | 2935096c | 2016-02-09 22:31:44 | [diff] [blame] | 97 | "header_unittest.cc", |
[email protected] | a439c14 | 2014-07-21 17:24:48 | [diff] [blame] | 98 | "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 | |
dpranke | 8ec93a3a | 2015-02-20 23:36:08 | [diff] [blame] | 106 | configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 107 | |
[email protected] | a439c14 | 2014-07-21 17:24:48 | [diff] [blame] | 108 | deps = [ |
| 109 | ":domain_reliability", |
brettw | 462851f7 | 2014-11-26 18:38:55 | [diff] [blame] | 110 | "//base", |
| 111 | "//base/test:test_support", |
| 112 | "//net:test_support", |
[email protected] | a439c14 | 2014-07-21 17:24:48 | [diff] [blame] | 113 | "//testing/gtest", |
| 114 | ] |
| 115 | } |