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