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