In the presubmit for auto-bisect, run pylint and unit tests.
[chromium-blink-merge.git] / ash / BUILD.gn
blobb49942e8cada90f5777452e34bd3ae413be13f09
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")
8 gypi_values = exec_script(
9     "//build/gypi_to_gn.py",
10     [ rebase_path("ash.gyp") ],
11     "scope",
12     [ "ash.gyp" ])
14 component("ash") {
15   sources = gypi_values.ash_sources
17   defines = [ "ASH_IMPLEMENTATION" ]
19   deps = [
20     "//ash/resources",
21     "//ash/strings",
22     "//base",
23     "//base:i18n",
24     "//base/third_party/dynamic_annotations",
25     "//cc",
26     "//components/user_manager",
27     "//content/public/browser",
28     "//media",
29     "//net",
30     "//skia",
31     "//third_party/icu",
32     "//ui/accessibility",
33     "//ui/app_list",
34     "//ui/aura",
35     "//ui/base",
36     "//ui/compositor",
37     "//ui/events",
38     "//ui/events:events_base",
39     "//ui/gfx",
40     "//ui/gfx/geometry",
41     "//ui/keyboard",
42     "//ui/message_center",
43     "//ui/resources",
44     "//ui/strings",
45     "//ui/views",
46     "//ui/views/controls/webview",
47     "//ui/web_dialogs",
48     "//ui/wm",
49     "//url",
50   ]
52   forward_dependent_configs_from = [
53     "//ash/resources",
54     "//ash/strings",
55   ]
57   if (is_win) {
58     sources -= [
59       "sticky_keys/sticky_keys_controller.cc",
60       "sticky_keys/sticky_keys_controller.h",
61     ]
62     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
63     cflags = [ "/wd4267" ]
64   }
66   if (use_x11) {
67     configs += [
68       "//build/config/linux:xfixes",
69     ]
70   } else {
71     sources -= [
72       "accelerators/key_hold_detector.cc",
73       "accelerators/key_hold_detector.h",
74       "accelerators/magnifier_key_scroller.cc",
75       "accelerators/magnifier_key_scroller.h",
76       "accelerators/spoken_feedback_toggler.cc",
77       "accelerators/spoken_feedback_toggler.h",
78     ]
79   }
81   if (is_chromeos) {
82     deps += [
83       "//device/bluetooth",
84       "//ui/display",
85       "//ui/display/util",
86       #'../chromeos/chromeos.gyp:chromeos',  TODO(GYP)
87       # Ash #includes power_supply_properties.pb.h directly.
88       #'../chromeos/chromeos.gyp:power_manager_proto',  TODO(GYP)
89       #'../ui/chromeos/ui_chromeos.gyp:ui_chromeos_resources',  TODO(GYP)
90       #'../ui/chromeos/ui_chromeos.gyp:ui_chromeos_strings',  TODO(GYP)
91       #'../ui/chromeos/ui_chromeos.gyp:ui_chromeos',  TODO(GYP)
92     ]
93   } else {
94     sources -= [
95       "display/display_configurator_animation.cc",
96       "display/display_configurator_animation.h",
97       "display/resolution_notification_controller.cc",
98       "display/resolution_notification_controller.h",
99       "system/tray/media_security/media_capture_observer.h",
100       "system/tray/media_security/multi_profile_media_tray_item.cc",
101       "system/tray/media_security/multi_profile_media_tray_item.h",
102     ]
103   }
105   if (!use_x11 || !is_chromeos) {
106     sources -= [
107       "touch/touch_transformer_controller.cc",
108       "touch/touch_transformer_controller.h",
109     ]
110   }
112   if (!use_ozone) {
113     sources -= [
114       "display/mouse_cursor_event_filter_ozone.cc",
115     ]
116   }
118   if (!use_ozone) {
119     sources -= [
120       "host/ash_window_tree_host_ozone.cc",
121     ]
122   }
125 component("ash_with_content") {
126   sources = [
127     "content_support/ash_with_content_export.h",
128     "content_support/gpu_support_impl.cc",
129     "content_support/gpu_support_impl.h",
130     "screensaver/screensaver_view.cc",
131     "screensaver/screensaver_view.h",
132     "keyboard_overlay/keyboard_overlay_delegate.cc",
133     "keyboard_overlay/keyboard_overlay_delegate.h",
134     "keyboard_overlay/keyboard_overlay_view.cc",
135     "keyboard_overlay/keyboard_overlay_view.h",
136   ]
138   defines = [ "ASH_WITH_CONTENT_IMPLEMENTATION" ]
140   deps = [
141     ":ash",
142     "//base",
143     "//base/third_party/dynamic_annotations",
144     "//content/public/browser",
145     "//ipc",
146     "//skia",
147     "//ui/aura",
148     "//ui/base",
149     "//ui/compositor",
150     "//ui/events",
151     "//ui/gfx",
152     "//ui/gfx/geometry",
153     "//ui/resources",
154     "//ui/strings",
155     "//ui/views",
156     "//ui/views/controls/webview",
157     "//ui/web_dialogs",
158     "//url",
159   ]
161   forward_dependent_configs_from = [
162     ":ash",
163   ]
166 static_library("test_support") {
167   sources = gypi_values.ash_test_support_sources
169   deps = [
170     ":ash",
171     "//ash/resources",
172     "//content/test:test_support",
173     "//skia",
174     "//testing/gtest",
175     "//ui/accessibility",
176     "//ui/app_list",
177     "//ui/app_list:test_support",
178     "//ui/events:events_base",
179     "//ui/gl",
180     "//ui/views",
181     "//ui/views:test_support",
182   ]
184   if (is_win) {
185     sources += [
186       "test/test_metro_viewer_process_host.cc",
187       "test/test_metro_viewer_process_host.h",
188     ]
189     deps += [
190       "//ipc",
191       #'../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages',  TODO(GYP)
192       #'../win8/win8.gyp:metro_viewer',  TODO(GYP)
193       #'../win8/win8.gyp:test_support_win8',  TODO(GYP)
194       #'../win8/win8_tests.gyp:test_registrar',  TODO(GYP)
195     ]
196   }
199 static_library("ash_shell_lib") {
200   sources = gypi_values.ash_shell_lib_sources
202   deps = [
203     ":ash",
204     ":ash_with_content",
205     ":test_support",
206     "//ash/resources",
207     "//ash/strings",
208     "//base",
209     "//base:i18n",
210     #"//chrome:packed_resources",  TODO(GYP)
211     "//content",
212     "//content/shell:content_shell_lib",
213     "//net",
214     "//skia",
215     "//third_party/icu",
216     "//ui/app_list",
217     "//ui/aura",
218     "//ui/base",
219     "//ui/compositor",
220     "//ui/events",
221     "//ui/events:events_base",
222     "//ui/gfx",
223     "//ui/gfx/geometry",
224     "//ui/keyboard",
225     "//ui/message_center",
226     "//ui/resources",
227     "//ui/views",
228     "//ui/views:test_support",
229     #'../ui/views/examples/examples.gyp:views_examples_lib',  TODO(GYP)
230     #'../ui/views/examples/examples.gyp:views_examples_with_content_lib',  TODO(GYP)
231   ]
234 if (false) {  # TODO(GYP) enable ash shell and unit tests when they link.
236 test("ash_unittests") {
237   sources = gypi_values.ash_unittests_sources
239   deps = [
240     ":ash",
241     ":ash_with_content",
242     ":test_support",
243     "//ash/resources",
244     "//ash/strings",
245     "//base",
246     "//base/allocator",
247     "//base/test:test_support",
248     "//components/user_manager",
249     "//content/public/browser",
250     "//content/test:test_support",
251     "//skia",
252     "//testing/gtest",
253     "//third_party/icu",
254     "//ui/accessibility",
255     "//ui/aura",
256     "//ui/aura:test_support",
257     "//ui/base",
258     "//ui/base:test_support",
259     "//ui/compositor",
260     "//ui/compositor:test_support",
261     "//ui/events",
262     "//ui/events:test_support",
263     "//ui/events:gesture_detection",
264     "//ui/gfx",
265     "//ui/gfx/geometry",
266     "//ui/keyboard",
267     "//ui/message_center",
268     "//ui/message_center:test_support",
269     "//ui/resources",
270     "//ui/views",
271     "//ui/views:test_support",
272     "//ui/views/controls/webview:test_support",
273     "//ui/web_dialogs",
274     "//ui/wm",
275     "//url",
276   ]
278   if (!is_chromeos) {
279     sources -= [
280       # TODO(zork): fix this test to build on Windows. See: crosbug.com/26906
281       "focus_cycler_unittest.cc",
282       # All tests for multiple displays: not supported on Windows Ash.
283       "accelerators/nested_dispatcher_controller_unittest.cc",
284       "wm/drag_window_resizer_unittest.cc",
285       # Can't resize on Windows Ash. http://crbug.com/165962
286       "ash_root_window_transformer_unittest.cc",
287       "magnifier/magnification_controller_unittest.cc",
288       "wm/workspace/workspace_window_resizer_unittest.cc",
289       "sticky_keys/sticky_keys_overlay_unittest.cc",
290       "sticky_keys/sticky_keys_unittest.cc",
291       "system/tray/media_security/multi_profile_media_tray_item_unittest.cc",
292       "autoclick/autoclick_unittest.cc",
293     ]
294     sources += [
295       #'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',  TODO(GYP)
296     ]
297   }
299   if (is_win) {
300     cflags = [ "/wd4267" ]
301   }
303   if (!use_x11) {
304     sources -= [
305       "accelerators/magnifier_key_scroller_unittest.cc",
306       "accelerators/spoken_feedback_toggler_unittest.cc",
307       "touch/touch_transformer_controller_unittest.cc",
308     ]
309   }
310   if (is_chromeos) {
311     sources += [ "first_run/first_run_helper_unittest.cc" ]
312     deps += [
313       "//device/bluetooth",
314       "//ui/display",
315       "//ui/display:test_util",
316       "//ui/display/types",
317       #'../chromeos/chromeos.gyp:chromeos_test_support_without_gmock',  TODO(GYP)
318       #'../chromeos/chromeos.gyp:power_manager_proto',  TODO(GYP)
319     ]
320   } else {
321     sources -= [
322       "display/resolution_notification_controller_unittest.cc",
323       "touch/touch_transformer_controller_unittest.cc",
324     ]
325   }
327   # TODO(GYP) is this necessary?
328   #['OS=="linux" and component=="shared_library" and use_allocator!="none"', {
329   # ldflags = "-rdynamic"
331   if (use_ozone) {
332     sources -= [
333       "sticky_keys/sticky_keys_unittest.cc",  # crbug.com/354035
334     ]
335   }
338 executable("ash_shell") {
339   sources = [
340     "shell/shell_main.cc",
341   ]
343   deps = [
344     ":ash_shell_lib",
345     "//components/user_manager",
346   ]
348   if (is_win) {
349     configs -= [ "//build/config/win:console" ]
350     configs += [ "//build/config/win:windowed" ]
351     deps += [
352       "//sandbox",
353     ]
354   }
356   if (is_chromeos) {
357     deps += [
358       "../device/bluetooth/bluetooth.gyp:device_bluetooth",
359     ]
360   }
363 test("ash_shell_unittests") {
364   sources = [
365     "shell/window_watcher_unittest.cc",
366     "test/ash_unittests.cc",
367   ]
369   deps = [
370     "//base/test:test_support",
371     "//components/user_manager",
372     "//content/test:test_support",
373     "//skia",
374     "//testing/gtest",
375     "//ui/aaccessibility",
376   ]
378   if (is_chromeos) {
379     deps += [ "//ui/display" ]
380   }
383 }  # if false