OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 if (is_android) { | 5 if (is_android) { |
6 import("//build/config/android/rules.gni") | 6 import("//build/config/android/rules.gni") |
7 } | 7 } |
8 | 8 |
| 9 action("fieldtrial_testing_config_action") { |
| 10 visibility = [ ":variations" ] |
| 11 script = "//tools/variations/fieldtrial_to_struct.py" |
| 12 |
| 13 source = "//testing/variations/fieldtrial_testing_config.json" |
| 14 inputs = [ |
| 15 "//tools/json_to_struct/element_generator.py", |
| 16 "//tools/json_to_struct/json_to_struct.py", |
| 17 "//tools/json_to_struct/struct_generator.py", |
| 18 source, |
| 19 ] |
| 20 out_name = "fieldtrial_testing_config" |
| 21 outputs = [ |
| 22 "$target_gen_dir/$out_name.cc", |
| 23 "$target_gen_dir/$out_name.h", |
| 24 ] |
| 25 |
| 26 args = [ |
| 27 rebase_path(source, root_build_dir), |
| 28 "--destbase=" + rebase_path(target_gen_dir, root_build_dir), |
| 29 "--namespace=variations", |
| 30 "--schema=" + |
| 31 rebase_path("fieldtrial_testing_config_schema.json", root_build_dir), |
| 32 "--platform=" + current_os, |
| 33 "--output=$out_name", |
| 34 ] |
| 35 } |
| 36 |
9 static_library("variations") { | 37 static_library("variations") { |
10 sources = [ | 38 sources = [ |
11 "active_field_trials.cc", | 39 "active_field_trials.cc", |
12 "active_field_trials.h", | 40 "active_field_trials.h", |
13 "android/component_jni_registrar.cc", | 41 "android/component_jni_registrar.cc", |
14 "android/component_jni_registrar.h", | 42 "android/component_jni_registrar.h", |
15 "android/variations_associated_data_android.cc", | 43 "android/variations_associated_data_android.cc", |
16 "android/variations_associated_data_android.h", | 44 "android/variations_associated_data_android.h", |
17 "android/variations_seed_bridge.cc", | 45 "android/variations_seed_bridge.cc", |
18 "android/variations_seed_bridge.h", | 46 "android/variations_seed_bridge.h", |
19 "caching_permuted_entropy_provider.cc", | 47 "caching_permuted_entropy_provider.cc", |
20 "caching_permuted_entropy_provider.h", | 48 "caching_permuted_entropy_provider.h", |
21 "entropy_provider.cc", | 49 "entropy_provider.cc", |
22 "entropy_provider.h", | 50 "entropy_provider.h", |
23 "experiment_labels.cc", | 51 "experiment_labels.cc", |
24 "experiment_labels.h", | 52 "experiment_labels.h", |
| 53 "fieldtrial_util.cc", |
| 54 "fieldtrial_util.h", |
25 "metrics_util.cc", | 55 "metrics_util.cc", |
26 "metrics_util.h", | 56 "metrics_util.h", |
27 "pref_names.cc", | 57 "pref_names.cc", |
28 "pref_names.h", | 58 "pref_names.h", |
29 "processed_study.cc", | 59 "processed_study.cc", |
30 "processed_study.h", | 60 "processed_study.h", |
31 "proto/client_variations.proto", | 61 "proto/client_variations.proto", |
32 "proto/permuted_entropy_cache.proto", | 62 "proto/permuted_entropy_cache.proto", |
33 "proto/study.proto", | 63 "proto/study.proto", |
34 "proto/variations_seed.proto", | 64 "proto/variations_seed.proto", |
(...skipping 16 matching lines...) Expand all Loading... |
51 "variations_seed_store.cc", | 81 "variations_seed_store.cc", |
52 "variations_seed_store.h", | 82 "variations_seed_store.h", |
53 "variations_switches.cc", | 83 "variations_switches.cc", |
54 "variations_switches.h", | 84 "variations_switches.h", |
55 "variations_url_constants.cc", | 85 "variations_url_constants.cc", |
56 "variations_url_constants.h", | 86 "variations_url_constants.h", |
57 "variations_util.cc", | 87 "variations_util.cc", |
58 "variations_util.h", | 88 "variations_util.h", |
59 ] | 89 ] |
60 | 90 |
| 91 sources += get_target_outputs(":fieldtrial_testing_config_action") |
| 92 |
61 if (is_android || is_ios) { | 93 if (is_android || is_ios) { |
62 sources += [ | 94 sources += [ |
63 "variations_request_scheduler_mobile.cc", | 95 "variations_request_scheduler_mobile.cc", |
64 "variations_request_scheduler_mobile.h", | 96 "variations_request_scheduler_mobile.h", |
65 ] | 97 ] |
66 } | 98 } |
67 | 99 |
68 deps = [ | 100 deps = [ |
| 101 ":fieldtrial_testing_config_action", |
69 "proto", | 102 "proto", |
70 "//base", | 103 "//base", |
71 "//components/crash/core/common", | 104 "//components/crash/core/common", |
72 "//components/prefs", | 105 "//components/prefs", |
73 "//crypto", | 106 "//crypto", |
| 107 "//net", |
74 "//third_party/mt19937ar", | 108 "//third_party/mt19937ar", |
75 "//third_party/protobuf:protobuf_lite", | 109 "//third_party/protobuf:protobuf_lite", |
76 "//third_party/zlib:compression_utils", | 110 "//third_party/zlib:compression_utils", |
77 ] | 111 ] |
78 | 112 |
79 if (is_android) { | 113 if (is_android) { |
80 deps += [ ":jni" ] | 114 deps += [ ":jni" ] |
81 } | 115 } |
82 } | 116 } |
83 | 117 |
84 if (is_android) { | 118 if (is_android) { |
85 generate_jni("jni") { | 119 generate_jni("jni") { |
86 sources = [ | 120 sources = [ |
87 "android/java/src/org/chromium/components/variations/VariationsAssociatedD
ata.java", | 121 "android/java/src/org/chromium/components/variations/VariationsAssociatedD
ata.java", |
88 "android/java/src/org/chromium/components/variations/firstrun/VariationsSe
edBridge.java", | 122 "android/java/src/org/chromium/components/variations/firstrun/VariationsSe
edBridge.java", |
89 ] | 123 ] |
90 jni_package = "variations" | 124 jni_package = "variations" |
91 } | 125 } |
92 } | 126 } |
93 | 127 |
94 source_set("unit_tests") { | 128 source_set("unit_tests") { |
95 testonly = true | 129 testonly = true |
96 sources = [ | 130 sources = [ |
97 "active_field_trials_unittest.cc", | 131 "active_field_trials_unittest.cc", |
98 "caching_permuted_entropy_provider_unittest.cc", | 132 "caching_permuted_entropy_provider_unittest.cc", |
99 "entropy_provider_unittest.cc", | 133 "entropy_provider_unittest.cc", |
100 "experiment_labels_unittest.cc", | 134 "experiment_labels_unittest.cc", |
| 135 "fieldtrial_util_unittest.cc", |
101 "metrics_util_unittest.cc", | 136 "metrics_util_unittest.cc", |
102 "net/variations_http_headers_unittest.cc", | 137 "net/variations_http_headers_unittest.cc", |
103 "study_filtering_unittest.cc", | 138 "study_filtering_unittest.cc", |
104 "variations_associated_data_unittest.cc", | 139 "variations_associated_data_unittest.cc", |
105 "variations_http_header_provider_unittest.cc", | 140 "variations_http_header_provider_unittest.cc", |
106 "variations_request_scheduler_unittest.cc", | 141 "variations_request_scheduler_unittest.cc", |
107 "variations_seed_processor_unittest.cc", | 142 "variations_seed_processor_unittest.cc", |
108 "variations_seed_simulator_unittest.cc", | 143 "variations_seed_simulator_unittest.cc", |
109 "variations_seed_store_unittest.cc", | 144 "variations_seed_store_unittest.cc", |
110 ] | 145 ] |
111 | 146 |
112 if (is_android || is_ios) { | 147 if (is_android || is_ios) { |
113 sources += [ "variations_request_scheduler_mobile_unittest.cc" ] | 148 sources += [ "variations_request_scheduler_mobile_unittest.cc" ] |
114 } | 149 } |
115 | 150 |
116 deps = [ | 151 deps = [ |
117 ":variations", | 152 ":variations", |
118 "net", | 153 "net", |
119 "proto", | 154 "proto", |
120 "//base/test:test_support", | 155 "//base/test:test_support", |
121 "//components/prefs:test_support", | 156 "//components/prefs:test_support", |
122 "//testing/gtest", | 157 "//testing/gtest", |
123 "//third_party/zlib:compression_utils", | 158 "//third_party/zlib:compression_utils", |
124 ] | 159 ] |
125 } | 160 } |
OLD | NEW |