OOPIF: Allow navigations on a RFH without a site to stay in same process.
[chromium-blink-merge.git] / chromecast / chromecast.gyp
blob687d3e89f5ad1da34e2803193645f834208d4a13
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.
6   'variables': {
7     'chromium_code': 1,
8     'chromecast_branding%': 'Chromium',
9   },
10   'target_defaults': {
11     'include_dirs': [
12       '..',  # Root of Chromium checkout
13     ],
14   },
15   'targets': [
16     {
17       'target_name': 'cast_common',
18       'type': '<(component)',
19       'dependencies': [
20         '../base/base.gyp:base',
21       ],
22       'sources': [
23         'common/cast_paths.cc',
24         'common/cast_paths.h',
25         'common/cast_resource_delegate.cc',
26         'common/cast_resource_delegate.h',
27         'common/chromecast_config.cc',
28         'common/chromecast_config.h',
29         'common/chromecast_switches.cc',
30         'common/chromecast_switches.h',
31         'common/pref_names.cc',
32         'common/pref_names.h',
33       ],
34       'conditions': [
35         ['chromecast_branding=="Chrome"', {
36           'dependencies': [
37             'internal/chromecast_internal.gyp:cast_common_internal',
38           ],
39         }, {
40           'sources': [
41             'common/chromecast_config_simple.cc',
42           ],
43         }],
44       ],
45     },
46     {
47       'target_name': 'cast_metrics',
48       'type': '<(component)',
49       'dependencies': [
50         'cast_common',
51         '../components/components.gyp:component_metrics_proto',
52         '../components/components.gyp:metrics',
53         '../components/components.gyp:metrics_gpu',
54         '../components/components.gyp:metrics_net',
55         '../components/components.gyp:metrics_profiler',
56       ],
57       'sources': [
58         'metrics/cast_metrics_prefs.cc',
59         'metrics/cast_metrics_prefs.h',
60         'metrics/cast_metrics_service_client.cc',
61         'metrics/cast_metrics_service_client.h',
62         'metrics/platform_metrics_providers.h',
63       ],
64       'conditions': [
65         ['chromecast_branding=="Chrome"', {
66           'dependencies': [
67             '<(cast_internal_gyp):cast_metrics_internal',
68           ],
69         }, {
70           'sources': [
71             'metrics/platform_metrics_providers_simple.cc',
72           ],
73         }],
74       ],
75     },
76     {
77       'target_name': 'cast_metrics_unittests',
78       'type': '<(gtest_target_type)',
79       'dependencies': [
80         'cast_metrics',
81         '../base/base.gyp:base_prefs_test_support',
82         '../base/base.gyp:run_all_unittests',
83         '../base/base.gyp:test_support_base',
84         '../components/components.gyp:component_metrics_proto',
85         '../testing/gtest.gyp:gtest',
86       ],
87       'sources': [
88         'metrics/cast_metrics_service_client_unittest.cc',
89       ],
90     },  # end of target 'cast_metrics_unittests'
91     {
92       'target_name': 'cast_net',
93       'type': '<(component)',
94       'sources': [
95         'net/network_change_notifier_cast.cc',
96         'net/network_change_notifier_cast.h',
97         'net/network_change_notifier_factory_cast.cc',
98         'net/network_change_notifier_factory_cast.h',
99       ],
100     },
101     {
102       'target_name': 'cast_service',
103       'type': '<(component)',
104       'dependencies': [
105         '../skia/skia.gyp:skia',
106       ],
107       'sources': [
108         'service/cast_service.cc',
109         'service/cast_service.h',
110       ],
111       'conditions': [
112         ['chromecast_branding=="Chrome"', {
113           'dependencies': [
114             'internal/chromecast_internal.gyp:cast_service_internal',
115           ],
116         }, {
117           'dependencies': [
118             '../base/base.gyp:base',
119             '../content/content.gyp:content',
120           ],
121           'conditions': [
122             ['OS=="android"', {
123               'sources': [
124                 'service/cast_service_android.cc',
125                 'service/cast_service_android.h',
126               ],
127             }, {
128               'sources': [
129                 'service/cast_service_simple.cc',
130                 'service/cast_service_simple.h',
131               ],
132             }],
133           ],
134         }],
135       ],
136     },
137     {
138       'target_name': 'cast_shell_resources',
139       'type': 'none',
140       'variables': {
141         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chromecast',
142       },
143       'actions': [
144         {
145           'action_name': 'cast_shell_resources',
146           'variables': {
147             'grit_grd_file': 'shell/browser/resources/shell_resources.grd',
148             'grit_resource_ids': 'shell/browser/resources/resource_ids',
149           },
150           'includes': [ '../build/grit_action.gypi' ],
151         },
152       ],
153       'includes': [ '../build/grit_target.gypi' ],
154     },
155     {
156       'target_name': 'cast_shell_pak',
157       'type': 'none',
158       'dependencies': [
159         'cast_shell_resources',
160         '../content/app/resources/content_resources.gyp:content_resources',
161         '../content/app/strings/content_strings.gyp:content_strings',
162         '../content/browser/devtools/devtools_resources.gyp:devtools_resources',
163         '../net/net.gyp:net_resources',
164         '../third_party/WebKit/public/blink_resources.gyp:blink_resources',
165         '../ui/resources/ui_resources.gyp:ui_resources',
166         '../ui/strings/ui_strings.gyp:ui_strings',
167       ],
168       'actions': [
169         {
170           'action_name': 'repack_cast_shell_pack',
171           'variables': {
172             'pak_inputs': [
173               '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
174               '<(SHARED_INTERMEDIATE_DIR)/chromecast/shell_resources.pak',
175               '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
176               '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
177               '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.pak',
178               '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
179               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
180               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak',
181               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
182               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
183               '<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak',
184             ],
185             'pak_output': '<(PRODUCT_DIR)/assets/cast_shell.pak',
186           },
187           'includes': [ '../build/repack_action.gypi' ],
188         },
189       ],
190     },
191     # This target contains all content-embedder implementation that is
192     # non-platform-specific.
193     {
194       'target_name': 'cast_shell_common',
195       'type': '<(component)',
196       'dependencies': [
197         'cast_common',
198         'cast_metrics',
199         'cast_service',
200         'cast_shell_pak',
201         'cast_shell_resources',
202         'cast_version_header',
203         'chromecast_locales.gyp:chromecast_locales_pak',
204         'chromecast_locales.gyp:chromecast_settings',
205         'media/media.gyp:media_base',
206         '../components/components.gyp:cdm_renderer',
207         '../components/components.gyp:component_metrics_proto',
208         '../content/content.gyp:content',
209         '../content/content.gyp:content_app_browser',
210         '../skia/skia.gyp:skia',
211         '../third_party/WebKit/public/blink.gyp:blink',
212         '../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
213       ],
214       'sources': [
215         'shell/app/cast_main_delegate.cc',
216         'shell/app/cast_main_delegate.h',
217         'shell/browser/cast_browser_context.cc',
218         'shell/browser/cast_browser_context.h',
219         'shell/browser/cast_browser_main_parts.cc',
220         'shell/browser/cast_browser_main_parts.h',
221         'shell/browser/cast_browser_process.cc',
222         'shell/browser/cast_browser_process.h',
223         'shell/browser/cast_content_browser_client.cc',
224         'shell/browser/cast_content_browser_client.h',
225         'shell/browser/cast_download_manager_delegate.cc',
226         'shell/browser/cast_download_manager_delegate.h',
227         'shell/browser/cast_http_user_agent_settings.cc',
228         'shell/browser/cast_http_user_agent_settings.h',
229         'shell/browser/cast_network_delegate.cc',
230         'shell/browser/cast_network_delegate.h',
231         'shell/browser/devtools/cast_dev_tools_delegate.cc',
232         'shell/browser/devtools/cast_dev_tools_delegate.h',
233         'shell/browser/devtools/remote_debugging_server.cc',
234         'shell/browser/devtools/remote_debugging_server.h',
235         'shell/browser/geolocation/cast_access_token_store.cc',
236         'shell/browser/geolocation/cast_access_token_store.h',
237         'shell/browser/url_request_context_factory.cc',
238         'shell/browser/url_request_context_factory.h',
239         'shell/browser/webui/webui_cast.h',
240         'shell/common/cast_content_client.cc',
241         'shell/common/cast_content_client.h',
242         'shell/renderer/cast_content_renderer_client.cc',
243         'shell/renderer/cast_content_renderer_client.h',
244         'shell/renderer/key_systems_cast.cc',
245         'shell/renderer/key_systems_cast.h',
246       ],
247       'conditions': [
248         ['chromecast_branding=="Chrome"', {
249           'dependencies': [
250             'internal/chromecast_internal.gyp:cast_shell_internal',
251           ],
252         }, {
253           'sources': [
254             'shell/browser/cast_network_delegate_simple.cc',
255             'shell/browser/devtools/remote_debugging_server_simple.cc',
256             'shell/browser/webui/webui_cast_simple.cc',
257             'shell/renderer/key_systems_cast_simple.cc',
258           ],
259         }],
260       ],
261     },
262     {
263       'target_name': 'cast_version_header',
264       'type': 'none',
265       'direct_dependent_settings': {
266         'include_dirs': [
267           '<(SHARED_INTERMEDIATE_DIR)',
268         ],
269       },
270       'actions': [
271         {
272           'action_name': 'version_header',
273           'message': 'Generating version header file: <@(_outputs)',
274           'inputs': [
275             '<(version_path)',
276             'common/version.h.in',
277           ],
278           'outputs': [
279             '<(SHARED_INTERMEDIATE_DIR)/chromecast/common/version.h',
280           ],
281           'action': [
282             'python',
283             '<(version_py_path)',
284             '-e', 'VERSION_FULL="<(version_full)"',
285             # Revision is taken from buildbot if available; otherwise, a dev string is used.
286             '-e', 'CAST_BUILD_REVISION="<!(echo ${BUILD_NUMBER:="local.${USER}"})"',
287             '-e', 'CAST_IS_DEBUG_BUILD=1 if "<(CONFIGURATION_NAME)" == "Debug" else 0',
288             'common/version.h.in',
289             '<@(_outputs)',
290           ],
291           'includes': [
292             '../build/util/version.gypi',
293           ],
294         },
295       ],
296     },
297     {
298       'target_name': 'cast_tests',
299       'type': 'none',
300       'dependencies': [
301         'media/media.gyp:cast_media_unittests',
302       ],
303     },
304   ],  # end of targets
306   # Targets for Android receiver.
307   'conditions': [
308     ['OS=="android"', {
309       'targets': [
310         {
311           'target_name': 'libcast_shell_android',
312           'type': 'shared_library',
313           'dependencies': [
314             'cast_common',
315             'cast_jni_headers',
316             'cast_shell_common',
317             'cast_shell_pak',
318             'cast_version_header',
319             '../base/base.gyp:base',
320             '../content/content.gyp:content_app_browser',
321             '../content/content.gyp:content',
322             '../skia/skia.gyp:skia',
323             '../ui/gfx/gfx.gyp:gfx',
324             '../ui/gl/gl.gyp:gl',
325           ],
326           'sources': [
327             'android/cast_jni_registrar.cc',
328             'android/cast_jni_registrar.h',
329             'android/chromecast_config_android.cc',
330             'android/chromecast_config_android.h',
331             'android/platform_jni_loader.h',
332             'shell/app/android/cast_jni_loader.cc',
333             'shell/browser/android/cast_window_manager.cc',
334             'shell/browser/android/cast_window_manager.h',
335             'shell/browser/android/cast_window_android.cc',
336             'shell/browser/android/cast_window_android.h',
337           ],
338           'conditions': [
339             ['chromecast_branding=="Chrome"', {
340               'dependencies': [
341                 '<(cast_internal_gyp):cast_shell_android_internal'
342               ],
343             }, {
344               'sources': [
345                 'android/platform_jni_loader_stub.cc',
346               ],
347             }]
348           ],
349         },  # end of target 'libcast_shell_android'
350         {
351           'target_name': 'cast_shell_java',
352           'type': 'none',
353           'dependencies': [
354             '../base/base.gyp:base_java',
355             '../content/content.gyp:content_java',
356             '../media/media.gyp:media_java',
357             '../net/net.gyp:net_java',
358             '../third_party/android_tools/android_tools.gyp:android_support_v13_javalib',
359             '../ui/android/ui_android.gyp:ui_java',
360           ],
361           'variables': {
362             'has_java_resources': 1,
363             'java_in_dir': 'shell/android/apk',
364             'resource_dir': 'shell/android/apk/res',
365             'R_package': 'org.chromium.chromecast.shell',
366           },
367           'includes': ['../build/java.gypi'],
368         },  # end of target 'cast_shell_java'
369         {
370           'target_name': 'cast_shell_apk',
371           'type': 'none',
372           'dependencies': [
373             'cast_shell_java',
374             'libcast_shell_android',
375           ],
376           'variables': {
377             'apk_name': 'CastShell',
378             'manifest_package_name': 'org.chromium.chromecast.shell',
379             # Note(gunsch): there are no Java files in the android/ directory.
380             # Unfortunately, the java_apk.gypi target rigidly insists on having
381             # a java_in_dir directory, but complains about duplicate classes
382             # from the common cast_shell_java target (shared with internal APK)
383             # if the actual Java path is used.
384             # This will hopefully be removable after the great GN migration.
385             'java_in_dir': 'android',
386             'android_manifest_path': 'shell/android/apk/AndroidManifest.xml',
387             'package_name': 'org.chromium.chromecast.shell',
388             'native_lib_target': 'libcast_shell_android',
389             'asset_location': '<(PRODUCT_DIR)/assets',
390             'additional_input_paths': ['<(PRODUCT_DIR)/assets/cast_shell.pak'],
391           },
392           'includes': [ '../build/java_apk.gypi' ],
393         },
394         {
395           'target_name': 'cast_jni_headers',
396           'type': 'none',
397           'sources': [
398             'shell/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java',
399             'shell/android/apk/src/org/chromium/chromecast/shell/CastWindowManager.java',
400           ],
401           'direct_dependent_settings': {
402             'include_dirs': [
403               '<(SHARED_INTERMEDIATE_DIR)/chromecast',
404             ],
405           },
406           'variables': {
407             'jni_gen_package': 'chromecast',
408           },
409           'includes': [ '../build/jni_generator.gypi' ],
410         },
411       ],  # end of targets
412     }, {  # OS != "android"
413       'targets': [
414         # This target contains all of the primary code of |cast_shell|, except
415         # for |main|. This allows end-to-end tests using |cast_shell|.
416         # This also includes all targets that cannot be built on Android.
417         {
418           'target_name': 'cast_shell_core',
419           'type': '<(component)',
420           'dependencies': [
421             'cast_net',
422             'cast_shell_common',
423             'media/media.gyp:cast_media',
424             '../ui/aura/aura.gyp:aura_test_support',
425           ],
426           'conditions': [
427             ['chromecast_branding=="Chrome"', {
428               'dependencies': [
429                 'internal/chromecast_internal.gyp:cast_gfx_internal',
430               ],
431             }, {
432               'dependencies': [
433                 '../ui/ozone/ozone.gyp:eglplatform_shim_x11',
434               ],
435             }],
436           ],
437         },
438         {
439           'target_name': 'cast_shell',
440           'type': 'executable',
441           'dependencies': [
442             'cast_shell_core',
443           ],
444           'sources': [
445             'shell/app/cast_main.cc',
446           ],
447         },
448         {
449           'target_name': 'cast_shell_browser_test',
450           'type': '<(gtest_target_type)',
451           'dependencies': [
452             'cast_shell_test_support',
453             '../testing/gtest.gyp:gtest',
454           ],
455           'defines': [
456             'HAS_OUT_OF_PROC_TEST_RUNNER',
457           ],
458           'sources': [
459             'shell/browser/test/chromecast_shell_browser_test.cc',
460           ],
461         },
462         {
463           'target_name': 'cast_shell_test_support',
464           'type': '<(component)',
465           'defines': [
466             'HAS_OUT_OF_PROC_TEST_RUNNER',
467           ],
468           'dependencies': [
469             'cast_shell_core',
470             '../content/content_shell_and_tests.gyp:content_browser_test_support',
471             '../testing/gtest.gyp:gtest',
472           ],
473           'sources': [
474             'shell/browser/test/chromecast_browser_test.cc',
475             'shell/browser/test/chromecast_browser_test.h',
476             'shell/browser/test/chromecast_browser_test_runner.cc',
477           ],
478         },
479       ],  # end of targets
480     }],
481   ],  # end of conditions