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