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