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