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.
4
5{
6  'variables': {
7    'chromium_code': 1,
8  },
9  'targets': [
10    {
11      'target_name': 'app_shell_lib',
12      'type': 'static_library',
13      'defines!': ['CONTENT_IMPLEMENTATION'],
14      'dependencies': [
15        'app_shell_version_header',
16        '<(DEPTH)/base/base.gyp:base',
17        '<(DEPTH)/base/base.gyp:base_prefs_test_support',
18        '<(DEPTH)/components/components.gyp:omaha_query_params',
19        '<(DEPTH)/components/components.gyp:pref_registry',
20        '<(DEPTH)/components/components.gyp:user_prefs',
21        '<(DEPTH)/components/components.gyp:web_cache_renderer',
22        '<(DEPTH)/content/content.gyp:content',
23        '<(DEPTH)/content/content.gyp:content_gpu',
24        '<(DEPTH)/content/content.gyp:content_ppapi_plugin',
25        '<(DEPTH)/content/content_shell_and_tests.gyp:content_shell_lib',
26        '<(DEPTH)/device/core/core.gyp:device_core',
27        '<(DEPTH)/device/hid/hid.gyp:device_hid',
28        '<(DEPTH)/extensions/browser/api/api_registration.gyp:extensions_api_registration',
29        '<(DEPTH)/extensions/common/api/api.gyp:extensions_api',
30        '<(DEPTH)/extensions/extensions.gyp:extensions_browser',
31        '<(DEPTH)/extensions/extensions.gyp:extensions_common',
32        '<(DEPTH)/extensions/extensions.gyp:extensions_renderer',
33        '<(DEPTH)/extensions/extensions.gyp:extensions_shell_and_test_pak',
34        '<(DEPTH)/extensions/extensions_resources.gyp:extensions_resources',
35        '<(DEPTH)/mojo/mojo_base.gyp:mojo_environment_chromium',
36        '<(DEPTH)/mojo/mojo_base.gyp:mojo_system_impl',
37        '<(DEPTH)/skia/skia.gyp:skia',
38        '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
39        '<(DEPTH)/ui/wm/wm.gyp:wm',
40        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
41      ],
42      'include_dirs': [
43        '../..',
44        '<(SHARED_INTERMEDIATE_DIR)',
45        '<(SHARED_INTERMEDIATE_DIR)/extensions/shell',
46      ],
47      'sources': [
48        'app/shell_main_delegate.cc',
49        'app/shell_main_delegate.h',
50        'browser/default_shell_browser_main_delegate.cc',
51        'browser/default_shell_browser_main_delegate.h',
52        'browser/desktop_controller.cc',
53        'browser/desktop_controller.h',
54        'browser/media_capture_util.cc',
55        'browser/media_capture_util.h',
56        'browser/shell_app_delegate.cc',
57        'browser/shell_app_delegate.h',
58        'browser/shell_app_window_client.cc',
59        'browser/shell_app_window_client.h',
60        'browser/shell_audio_controller_chromeos.cc',
61        'browser/shell_audio_controller_chromeos.h',
62        'browser/shell_browser_context.cc',
63        'browser/shell_browser_context.h',
64        'browser/shell_browser_main_delegate.h',
65        'browser/shell_browser_main_parts.cc',
66        'browser/shell_browser_main_parts.h',
67        'browser/shell_content_browser_client.cc',
68        'browser/shell_content_browser_client.h',
69        'browser/shell_desktop_controller.cc',
70        'browser/shell_desktop_controller.h',
71        'browser/shell_device_client.cc',
72        'browser/shell_device_client.h',
73        'browser/shell_display_info_provider.cc',
74        'browser/shell_display_info_provider.h',
75        'browser/shell_extension_host_delegate.cc',
76        'browser/shell_extension_host_delegate.h',
77        'browser/shell_extension_system.cc',
78        'browser/shell_extension_system.h',
79        'browser/shell_extension_system_factory.cc',
80        'browser/shell_extension_system_factory.h',
81        'browser/shell_extension_web_contents_observer.cc',
82        'browser/shell_extension_web_contents_observer.h',
83        'browser/shell_extensions_browser_client.cc',
84        'browser/shell_extensions_browser_client.h',
85        'browser/shell_native_app_window.cc',
86        'browser/shell_native_app_window.h',
87        'browser/shell_network_controller_chromeos.cc',
88        'browser/shell_network_controller_chromeos.h',
89        'browser/shell_omaha_query_params_delegate.cc',
90        'browser/shell_omaha_query_params_delegate.h',
91        'browser/shell_runtime_api_delegate.cc',
92        'browser/shell_runtime_api_delegate.h',
93        'browser/shell_special_storage_policy.cc',
94        'browser/shell_special_storage_policy.h',
95        'browser/shell_web_contents_modal_dialog_manager.cc',
96        'common/shell_content_client.cc',
97        'common/shell_content_client.h',
98        'common/shell_extensions_client.cc',
99        'common/shell_extensions_client.h',
100        'common/switches.h',
101        'common/switches.cc',
102        'renderer/shell_content_renderer_client.cc',
103        'renderer/shell_content_renderer_client.h',
104        'renderer/shell_extensions_renderer_client.cc',
105        'renderer/shell_extensions_renderer_client.h',
106      ],
107      'conditions': [
108        ['chromeos==1', {
109          'dependencies': [
110            '<(DEPTH)/chromeos/chromeos.gyp:chromeos',
111            '<(DEPTH)/ui/chromeos/ui_chromeos.gyp:ui_chromeos',
112            '<(DEPTH)/ui/display/display.gyp:display',
113          ],
114        }],
115        ['disable_nacl==0 and OS=="linux"', {
116          'dependencies': [
117            '<(DEPTH)/components/nacl.gyp:nacl_helper',
118          ],
119        }],
120        ['disable_nacl==0', {
121          'dependencies': [
122            '<(DEPTH)/components/nacl.gyp:nacl',
123            '<(DEPTH)/components/nacl.gyp:nacl_browser',
124            '<(DEPTH)/components/nacl.gyp:nacl_common',
125            '<(DEPTH)/components/nacl.gyp:nacl_renderer',
126            '<(DEPTH)/components/nacl.gyp:nacl_switches',
127          ],
128          'sources': [
129            'browser/shell_nacl_browser_delegate.cc',
130            'browser/shell_nacl_browser_delegate.h',
131          ],
132        }],
133      ],
134    },
135    {
136      'target_name': 'app_shell',
137      'type': 'executable',
138      'defines!': ['CONTENT_IMPLEMENTATION'],
139      'dependencies': [
140        'app_shell_lib',
141        '<(DEPTH)/extensions/extensions.gyp:extensions_shell_and_test_pak',
142      ],
143      'include_dirs': [
144        '../..',
145      ],
146      'sources': [
147        'app/shell_main.cc',
148      ],
149      'conditions': [
150        ['OS=="win"', {
151          'msvs_settings': {
152            'VCLinkerTool': {
153              'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
154            },
155          },
156          'dependencies': [
157            '<(DEPTH)/sandbox/sandbox.gyp:sandbox',
158          ],
159        }],
160      ],
161    },
162    {
163      'target_name': 'app_shell_browsertests',
164      'type': '<(gtest_target_type)',
165      'dependencies': [
166        'app_shell_lib',
167        # TODO(yoz): find the right deps
168        '<(DEPTH)/base/base.gyp:test_support_base',
169        '<(DEPTH)/content/content.gyp:content_app_both',
170        '<(DEPTH)/content/content_shell_and_tests.gyp:content_browser_test_support',
171        '<(DEPTH)/content/content_shell_and_tests.gyp:test_support_content',
172        '<(DEPTH)/extensions/extensions.gyp:extensions_test_support',
173        '<(DEPTH)/testing/gtest.gyp:gtest',
174      ],
175      'defines': [
176        'HAS_OUT_OF_PROC_TEST_RUNNER',
177      ],
178      'sources': [
179        # TODO(yoz): Refactor once we have a second test target.
180        # TODO(yoz): Something is off here; should this .gyp file be
181        # in the parent directory? Test target extensions_browsertests?
182        '../browser/api/dns/dns_apitest.cc',
183        '../browser/api/socket/socket_apitest.cc',
184        '../browser/api/sockets_tcp/sockets_tcp_apitest.cc',
185        '../browser/api/sockets_udp/sockets_udp_apitest.cc',
186        '../browser/guest_view/web_view/web_view_apitest.cc',
187        'browser/shell_browsertest.cc',
188        'test/shell_apitest.cc',
189        'test/shell_apitest.h',
190        'test/shell_test.cc',
191        'test/shell_test.h',
192        'test/shell_test_launcher_delegate.cc',
193        'test/shell_test_launcher_delegate.h',
194        'test/shell_tests_main.cc',
195      ],
196    },
197    {
198      'target_name': 'app_shell_unittests',
199      'type': 'executable',
200      'dependencies': [
201        'app_shell_lib',
202        '<(DEPTH)/base/base.gyp:base',
203        '<(DEPTH)/base/base.gyp:test_support_base',
204        '<(DEPTH)/content/content.gyp:content_app_both',
205        '<(DEPTH)/content/content_shell_and_tests.gyp:test_support_content',
206        '<(DEPTH)/extensions/extensions.gyp:extensions_shell_and_test_pak',
207        '<(DEPTH)/extensions/extensions.gyp:extensions_test_support',
208        '<(DEPTH)/testing/gtest.gyp:gtest',
209        '<(DEPTH)/ui/aura/aura.gyp:aura_test_support',
210      ],
211      'sources': [
212        '../test/extensions_unittests_main.cc',
213        'browser/shell_audio_controller_chromeos_unittest.cc',
214        'browser/shell_desktop_controller_unittest.cc',
215        'browser/shell_nacl_browser_delegate_unittest.cc',
216        'common/shell_content_client_unittest.cc'
217      ],
218      'conditions': [
219        ['disable_nacl==1', {
220          'sources!': [
221            'browser/shell_nacl_browser_delegate_unittest.cc',
222          ],
223        }],
224        ['chromeos==1', {
225          'dependencies': [
226            '<(DEPTH)/chromeos/chromeos.gyp:chromeos_test_support_without_gmock',
227          ],
228        }],
229      ],
230    },
231    {
232      'target_name': 'app_shell_version_header',
233      'type': 'none',
234      'direct_dependent_settings': {
235        'include_dirs': [
236          '<(SHARED_INTERMEDIATE_DIR)',
237        ],
238      },
239      'actions': [
240        {
241          'action_name': 'version_header',
242          'message': 'Generating version header file: <@(_outputs)',
243          'variables': {
244            'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
245          },
246          'inputs': [
247            '<(version_path)',
248            '<(lastchange_path)',
249            'common/version.h.in',
250          ],
251          'outputs': [
252            '<(SHARED_INTERMEDIATE_DIR)/extensions/shell/common/version.h',
253          ],
254          'action': [
255            'python',
256            '<(version_py_path)',
257            '-e', 'VERSION_FULL="<(version_full)"',
258            '-f', '<(lastchange_path)',
259            'common/version.h.in',
260            '<@(_outputs)',
261          ],
262          'includes': [
263            '../../build/util/version.gypi',
264          ],
265        },
266      ],
267    },
268  ],  # targets
269}
270