[Sync] Add auto-generated ModelType in Java.
[chromium-blink-merge.git] / components / BUILD.gn
blob41397bf02c5dd7d9048ed47c02aaaa4e523e5665
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.
5 import("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//testing/test.gni")
8 import("//tools/grit/repack.gni")
10 # Collection of all components. You wouldn't link to this, but this is rather
11 # to reference the files so they can be compiled by the build system.
12 group("all_components") {
13   testonly = true  # You shouldn't actually link to this.
14   visibility = [ "//:*" ]  # Only for the root targets to bring in.
16   deps = [
17     "//components/auto_login_parser",
18     "//components/autofill/content/browser",
19     "//components/autofill/content/common",
20     "//components/autofill/content/renderer",
21     "//components/bookmarks/browser",
22     "//components/bookmarks/common",
23     "//components/bookmarks/managed",
24     "//components/bookmarks/test",
25     "//components/captive_portal",
26     "//components/cdm/browser",
27     "//components/cdm/common",
28     "//components/cdm/renderer",
29     "//components/cloud_devices/common",
30     "//components/chrome_apps",
31     "//components/component_updater",
32     "//components/content_settings/core/browser",
33     "//components/content_settings/core/common",
34     "//components/crash/app",
35     "//components/crash/browser",
36     "//components/crx_file",
37     "//components/data_reduction_proxy/core/browser",
38     "//components/data_reduction_proxy/core/common",
39     "//components/device_event_log",
40     "//components/devtools_discovery",
41     "//components/devtools_http_handler",
42     "//components/dom_distiller/core",
43     "//components/domain_reliability",
44     "//components/enhanced_bookmarks",
45     "//components/favicon/core",
46     "//components/favicon_base",
47     "//components/feedback",
48     "//components/gcm_driver",
49     "//components/gcm_driver/crypto",
50     "//components/gcm_driver/instance_id",
51     "//components/google/core/browser",
52     "//components/history/content/browser",
53     "//components/history/core/browser",
54     "//components/history/core/common",
55     "//components/history/core/test",
56     "//components/infobars/core",
57     "//components/invalidation/impl",
58     "//components/json_schema",
59     "//components/keyed_service/content",
60     "//components/language_usage_metrics",
61     "//components/leveldb_proto",
62     "//components/login",
63     "//components/metrics",
64     "//components/mime_util",
65     "//components/navigation_interception",
66     "//components/navigation_metrics",
67     "//components/network_time",
68     "//components/offline_pages",
69     "//components/omnibox/browser",
70     "//components/onc",
71     "//components/os_crypt",
72     "//components/packed_ct_ev_whitelist",
73     "//components/pairing",
74     "//components/password_manager/content/browser",
75     "//components/password_manager/core/browser",
76     "//components/password_manager/core/common",
77     "//components/pdf/browser",
78     "//components/pdf/common",
79     "//components/pdf/renderer",
80     "//components/plugins/common",
81     "//components/plugins/renderer",
82     "//components/policy",
83     "//components/power",
84     "//components/precache/core",
85     "//components/precache/content",
86     "//components/proxy_config",
87     "//components/pref_registry",
88     "//components/query_parser",
89     "//components/rappor",
90     "//components/renderer_context_menu",
91     "//components/resources:components_resources",
92     "//components/search",
93     "//components/search_engines",
94     "//components/search_provider_logos",
95     "//components/secure_display",
96     "//components/security_interstitials/core",
97     "//components/sessions",
98     "//components/signin/core/browser",
99     "//components/startup_metric_utils",
100     "//components/strings",
101     "//components/sync_driver",
102     "//components/tracing",
103     "//components/tracing:startup_tracing",
104     "//components/translate/content/browser",
105     "//components/translate/content/common",
106     "//components/translate/content/renderer",
107     "//components/translate/core/browser",
108     "//components/translate/core/common",
109     "//components/ui/zoom:ui_zoom",
110     "//components/undo",
111     "//components/update_client",
112     "//components/upload_list",
113     "//components/url_fixer",
114     "//components/url_matcher",
115     "//components/user_manager",
116     "//components/user_prefs",
117     "//components/variations",
118     "//components/version_info",
119     "//components/visitedlink/browser",
120     "//components/visitedlink/common",
121     "//components/visitedlink/renderer",
122     "//components/wallpaper",
123     "//components/web_cache/browser",
124     "//components/web_cache/common",
125     "//components/web_cache/renderer",
126     "//components/web_modal",
127     "//components/web_resource",
128     "//components/webcrypto",
129     "//components/webdata/common",
130     "//components/wifi",
131     "//components/wifi_sync",
132   ]
134   if (!is_android) {
135     # TODO(agrieve): Add to main deps list once compile errors are resolved.
136     deps += [ "//components/devtools_service" ]
137   }
139   if (!is_android && !is_ios) {
140     deps += [
141       "//components/proximity_auth",
142       "//components/proximity_auth/cryptauth",
143     ]
144   }
146   if (!enable_configuration_policy) {
147     deps -= [ "//components/policy" ]
148   }
150   if (!is_win && !is_mac) {
151     deps -= [ "//components/wifi" ]
152   }
153   if (!is_chromeos) {
154     deps -= [
155       "//components/pairing",
156       "//components/wifi_sync",
157     ]
158   }
160   if (!is_chromeos || !enable_extensions) {
161     deps -= [ "//components/chrome_apps" ]
162   }
164   if (is_ios) {
165     deps -= [
166       "//components/history/content/browser",
167       "//components/keyed_service/content",
168     ]
169   }
171   if (!enable_plugins) {
172     deps -= [
173       "//components/pdf/browser",
174       "//components/pdf/common",
175       "//components/pdf/renderer",
176     ]
177   }
179   if (is_android) {
180     deps -= [
181       "//components/autofill/content/browser",  # Blocked on content/blink.
182       "//components/autofill/content/common",  # Blocked on content.
183       "//components/autofill/content/renderer",  # Blocked on content/blink.
184       "//components/crash/app",  # Should work, needs checking.
185       "//components/crash/browser",  # Should work, needs checking.
186       "//components/captive_portal",  # Should work, needs checking.
187       "//components/cloud_devices/common",  # Should work, needs checking.
188       "//components/cdm/browser",  # Blocked on content.
189       "//components/cdm/common",  # Blocked on content.
190       "//components/cdm/renderer",  # Blocked on content.
191       "//components/data_reduction_proxy/core/browser",  # Should work, needs checking.
192       "//components/data_reduction_proxy/core/common",  # Should work, needs checking.
193       "//components/dom_distiller/core",  # Blocked on content.
194       "//components/domain_reliability",  # Blocked on content.
195       "//components/favicon/core",  # Blocked on keyed service.
196       "//components/favicon_base",  # Should work, needs checking.
197       "//components/feedback",  # Blocked on content.
198       "//components/google/core/browser",  # Should work, needs checking.
199       "//components/history/core/browser",  # Should work, needs checking.
200       "//components/history/core/common",  # Should work, needs checking.
201       "//components/history/core/test",  # Should work, needs checking.
202       "//components/infobars/core",  # Should work, needs checking.
203       "//components/invalidation/impl",  # Should work, needs checking.
204       "//components/json_schema",  # Should work, needs checking.
205       "//components/keyed_service/content",  # Blocked on content.
206       "//components/navigation_interception",  # Blocked on content.
207       "//components/omnibox/browser",  # Should work, needs checking.
208       "//components/password_manager/content/browser",  # Blocked on content.
209       "//components/password_manager/core/browser",  # Should work, needs checking.
210       "//components/password_manager/core/common",  # Should work, needs checking.
211       "//components/plugins/renderer",  # Blocked on blink.
212       "//components/power",  # Blocked on content.
213       "//components/policy",  # Blocked on content (indirectly via autofill).
214       "//components/precache/content",  # Blocked on content.
215       "//components/precache/core",  # Should work, needs checking.
216       "//components/rappor",  # Should work, needs checking.
217       "//components/renderer_context_menu",  # Blocked on content.
218       "//components/search_engines",  # Should work, needs checking.
219       "//components/search_provider_logos",  # Should work, needs checking.
220       "//components/sessions",  # Blocked on content.
221       "//components/signin/core/browser",  # Should work, needs checking.
222       "//components/translate/content/browser",  # Blocked on content.
223       "//components/translate/content/common",  # Blocked on content.
224       "//components/translate/content/renderer",  # Blocked on content.
225       "//components/user_prefs",  # Blocked on content.
226       "//components/visitedlink/browser",  # Blocked on content.
227       "//components/visitedlink/common",  # Blocked on content.
228       "//components/visitedlink/renderer",  # Blocked on blink
229       "//components/web_cache/browser",  # Blocked on content and blink.
230       "//components/web_cache/renderer",  # Blocked on content and blink.
231       "//components/web_modal",  # Blocked on content.
232     ]
233   }
235   if (!is_ios && !is_android) {
236     deps += [
237       "//components/copresence",
238       "//components/storage_monitor",
239     ]
240   }
242   if (!is_ios) {
243     deps += [
244       "//components/app_modal",
245       "//components/browsing_data",
246       "//components/guest_view/browser",
247       "//components/guest_view/common",
248       "//components/guest_view/renderer",
249       "//components/safe_json",
250       "//components/scheduler",
251       "//components/test_runner",
252     ]
253   }
255   if (toolkit_views) {
256     deps += [ "//components/constrained_window" ]
257   }
260 # TODO(GYP): Delete this after we've converted everything to GN.
261 # The _run targets exist only for compatibility w/ GYP.
262 group("components_unittests_run") {
263   testonly = true
264   deps = [
265     ":components_unittests",
266   ]
269 # To add a unit test to this target, make a "unit_test" source_set in your
270 # component (it's important to use a source_set instead of a static library or
271 # no tests will run) and add a reference here. You can add more than one unit
272 # test target if convenient.
273 test("components_unittests") {
274   sources = [
275     "test/run_all_unittests.cc",
276   ]
278   if (is_android || is_linux || is_mac || is_win) {
279     data = [
280       "test/data/",
282       # TODO(dpranke): Remove the next two lines after GN has rolled to 339778.
283       "$root_out_dir/components_tests_resources.pak",
284       "$root_out_dir/ui_test.pak",
285     ]
286   }
288   # Add only ":unit_tests" dependencies here. If your tests have dependencies
289   # (this would at least include the component itself), they should be on the
290   # test source set and not here.
291   deps = [
292     "//components/auto_login_parser:unit_tests",
293     "//components/autofill/content/browser:unit_tests",
294     "//components/autofill/core/browser:unit_tests",
295     "//components/autofill/core/common:unit_tests",
296     "//components/bookmarks/browser:unit_tests",
297     "//components/bookmarks/managed:unit_tests",
298     "//components/captive_portal:unit_tests",
299     "//components/cloud_devices/common:unit_tests",
300     "//components/component_updater:unit_tests",
301     "//components/content_settings/core/browser:unit_tests",
302     "//components/content_settings/core/common:unit_tests",
303     "//components/crx_file:unit_tests",
304     "//components/data_reduction_proxy/content/browser:unit_tests",
305     "//components/data_reduction_proxy/core/browser:unit_tests",
306     "//components/data_reduction_proxy/core/common:unit_tests",
307     "//components/device_event_log:unit_tests",
308     "//components/devtools_http_handler:unit_tests",
309     "//components/dom_distiller/core:unit_tests",
310     "//components/domain_reliability:unit_tests",
311     "//components/favicon_base:unit_tests",
312     "//components/gcm_driver:unit_tests",
313     "//components/gcm_driver/crypto:unit_tests",
314     "//components/gcm_driver/instance_id:unit_tests",
315     "//components/google/core/browser:unit_tests",
316     "//components/invalidation/impl:unittests",
317     "//components/login:unit_tests",
318     "//components/metrics:unit_tests",
319     "//components/mime_util:unit_tests",
320     "//components/offline_pages:unit_tests",
321     "//components/omnibox/browser:unit_tests",
322     "//components/packed_ct_ev_whitelist:unit_tests",
323     "//components/undo:unit_tests",
324     "//components/secure_display:unit_tests",
325     "//components/update_client:unit_tests",
326     "//components/upload_list:unit_tests",
327     "//components/variations:unit_tests",
328     "//components/webcrypto:unit_tests",
329     "//components/web_resource:unit_tests",
330     "//components/webdata/common:unit_tests",
332     # These are the deps required by the code in this target.
333     "//base",
334     "//base/test:test_support",
335     "//content/test:test_support",
336     "//net",
337     "//ui/base",
338     "//ui/resources:ui_test_pak",
339   ]
341   data_deps = [
342     ":components_tests_pak",
343     "//third_party/mesa:osmesa",
344     "//ui/resources:ui_test_pak",
345   ]
347   if (enable_rlz_support) {
348     deps += [ "//components/rlz:unit_tests" ]
349   }
351   if (is_android) {
352     isolate_file = "components_unittests.isolate"
354     deps += [ "//content/public/android:content_java" ]
355     deps -= [
356       "//components/gcm_driver:unit_tests",
357       "//components/gcm_driver/instance_id:unit_tests",
358     ]
359   }
361   if (!is_android && !is_ios) {
362     deps += [ "//components/proximity_auth:unit_tests" ]
363   }
365   if (is_chromeos) {
366     deps += [ "//components/ownership:unit_tests" ]
367   }
369   # TODO(GYP) need this target.
370   #'breakpad/app/crash_keys_win_unittest.cc',
372   # Precache tests need these defines.
373   #configs += [ "//components/precache/core:precache_config" ]
375   if (toolkit_views) {
376     # TODO(GYP) enable this as above.
377     #deps += [ "//components/constrained_window:unit_tests" ]
378   }
379   if (is_win) {
380     deps += [ "//components/browser_watcher:unit_tests" ]
381   }
382   if (is_ios) {
383     deps -= [ "//components/devtools_http_handler:unit_tests" ]
384   }
386   if (!is_ios) {
387     deps += [
388       "//components/safe_json:unit_tests",
389       "//components/scheduler:unit_tests",
390     ]
391   }
394 repack("components_tests_pak") {
395   sources = [
396     "$root_gen_dir/components/components_resources.pak",
397     "$root_gen_dir/components/strings/components_strings_en-US.pak",
398   ]
400   output = "$root_out_dir/components_tests_resources.pak"
402   deps = [
403     "//components/resources",
404     "//components/strings",
405   ]
408 # TODO(GYP): Delete this after we've converted everything to GN.
409 # The _run targets exist only for compatibility w/ GYP.
410 group("components_browsertests_run") {
411   testonly = true
412   deps = [
413     ":components_browsertests",
414   ]
417 test("components_browsertests") {
418   sources = [
419     "autofill/content/browser/risk/fingerprint_browsertest.cc",
420     "autofill/content/renderer/password_form_conversion_utils_browsertest.cc",
421     "dom_distiller/content/browser/distillable_page_utils_browsertest.cc",
422     "dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc",
423     "password_manager/content/renderer/credential_manager_client_browsertest.cc",
424   ]
426   data = [
427     "$root_out_dir/components_tests_resources.pak",
428     "$root_out_dir/content_shell.pak",
429   ]
431   if (is_android || is_linux || is_mac || is_win) {
432     data += [
433       "test/data/",
434       "dom_distiller/core/javascript/",
435       "//third_party/dom_distiller_js/dist/test/data/",
436     ]
437   }
439   if (is_mac) {
440     data += [ "$root_out_dir/Content Shell.app/" ]
441   }
443   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
445   deps = [
446     "autofill/content/browser",
447     "autofill/content/renderer",
448     "content_settings/core/common",
449     "dom_distiller/content:content_browser",
450     "dom_distiller/core",
451     "dom_distiller/core:test_support",
452     "password_manager/content/browser",
453     "password_manager/content/common",
454     "password_manager/content/renderer",
455     "strings",
456     "//base",
457     "//base/test:test_support",
458     "//content/test:browsertest_support",
459     "//content/test:test_support",
460     "//device/bluetooth",
461     "//testing/gmock",
462     "//testing/gtest",
463     "//ui/base",
464   ]
466   data_deps = [
467     ":components_tests_pak",
468     "//third_party/mesa:osmesa",
469   ]
471   if (is_android) {
472     sources += [ "test/android/browsertests_apk/components_browser_tests_jni_onload.cc" ]
473     sources -= [ "autofill/content/browser/risk/fingerprint_browsertest.cc" ]
474     deps += [ "//testing/android/native_test:native_test_support" ]
475     use_launcher = false
476     isolate_file = "components_browsertests.isolate"
477   }
479   if (is_linux) {
480     # content_extractor_browsertest is a standalone content extraction tool built as
481     # a MANUAL component_browsertest.
482     sources += [ "dom_distiller/standalone/content_extractor_browsertest.cc" ]
483     deps += [
484       "pref_registry:test_support",
485       "//base:prefs_test_support",
486     ]
487   }
490 test("components_perftests") {
491   sources = [
492     "scheduler/child/task_queue_manager_perftest.cc",
493     "visitedlink/test/visitedlink_perftest.cc",
494   ]
496   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
497   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
499   deps = [
500     "//base",
501     "//base/test:test_support_perf",
502     "//testing/gtest",
503     "//testing/perf",
504     "//content/test:test_support",
505     "//components/visitedlink/browser",
506   ]