Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / extensions / shell / BUILD.gn
blobc8e1958744a92ba6305ec3e5b9309ba1cc5601d4
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("//extensions/shell/app_shell.gni")
7 # Technically, this directory should not depend on files from src/chrome, but
8 # that's where the VERSION file is. This  should probably all be moved to
9 # src/build.
10 import("//chrome/version.gni")
11 import("//testing/test.gni")
12 import("//tools/grit/grit_rule.gni")
14 assert(enable_extensions)
16 grit("resources") {
17   source = "app_shell_resources.grd"
18   outputs = [
19     "grit/app_shell_resources.h",
20     "app_shell_resources.pak",
21   ]
24 source_set("app_shell_lib") {
25   # TODO(jamescook): investigate and get rid of test dependencies. This library
26   # is testonly because it depends on testonly libraries, namely
27   # //content/shell:content_shell_lib. See http://crbug.com/438283
28   testonly = true
29   deps = [
30     ":resources",
31     ":version_header",
32     "//base",
33     "//base:prefs",
34     "//components/devtools_discovery",
35     "//components/devtools_http_handler",
36     "//components/guest_view/browser",
37     "//components/guest_view/common",
38     "//components/guest_view/renderer",
39     "//components/pref_registry",
40     "//components/update_client",
41     "//components/user_prefs",
42     "//components/web_cache/renderer",
43     "//content",
44     "//content/shell:content_shell_lib",
45     "//device/core",
46     "//device/hid",
47     "//extensions/common/api",
48     "//extensions/common/api:api_registration",
49     "//extensions/browser",
50     "//extensions/common",
51     "//extensions/renderer",
52     "//extensions/shell/common/api",
53     "//extensions/shell/common/api:api_registration",
54     "//extensions/utility",
55     "//extensions:extensions_resources",
56     "//extensions:shell_and_test_pak",
57     "//mojo/environment:chromium",
58     "//skia",
59     "//third_party/WebKit/public:blink",
60     "//third_party/mojo/src/mojo/edk/system",
61     "//ui/base",
62     "//ui/base/ime",
63     "//v8",
64   ]
66   sources = rebase_path(app_shell_gypi_values.app_shell_lib_sources,
67                         ".",
68                         "//extensions/shell")
70   if (use_aura) {
71     deps += [ "//ui/wm" ]
73     aura_sources = rebase_path(app_shell_gypi_values.app_shell_lib_sources_aura,
74                                ".",
75                                "//extensions/shell")
76     sources += aura_sources
77   }
79   if (is_chromeos) {
80     deps += [
81       "//chromeos",
82       "//ui/chromeos:ui_chromeos",
83       "//ui/display",
84     ]
85     chromeos_sources =
86         rebase_path(app_shell_gypi_values.app_shell_lib_sources_chromeos,
87                     ".",
88                     "//extensions/shell")
89     sources += chromeos_sources
90   }
92   # TODO(GYP): Enable this when //components/nacl GN is done. See
93   # http://crbug.com/430602
94   if (false) {
95     if (enable_nacl) {
96       if (is_linux) {
97         deps += [ "//components/nacl:nacl_helper" ]
98       }
99       deps += [
100         "//components/nacl",
101         "//components/nacl:browser",
102         "//components/nacl:common",
103         "//components/nacl:renderer",
104         "//components/nacl:switches",
105       ]
106       nacl_sources =
107           rebase_path(app_shell_gypi_values.app_shell_lib_sources_nacl,
108                       ".",
109                       "//extensions/shell")
110       sources += nacl_sources
111     }
112   }
114   if (enable_nacl) {
115     sources += [
116       "browser/shell_nacl_browser_delegate.cc",
117       "browser/shell_nacl_browser_delegate.h",
118     ]
120     deps += [
121       "//components/nacl",
122       "//components/nacl:nacl_browser",
123       "//components/nacl:nacl_common",
124       "//components/nacl:nacl_renderer",
125       "//components/nacl:nacl_switches",
126       "//components/nacl/renderer/plugin:nacl_trusted_plugin",
127     ]
129     if (is_linux) {
130       deps += [ "//components/nacl:nacl_helper" ]
131     }
132   }
134   if (cld_version == 2) {
135     deps += [ "//third_party/cld_2:cld2_platform_impl" ]
136   }
139 if (!(is_chromeos && !use_ozone)) {
140   executable("app_shell") {
141     # testonly because :app_shell_lib is testonly. See :app_shell_lib comment.
142     testonly = true
143     sources = rebase_path(app_shell_gypi_values.app_shell_sources,
144                           ".",
145                           "//extensions/shell")
146     deps = [
147       ":app_shell_lib",
148       "//extensions:shell_and_test_pak",
149     ]
151     if (is_win) {
152       configs += [ "//build/config/win:windowed" ]
153       configs -= [ "//build/config/win:console" ]
154       deps += [ "//base/allocator" ]
155     }
157     if (is_mac) {
158       # TODO(GYP): Mac bundling
159     }
160   }
163 # TODO(GYP): Delete this after we've converted everything to GN.
164 # The _run targets exist only for compatibility w/ GYP.
165 group("app_shell_unittests_run") {
166   testonly = true
167   deps = [
168     ":app_shell_unittests",
169   ]
172 test("app_shell_unittests") {
173   sources = rebase_path(app_shell_gypi_values.app_shell_unittests_sources,
174                         ".",
175                         "//extensions/shell")
177   data = [
178     "//extensions/test/data/",
179     "$root_out_dir/extensions_shell_and_test.pak",
181     #"$root_out_dir/natives_blob.bin", # move to gin
182     #"$root_out_dir/snapshot_blob.bin",
183   ]
185   deps = [
186     ":app_shell_lib",
187     "//base",
188     "//base/test:test_support",
189     "//content/test:test_support",
190     "//extensions:shell_and_test_pak",
191     "//extensions:test_support",
192     "//testing/gtest",
193   ]
195   data_deps = [
196     # "//gin", # TODO(dpranke): Either gin or v8 data is needed ...
197     "//third_party/mesa:osmesa",
198   ]
200   if (use_aura) {
201     deps += [ "//ui/aura:test_support" ]
203     aura_sources =
204         rebase_path(app_shell_gypi_values.app_shell_unittests_sources_aura,
205                     ".",
206                     "//extensions/shell")
207     sources += aura_sources
208   }
210   if (is_chromeos) {
211     deps += [ "//chromeos:test_support_without_gmock" ]
213     chromeos_sources =
214         rebase_path(app_shell_gypi_values.app_shell_unittests_sources_chromeos,
215                     ".",
216                     "//extensions/shell")
217     sources += chromeos_sources
218   }
220   # TODO(GYP): Enable this when //components/nacl GN is done.
221   if (false) {
222     if (use_nacl) {
223       nacl_sources =
224           rebase_path(app_shell_gypi_values.app_shell_unittests_sources_nacl,
225                       ".",
226                       "//extensions/shell")
227       sources += nacl_sources
228     }
229   }
231   if (is_win) {
232     deps += [ "//base/allocator" ]
233   }
236 process_version("version_header") {
237   template_file = "common/version.h.in"
238   output = "$target_gen_dir/common/version.h"