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