Add test_runner support for new accessibility event
[chromium-blink-merge.git] / chromecast / chromecast.gyp
blob32ceb8bfce857265a84a277bca993925f0376fd0
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     'android_support_v13_target%':
8         '../third_party/android_tools/android_tools.gyp:android_support_v13_javalib',
9     'cast_build_release': 'internal/build/cast_build_release',
10     'chromium_code': 1,
11     'chromecast_branding%': 'Chromium',
12     'disable_display%': 0,
13     'use_chromecast_webui%': 0,
14   },
15   'includes': [
16     'chromecast_tests.gypi',
17   ],
18   'target_defaults': {
19     'include_dirs': [
20       '..',  # Root of Chromium checkout
21     ],
22     'conditions': [
23       ['disable_display==1', {
24         'defines': ['DISABLE_DISPLAY'],
25       }],
26     ],
27   },
28   'targets': [
29     # Public API target for OEM partners to replace shlibs.
30     {
31       'target_name': 'cast_public_api',
32       'type': '<(component)',
33       'sources': [
34         'public/chromecast_export.h',
35       ],
36     },
37     # TODO(gunsch): Remove this fake target once it's either added or no
38     # longer referenced from internal code.
39     {'target_name': 'cast_media_audio', 'type': 'none'},
41     {
42       'target_name': 'cast_base',
43       'type': '<(component)',
44       'dependencies': [
45         '../base/base.gyp:base',
46       ],
47       'sources': [
48         'base/metrics/cast_histograms.h',
49         'base/metrics/cast_metrics_helper.cc',
50         'base/metrics/cast_metrics_helper.h',
51         'base/metrics/grouped_histogram.cc',
52         'base/metrics/grouped_histogram.h'
53       ],
54     },  # end of target 'cast_base'
55     {
56       'target_name': 'cast_crash_client',
57       'type': '<(component)',
58       'dependencies': [
59         '../breakpad/breakpad.gyp:breakpad_client',
60         '../components/components.gyp:crash_component',
61       ],
62       'sources': [
63         'crash/cast_crash_keys.cc',
64         'crash/cast_crash_keys.h',
65         'crash/cast_crash_reporter_client.cc',
66         'crash/cast_crash_reporter_client.h',
67       ],
68       'conditions': [
69         ['chromecast_branding=="Chrome"', {
70           'dependencies': [
71             '<(cast_internal_gyp):crash_internal',
72           ],
73         }, {
74           'sources': [
75             'crash/cast_crash_reporter_client_simple.cc',
76           ],
77         }],
78       ]
79     },  # end of target 'cast_crash_client'
80     {
81       'target_name': 'cast_net',
82       'type': '<(component)',
83       'sources': [
84         'net/connectivity_checker.cc',
85         'net/connectivity_checker.h',
86         'net/net_switches.cc',
87         'net/net_switches.h',
88       ],
89     },
90     {
91       'target_name': 'cast_shell_resources',
92       'type': 'none',
93       'variables': {
94         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chromecast',
95       },
96       'actions': [
97         {
98           'action_name': 'cast_shell_resources',
99           'variables': {
100             'grit_grd_file': 'app/resources/shell_resources.grd',
101             'grit_resource_ids': 'app/resources/resource_ids',
102           },
103           'includes': [ '../build/grit_action.gypi' ],
104         },
105       ],
106       'includes': [ '../build/grit_target.gypi' ],
107     },
108     {
109       'target_name': 'cast_shell_pak',
110       'type': 'none',
111       'dependencies': [
112         'cast_shell_resources',
113         '../content/app/resources/content_resources.gyp:content_resources',
114         '../content/app/strings/content_strings.gyp:content_strings',
115         '../net/net.gyp:net_resources',
116         '../third_party/WebKit/public/blink_resources.gyp:blink_resources',
117         '../ui/resources/ui_resources.gyp:ui_resources',
118         '../ui/strings/ui_strings.gyp:ui_strings',
119       ],
120       'actions': [
121         {
122           'action_name': 'repack_cast_shell_pak',
123           'variables': {
124             'pak_inputs': [
125               '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources_100_percent.pak',
126               '<(SHARED_INTERMEDIATE_DIR)/chromecast/shell_resources.pak',
127               '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
128               '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
129               '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.pak',
130               '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
131               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
132               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak',
133               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
134               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
135             ],
136             'conditions': [
137               ['chromecast_branding=="Chrome" and use_chromecast_webui==1', {
138                 'pak_inputs': [
139                   '<(SHARED_INTERMEDIATE_DIR)/chromecast/app_resources.pak',
140                   '<(SHARED_INTERMEDIATE_DIR)/chromecast/cast_webui_resources.pak',
141                 ],
142               }],
143             ],
144             'pak_output': '<(PRODUCT_DIR)/assets/cast_shell.pak',
145           },
146           'includes': [ '../build/repack_action.gypi' ],
147         },
148       ],
149       'conditions': [
150         ['chromecast_branding=="Chrome" and use_chromecast_webui==1', {
151           'dependencies': [
152             'internal/chromecast_resources.gyp:chromecast_app_resources',
153             'internal/chromecast_resources.gyp:chromecast_webui_resources',
154           ],
155         }],
156       ],
157     },  # end of target 'cast_shell_pak'
158     # This target contains all content-embedder implementation that is
159     # non-platform-specific.
160     {
161       'target_name': 'cast_shell_common',
162       'type': '<(component)',
163       'dependencies': [
164         'cast_base',
165         'cast_crash_client',
166         'cast_net',
167         'cast_shell_pak',
168         'cast_shell_resources',
169         'cast_version_header',
170         'chromecast_locales.gyp:chromecast_locales_pak',
171         'chromecast_locales.gyp:chromecast_settings',
172         'media/media.gyp:media_base',
173         '../base/base.gyp:base',
174         '../components/components.gyp:breakpad_host',
175         '../components/components.gyp:cdm_renderer',
176         '../components/components.gyp:component_metrics_proto',
177         '../components/components.gyp:crash_component',
178         '../components/components.gyp:network_hints_browser',
179         '../components/components.gyp:network_hints_renderer',
180         '../components/components.gyp:metrics',
181         '../components/components.gyp:metrics_gpu',
182         '../components/components.gyp:metrics_net',
183         '../components/components.gyp:metrics_profiler',
184         '../content/content.gyp:content',
185         '../content/content.gyp:content_app_both',
186         '../skia/skia.gyp:skia',
187         '../third_party/WebKit/public/blink.gyp:blink',
188         '../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
189       ],
190       'sources': [
191         'app/cast_main_delegate.cc',
192         'app/cast_main_delegate.h',
193         'browser/cast_browser_context.cc',
194         'browser/cast_browser_context.h',
195         'browser/cast_browser_main_parts.cc',
196         'browser/cast_browser_main_parts.h',
197         'browser/cast_browser_process.cc',
198         'browser/cast_browser_process.h',
199         'browser/cast_content_browser_client.cc',
200         'browser/cast_content_browser_client.h',
201         'browser/cast_content_window.cc',
202         'browser/cast_content_window.h',
203         'browser/cast_download_manager_delegate.cc',
204         'browser/cast_download_manager_delegate.h',
205         'browser/cast_http_user_agent_settings.cc',
206         'browser/cast_http_user_agent_settings.h',
207         'browser/cast_network_delegate.cc',
208         'browser/cast_network_delegate.h',
209         'browser/cast_resource_dispatcher_host_delegate.cc',
210         'browser/cast_resource_dispatcher_host_delegate.h',
211         'browser/devtools/cast_dev_tools_delegate.cc',
212         'browser/devtools/cast_dev_tools_delegate.h',
213         'browser/devtools/remote_debugging_server.cc',
214         'browser/devtools/remote_debugging_server.h',
215         'browser/geolocation/cast_access_token_store.cc',
216         'browser/geolocation/cast_access_token_store.h',
217         'browser/metrics/cast_metrics_prefs.cc',
218         'browser/metrics/cast_metrics_prefs.h',
219         'browser/metrics/cast_metrics_service_client.cc',
220         'browser/metrics/cast_metrics_service_client.h',
221         'browser/metrics/cast_stability_metrics_provider.cc',
222         'browser/metrics/cast_stability_metrics_provider.h',
223         'browser/metrics/platform_metrics_providers.h',
224         'browser/pref_service_helper.cc',
225         'browser/pref_service_helper.h',
226         'browser/service/cast_service.cc',
227         'browser/service/cast_service.h',
228         'browser/url_request_context_factory.cc',
229         'browser/url_request_context_factory.h',
230         'common/cast_content_client.cc',
231         'common/cast_content_client.h',
232         'common/cast_paths.cc',
233         'common/cast_paths.h',
234         'common/cast_resource_delegate.cc',
235         'common/cast_resource_delegate.h',
236         'common/chromecast_switches.cc',
237         'common/chromecast_switches.h',
238         'common/media/cast_messages.h',
239         'common/media/cast_message_generator.cc',
240         'common/media/cast_message_generator.h',
241         'common/platform_client_auth.h',
242         'common/pref_names.cc',
243         'common/pref_names.h',
244         'renderer/cast_content_renderer_client.cc',
245         'renderer/cast_content_renderer_client.h',
246         'renderer/cast_media_load_deferrer.cc',
247         'renderer/cast_media_load_deferrer.h',
248         'renderer/cast_render_process_observer.cc',
249         'renderer/cast_render_process_observer.h',
250         'renderer/key_systems_cast.cc',
251         'renderer/key_systems_cast.h',
252         'renderer/media/capabilities_message_filter.cc',
253         'renderer/media/capabilities_message_filter.h',
254       ],
255       'conditions': [
256         ['chromecast_branding=="Chrome"', {
257           'dependencies': [
258             '<(cast_internal_gyp):cast_shell_internal',
259           ],
260         }, {
261           'sources': [
262             'browser/cast_content_browser_client_simple.cc',
263             'browser/cast_network_delegate_simple.cc',
264             'browser/devtools/remote_debugging_server_simple.cc',
265             'browser/media/cast_browser_cdm_factory_simple.cc',
266             'browser/metrics/platform_metrics_providers_simple.cc',
267             'browser/pref_service_helper_simple.cc',
268             'common/platform_client_auth_simple.cc',
269             'renderer/cast_content_renderer_client_simple.cc',
270             'renderer/key_systems_cast_simple.cc',
271           ],
272           'conditions': [
273             ['OS=="android"', {
274               'sources': [
275                 'browser/service/cast_service_android.cc',
276                 'browser/service/cast_service_android.h',
277               ],
278             }, {
279               'sources': [
280                 'browser/service/cast_service_simple.cc',
281                 'browser/service/cast_service_simple.h',
282               ],
283             }],
284           ],
285         }],
286         # ExternalMetrics not necessary on Android and (as of this writing) uses
287         # non-portable filesystem operations. Also webcrypto is not used on
288         # Android either.
289         ['OS=="linux"', {
290           'sources': [
291             'browser/metrics/external_metrics.cc',
292             'browser/metrics/external_metrics.h',
293           ],
294           'dependencies': [
295             '../components/components.gyp:metrics_serialization',
296           ],
297         }],
298       ],
299     },
300     {
301       'target_name': 'cast_version_header',
302       'type': 'none',
303       'direct_dependent_settings': {
304         'include_dirs': [
305           '<(SHARED_INTERMEDIATE_DIR)',
306         ],
307       },
308       'actions': [
309         {
310           'action_name': 'version_header',
311           'message': 'Generating version header file: <@(_outputs)',
312           'inputs': [
313             '<(version_path)',
314             'common/version.h.in',
315           ],
316           'outputs': [
317             '<(SHARED_INTERMEDIATE_DIR)/chromecast/common/version.h',
318           ],
319           'action': [
320             'python',
321             '<(version_py_path)',
322             '-e', 'VERSION_FULL="<(version_full)"',
323             # CAST_BUILD_INCREMENTAL is taken from buildbot if available;
324             # otherwise, a dev string is used.
325             '-e', 'CAST_BUILD_INCREMENTAL="<!(echo ${CAST_BUILD_INCREMENTAL:="<!(date +%Y%m%d.%H%M%S)"})"',
326             # CAST_BUILD_RELEASE is taken from cast_build_release file if exist;
327             # otherwise, a dev string is used.
328             '-e', 'CAST_BUILD_RELEASE="<!(if test -f <(cast_build_release); then cat <(cast_build_release); else echo eng.${USER}; fi)"',
329             '-e', 'CAST_IS_DEBUG_BUILD=1 if "<(CONFIGURATION_NAME)" == "Debug" else 0',
330             'common/version.h.in',
331             '<@(_outputs)',
332           ],
333           'includes': [
334             '../build/util/version.gypi',
335           ],
336         },
337       ],
338     },
339   ],  # end of targets
341   # Targets for Android receiver.
342   'conditions': [
343     ['OS=="android"', {
344       'targets': [
345         {
346           'target_name': 'cast_shell_icudata',
347           'type': 'none',
348           'dependencies': [
349             '../third_party/icu/icu.gyp:icudata',
350           ],
351           'copies': [{
352             'destination': '<(PRODUCT_DIR)/assets',
353             'files': ['<(PRODUCT_DIR)/icudtl.dat'],
354           }],
355         },
356         {
357           'target_name': 'libcast_shell_android',
358           'type': 'shared_library',
359           'dependencies': [
360             'cast_jni_headers',
361             'cast_shell_common',
362             'cast_shell_icudata',
363             'cast_shell_pak',
364             'cast_version_header',
365             '../base/base.gyp:base',
366             '../breakpad/breakpad.gyp:breakpad_client',
367             '../components/components.gyp:breakpad_host',
368             '../components/components.gyp:crash_component',
369             '../content/content.gyp:content',
370             '../skia/skia.gyp:skia',
371             '../ui/gfx/gfx.gyp:gfx',
372             '../ui/gl/gl.gyp:gl',
373           ],
374           'include_dirs': [
375             '../breakpad/src',
376           ],
377           'sources': [
378             'android/cast_jni_registrar.cc',
379             'android/cast_jni_registrar.h',
380             'android/chromecast_config_android.cc',
381             'android/chromecast_config_android.h',
382             'android/platform_jni_loader.h',
383             'app/android/cast_jni_loader.cc',
384             'browser/android/cast_window_android.cc',
385             'browser/android/cast_window_android.h',
386             'browser/android/cast_window_manager.cc',
387             'browser/android/cast_window_manager.h',
388             'browser/android/external_video_surface_container_impl.cc',
389             'browser/android/external_video_surface_container_impl.h',
390             'crash/android/cast_crash_reporter_client_android.cc',
391             'crash/android/cast_crash_reporter_client_android.h',
392             'crash/android/crash_handler.cc',
393             'crash/android/crash_handler.h',
394           ],
395           'conditions': [
396             ['chromecast_branding=="Chrome"', {
397               'dependencies': [
398                 '<(cast_internal_gyp):cast_shell_android_internal'
399               ],
400             }, {
401               'sources': [
402                 'android/chromecast_config_android_stub.cc',
403                 'android/platform_jni_loader_stub.cc',
404               ],
405             }]
406           ],
407         },  # end of target 'libcast_shell_android'
408         {
409           'target_name': 'cast_shell_java',
410           'type': 'none',
411           'dependencies': [
412             '<(android_support_v13_target)',
413             '../base/base.gyp:base_java',
414             '../content/content.gyp:content_java',
415             '../media/media.gyp:media_java',
416             '../net/net.gyp:net_java',
417             '../ui/android/ui_android.gyp:ui_java',
418           ],
419           'variables': {
420             'has_java_resources': 1,
421             'java_in_dir': 'browser/android/apk',
422             'resource_dir': 'browser/android/apk/res',
423             'R_package': 'org.chromium.chromecast.shell',
424           },
425           'includes': ['../build/java.gypi'],
426         },  # end of target 'cast_shell_java'
427         {
428           'target_name': 'cast_shell_manifest',
429           'type': 'none',
430           'variables': {
431             'jinja_inputs': ['browser/android/apk/AndroidManifest.xml.jinja2'],
432             'jinja_output': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
433           },
434           'includes': [ '../build/android/jinja_template.gypi' ],
435         },
436         {
437           'target_name': 'cast_shell_apk',
438           'type': 'none',
439           'dependencies': [
440             'cast_shell_java',
441             'libcast_shell_android',
442           ],
443           'variables': {
444             'apk_name': 'CastShell',
445             'manifest_package_name': 'org.chromium.chromecast.shell',
446             # Note(gunsch): there are no Java files in the android/ directory.
447             # Unfortunately, the java_apk.gypi target rigidly insists on having
448             # a java_in_dir directory, but complains about duplicate classes
449             # from the common cast_shell_java target (shared with internal APK)
450             # if the actual Java path is used.
451             # This will hopefully be removable after the great GN migration.
452             'java_in_dir': 'android',
453             'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
454             'package_name': 'org.chromium.chromecast.shell',
455             'native_lib_target': 'libcast_shell_android',
456             'asset_location': '<(PRODUCT_DIR)/assets',
457             'additional_input_paths': ['<(PRODUCT_DIR)/assets/cast_shell.pak'],
458           },
459           'includes': [ '../build/java_apk.gypi' ],
460         },
461         {
462           'target_name': 'cast_jni_headers',
463           'type': 'none',
464           'sources': [
465             'browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java',
466             'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java',
467             'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowManager.java',
468             'browser/android/apk/src/org/chromium/chromecast/shell/ExternalVideoSurfaceContainer.java',
469           ],
470           'direct_dependent_settings': {
471             'include_dirs': [
472               '<(SHARED_INTERMEDIATE_DIR)/chromecast',
473             ],
474           },
475           'variables': {
476             'jni_gen_package': 'chromecast',
477           },
478           'includes': [ '../build/jni_generator.gypi' ],
479         },
480       ],  # end of targets
481     }, {  # OS != "android"
482       'targets': [
483         {
484           'target_name': 'cast_shell_media',
485           'type': '<(component)',
486           'dependencies': [
487             'media/media.gyp:cast_media',
488             '../content/content.gyp:content',
489             '../ipc/ipc.gyp:ipc',
490             '../media/media.gyp:media',
491           ],
492           'sources': [
493             'browser/media/cast_browser_cdm_factory.cc',
494             'browser/media/cast_browser_cdm_factory.h',
495             'browser/media/cma_message_filter_host.cc',
496             'browser/media/cma_message_filter_host.h',
497             'browser/media/cma_message_loop.cc',
498             'browser/media/cma_message_loop.h',
499             'browser/media/media_pipeline_host.cc',
500             'browser/media/media_pipeline_host.h',
501             'common/media/cma_ipc_common.h',
502             'common/media/cma_messages.h',
503             'common/media/cma_message_generator.cc',
504             'common/media/cma_message_generator.h',
505             'common/media/cma_param_traits.cc',
506             'common/media/cma_param_traits.h',
507             'common/media/shared_memory_chunk.cc',
508             'common/media/shared_memory_chunk.h',
509             'renderer/media/audio_pipeline_proxy.cc',
510             'renderer/media/audio_pipeline_proxy.h',
511             'renderer/media/chromecast_media_renderer_factory.cc',
512             'renderer/media/chromecast_media_renderer_factory.h',
513             'renderer/media/cma_message_filter_proxy.cc',
514             'renderer/media/cma_message_filter_proxy.h',
515             'renderer/media/media_channel_proxy.cc',
516             'renderer/media/media_channel_proxy.h',
517             'renderer/media/media_pipeline_proxy.cc',
518             'renderer/media/media_pipeline_proxy.h',
519             'renderer/media/video_pipeline_proxy.cc',
520             'renderer/media/video_pipeline_proxy.h',
521           ],
522         },  # end of target 'cast_shell_media'
523         # This target contains all of the primary code of |cast_shell|, except
524         # for |main|. This allows end-to-end tests using |cast_shell|.
525         # This also includes all targets that cannot be built on Android.
526         {
527           'target_name': 'cast_shell_core',
528           'type': '<(component)',
529           'dependencies': [
530             'cast_shell_media',
531             'cast_shell_common',
532             'media/media.gyp:cast_media',
533             '../ui/aura/aura.gyp:aura_test_support',
534           ],
535           'conditions': [
536             ['chromecast_branding=="Chrome"', {
537               'dependencies': [
538                 '<(cast_internal_gyp):cast_gfx_internal',
539               ],
540             }, {
541               'dependencies': [
542                 '../ui/ozone/ozone.gyp:eglplatform_shim_x11',
543               ],
544             }],
545           ],
546         },
547         {
548           'target_name': 'cast_shell',
549           'type': 'executable',
550           'dependencies': [
551             'cast_shell_core',
552           ],
553           'sources': [
554             'app/cast_main.cc',
555           ],
556           # TODO(dougsteed): remove when Chromecast moves to boringssl.
557           # Allow the cast shell to find the NSS module in the same directory.
558           'ldflags': [
559             '-Wl,-rpath=\$$ORIGIN'
560           ],
561         },
562       ],  # end of targets
563     }],
564   ],  # end of conditions