Adding Peter Thatcher to the owners file.
[chromium-blink-merge.git] / extensions / shell / BUILD.gn
blob2e1297833e6d9ea59176a1411b718f128aea990c
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/pref_registry",
35     "//components/update_client",
36     "//components/user_prefs",
37     "//components/web_cache/renderer",
38     "//content",
39     "//content/shell:content_shell_lib",
40     "//device/core",
41     "//device/hid",
42     "//extensions/common/api",
43     "//extensions/common/api:api_registration",
44     "//extensions/browser",
45     "//extensions/common",
46     "//extensions/renderer",
47     "//extensions/shell/common/api",
48     "//extensions/shell/common/api:api_registration",
49     "//extensions/utility",
50     "//extensions:extensions_resources",
51     "//extensions:shell_and_test_pak",
52     "//mojo/environment:chromium",
53     "//skia",
54     "//third_party/WebKit/public:blink",
55     "//third_party/mojo/src/mojo/edk/system",
56     "//ui/base",
57     "//ui/base/ime",
58     "//v8",
59   ]
61   sources = rebase_path(app_shell_gypi_values.app_shell_lib_sources,
62                         ".",
63                         "//extensions/shell")
65   if (use_aura) {
66     deps += [ "//ui/wm" ]
68     aura_sources = rebase_path(app_shell_gypi_values.app_shell_lib_sources_aura,
69                                ".",
70                                "//extensions/shell")
71     sources += aura_sources
72   }
74   if (is_chromeos) {
75     deps += [
76       "//chromeos",
77       "//ui/chromeos:ui_chromeos",
78       "//ui/display",
79     ]
80     chromeos_sources =
81         rebase_path(app_shell_gypi_values.app_shell_lib_sources_chromeos,
82                     ".",
83                     "//extensions/shell")
84     sources += chromeos_sources
85   }
87   # TODO(GYP): Enable this when //components/nacl GN is done. See
88   # http://crbug.com/430602
89   if (false) {
90     if (enable_nacl) {
91       if (is_linux) {
92         deps += [ "//components/nacl:nacl_helper" ]
93       }
94       deps += [
95         "//components/nacl",
96         "//components/nacl:browser",
97         "//components/nacl:common",
98         "//components/nacl:renderer",
99         "//components/nacl:switches",
100       ]
101       nacl_sources =
102           rebase_path(app_shell_gypi_values.app_shell_lib_sources_nacl,
103                       ".",
104                       "//extensions/shell")
105       sources += nacl_sources
106     }
107   }
109   if (enable_nacl) {
110     sources += [
111       "browser/shell_nacl_browser_delegate.cc",
112       "browser/shell_nacl_browser_delegate.h",
113     ]
115     deps += [
116       "//components/nacl",
117       "//components/nacl:nacl_browser",
118       "//components/nacl:nacl_common",
119       "//components/nacl:nacl_renderer",
120       "//components/nacl:nacl_switches",
121       "//components/nacl/renderer/plugin:nacl_trusted_plugin",
122     ]
124     if (is_linux) {
125       deps += [ "//components/nacl:nacl_helper" ]
126     }
127   }
130 if (!(is_chromeos && !use_ozone)) {
131   executable("app_shell") {
132     # testonly because :app_shell_lib is testonly. See :app_shell_lib comment.
133     testonly = true
134     sources = rebase_path(app_shell_gypi_values.app_shell_sources,
135                           ".",
136                           "//extensions/shell")
137     deps = [
138       ":app_shell_lib",
139       "//extensions:shell_and_test_pak",
140     ]
142     if (is_win) {
143       configs += [ "//build/config/win:windowed" ]
144       configs -= [ "//build/config/win:console" ]
145       deps += [ "//base/allocator" ]
146     }
148     if (is_mac) {
149       # TODO(GYP): Mac bundling
150     }
151   }
154 test("app_shell_unittests") {
155   sources = rebase_path(app_shell_gypi_values.app_shell_unittests_sources,
156                         ".",
157                         "//extensions/shell")
159   deps = [
160     ":app_shell_lib",
161     "//base",
162     "//base/test:test_support",
163     "//content/test:test_support",
164     "//extensions:shell_and_test_pak",
165     "//extensions:test_support",
166     "//testing/gtest",
167   ]
169   if (use_aura) {
170     deps += [ "//ui/aura:test_support" ]
172     aura_sources =
173         rebase_path(app_shell_gypi_values.app_shell_unittests_sources_aura,
174                     ".",
175                     "//extensions/shell")
176     sources += aura_sources
177   }
179   if (is_chromeos) {
180     deps += [ "//chromeos:test_support_without_gmock" ]
182     chromeos_sources =
183         rebase_path(app_shell_gypi_values.app_shell_unittests_sources_chromeos,
184                     ".",
185                     "//extensions/shell")
186     sources += chromeos_sources
187   }
189   # TODO(GYP): Enable this when //components/nacl GN is done.
190   if (false) {
191     if (use_nacl) {
192       nacl_sources =
193           rebase_path(app_shell_gypi_values.app_shell_unittests_sources_nacl,
194                       ".",
195                       "//extensions/shell")
196       sources += nacl_sources
197     }
198   }
200   if (is_win) {
201     deps += [ "//base/allocator" ]
202   }
205 process_version("version_header") {
206   template_file = "common/version.h.in"
207   output = "$target_gen_dir/common/version.h"