[NaCl SDK] Fix mysterious gtest failure in Html5FsTest::OpenForCreate
[chromium-blink-merge.git] / chromecast / chromecast.gyp
bloba71479e4629ff96d6f1f9390492fca09deeb9f2a
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:crash_component',
109         '../components/components.gyp:metrics',
110         '../components/components.gyp:metrics_gpu',
111         '../components/components.gyp:metrics_net',
112         '../components/components.gyp:metrics_profiler',
113         '../content/content.gyp:content',
114         '../content/content.gyp:content_app_browser',
115         '../skia/skia.gyp:skia',
116         '../third_party/WebKit/public/blink.gyp:blink',
117         '../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
118       ],
119       'sources': [
120         'app/cast_main_delegate.cc',
121         'app/cast_main_delegate.h',
122         'browser/cast_browser_context.cc',
123         'browser/cast_browser_context.h',
124         'browser/cast_browser_main_parts.cc',
125         'browser/cast_browser_main_parts.h',
126         'browser/cast_browser_process.cc',
127         'browser/cast_browser_process.h',
128         'browser/cast_content_browser_client.cc',
129         'browser/cast_content_browser_client.h',
130         'browser/cast_content_window.cc',
131         'browser/cast_content_window.h',
132         'browser/cast_download_manager_delegate.cc',
133         'browser/cast_download_manager_delegate.h',
134         'browser/cast_http_user_agent_settings.cc',
135         'browser/cast_http_user_agent_settings.h',
136         'browser/cast_network_delegate.cc',
137         'browser/cast_network_delegate.h',
138         'browser/devtools/cast_dev_tools_delegate.cc',
139         'browser/devtools/cast_dev_tools_delegate.h',
140         'browser/devtools/remote_debugging_server.cc',
141         'browser/devtools/remote_debugging_server.h',
142         'browser/geolocation/cast_access_token_store.cc',
143         'browser/geolocation/cast_access_token_store.h',
144         'browser/metrics/cast_metrics_prefs.cc',
145         'browser/metrics/cast_metrics_prefs.h',
146         'browser/metrics/cast_metrics_service_client.cc',
147         'browser/metrics/cast_metrics_service_client.h',
148         'browser/metrics/cast_stability_metrics_provider.cc',
149         'browser/metrics/cast_stability_metrics_provider.h',
150         'browser/metrics/platform_metrics_providers.h',
151         'browser/service/cast_service.cc',
152         'browser/service/cast_service.h',
153         'browser/url_request_context_factory.cc',
154         'browser/url_request_context_factory.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             'common/chromecast_config_simple.cc',
184             'common/platform_client_auth_simple.cc',
185             'renderer/key_systems_cast_simple.cc',
186           ],
187           'conditions': [
188             ['OS=="android"', {
189               'sources': [
190                 'browser/service/cast_service_android.cc',
191                 'browser/service/cast_service_android.h',
192               ],
193             }, {
194               'sources': [
195                 'browser/service/cast_service_simple.cc',
196                 'browser/service/cast_service_simple.h',
197               ],
198             }],
199           ],
200         }],
201         # ExternalMetrics not necessary on Android and (as of this writing) uses
202         # non-portable filesystem operations. Also webcrypto is not used on
203         # Android either.
204         ['OS=="linux"', {
205           'sources': [
206             'browser/metrics/external_metrics.cc',
207             'browser/metrics/external_metrics.h',
208           ],
209           'dependencies': [
210             '../components/components.gyp:metrics_serialization',
211           ],
212         }],
213       ],
214     },
215     {
216       'target_name': 'cast_version_header',
217       'type': 'none',
218       'direct_dependent_settings': {
219         'include_dirs': [
220           '<(SHARED_INTERMEDIATE_DIR)',
221         ],
222       },
223       'actions': [
224         {
225           'action_name': 'version_header',
226           'message': 'Generating version header file: <@(_outputs)',
227           'inputs': [
228             '<(version_path)',
229             'common/version.h.in',
230           ],
231           'outputs': [
232             '<(SHARED_INTERMEDIATE_DIR)/chromecast/common/version.h',
233           ],
234           'action': [
235             'python',
236             '<(version_py_path)',
237             '-e', 'VERSION_FULL="<(version_full)"',
238             # Revision is taken from buildbot if available; otherwise, a dev string is used.
239             '-e', 'CAST_BUILD_REVISION="<!(echo ${BUILD_NUMBER:="local.${USER}"})"',
240             '-e', 'CAST_IS_DEBUG_BUILD=1 if "<(CONFIGURATION_NAME)" == "Debug" else 0',
241             'common/version.h.in',
242             '<@(_outputs)',
243           ],
244           'includes': [
245             '../build/util/version.gypi',
246           ],
247         },
248       ],
249     },
250     {
251       'target_name': 'cast_metrics_test_support',
252       'type': '<(component)',
253       'dependencies': [
254         'cast_base',
255       ],
256       'sources': [
257         'base/metrics/cast_metrics_test_helper.cc',
258         'base/metrics/cast_metrics_test_helper.h',
259       ],
260     },  # end of target 'cast_metrics_test_support'
261     {
262       'target_name': 'cast_tests',
263       'type': 'none',
264       'dependencies': [
265         'media/media.gyp:cast_media_unittests',
266       ],
267     },
268   ],  # end of targets
270   # Targets for Android receiver.
271   'conditions': [
272     ['OS=="android"', {
273       'targets': [
274         {
275           'target_name': 'libcast_shell_android',
276           'type': 'shared_library',
277           'dependencies': [
278             'cast_jni_headers',
279             'cast_shell_common',
280             'cast_shell_pak',
281             'cast_version_header',
282             '../base/base.gyp:base',
283             '../breakpad/breakpad.gyp:breakpad_client',
284             '../components/components.gyp:breakpad_host',
285             '../components/components.gyp:crash_component',
286             '../content/content.gyp:content_app_browser',
287             '../content/content.gyp:content',
288             '../skia/skia.gyp:skia',
289             '../ui/gfx/gfx.gyp:gfx',
290             '../ui/gl/gl.gyp:gl',
291           ],
292           'include_dirs': [
293             '../breakpad/src',
294           ],
295           'sources': [
296             'android/cast_jni_registrar.cc',
297             'android/cast_jni_registrar.h',
298             'android/chromecast_config_android.cc',
299             'android/chromecast_config_android.h',
300             'android/platform_jni_loader.h',
301             'app/android/cast_jni_loader.cc',
302             'browser/android/cast_window_android.cc',
303             'browser/android/cast_window_android.h',
304             'browser/android/cast_window_manager.cc',
305             'browser/android/cast_window_manager.h',
306             'browser/android/external_video_surface_container_impl.cc',
307             'browser/android/external_video_surface_container_impl.h',
308             'crash/android/cast_crash_reporter_client_android.cc',
309             'crash/android/cast_crash_reporter_client_android.h',
310             'crash/android/crash_handler.cc',
311             'crash/android/crash_handler.h',
312           ],
313           'conditions': [
314             ['chromecast_branding=="Chrome"', {
315               'dependencies': [
316                 '<(cast_internal_gyp):cast_shell_android_internal'
317               ],
318             }, {
319               'sources': [
320                 'android/chromecast_config_android_stub.cc',
321                 'android/platform_jni_loader_stub.cc',
322               ],
323             }]
324           ],
325         },  # end of target 'libcast_shell_android'
326         {
327           'target_name': 'cast_shell_java',
328           'type': 'none',
329           'dependencies': [
330             '<(android_support_v13_target)',
331             '../base/base.gyp:base_java',
332             '../content/content.gyp:content_java',
333             '../media/media.gyp:media_java',
334             '../net/net.gyp:net_java',
335             '../ui/android/ui_android.gyp:ui_java',
336           ],
337           'variables': {
338             'has_java_resources': 1,
339             'java_in_dir': 'browser/android/apk',
340             'resource_dir': 'browser/android/apk/res',
341             'R_package': 'org.chromium.chromecast.shell',
342           },
343           'includes': ['../build/java.gypi'],
344         },  # end of target 'cast_shell_java'
345         {
346           'target_name': 'cast_shell_apk',
347           'type': 'none',
348           'dependencies': [
349             'cast_shell_java',
350             'libcast_shell_android',
351           ],
352           'variables': {
353             'apk_name': 'CastShell',
354             'manifest_package_name': 'org.chromium.chromecast.shell',
355             # Note(gunsch): there are no Java files in the android/ directory.
356             # Unfortunately, the java_apk.gypi target rigidly insists on having
357             # a java_in_dir directory, but complains about duplicate classes
358             # from the common cast_shell_java target (shared with internal APK)
359             # if the actual Java path is used.
360             # This will hopefully be removable after the great GN migration.
361             'java_in_dir': 'android',
362             'android_manifest_path': 'browser/android/apk/AndroidManifest.xml',
363             'package_name': 'org.chromium.chromecast.shell',
364             'native_lib_target': 'libcast_shell_android',
365             'asset_location': '<(PRODUCT_DIR)/assets',
366             'additional_input_paths': ['<(PRODUCT_DIR)/assets/cast_shell.pak'],
367           },
368           'includes': [ '../build/java_apk.gypi' ],
369         },
370         {
371           'target_name': 'cast_jni_headers',
372           'type': 'none',
373           'sources': [
374             'browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java',
375             'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java',
376             'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowManager.java',
377             'browser/android/apk/src/org/chromium/chromecast/shell/ExternalVideoSurfaceContainer.java',
378           ],
379           'direct_dependent_settings': {
380             'include_dirs': [
381               '<(SHARED_INTERMEDIATE_DIR)/chromecast',
382             ],
383           },
384           'variables': {
385             'jni_gen_package': 'chromecast',
386           },
387           'includes': [ '../build/jni_generator.gypi' ],
388         },
389       ],  # end of targets
390     }, {  # OS != "android"
391       'targets': [
392         {
393           'target_name': 'cast_crash_client',
394           'type': '<(component)',
395           'dependencies': [
396             '../breakpad/breakpad.gyp:breakpad_client',
397             '../components/components.gyp:crash_component',
398           ],
399           'sources': [
400             'crash/cast_crash_reporter_client.cc',
401             'crash/cast_crash_reporter_client.h',
402           ],
403           'conditions': [
404             ['chromecast_branding=="Chrome"', {
405               'dependencies': [
406                 '<(cast_internal_gyp):crash_internal',
407               ],
408             }, {
409               'sources': [
410                 'crash/cast_crash_reporter_client_simple.cc',
411               ],
412             }],
413           ]
414         },  # end of target 'cast_crash_client'
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_crash_client',
423             'cast_net',
424             'cast_shell_common',
425             'media/media.gyp:cast_media',
426             '../ui/aura/aura.gyp:aura_test_support',
427           ],
428           'conditions': [
429             ['chromecast_branding=="Chrome"', {
430               'dependencies': [
431                 '<(cast_internal_gyp):cast_gfx_internal',
432               ],
433             }, {
434               'dependencies': [
435                 '../ui/ozone/ozone.gyp:eglplatform_shim_x11',
436               ],
437             }],
438           ],
439         },
440         {
441           'target_name': 'cast_shell',
442           'type': 'executable',
443           'dependencies': [
444             'cast_shell_core',
445           ],
446           'sources': [
447             'app/cast_main.cc',
448           ],
449         },
450         {
451           'target_name': 'cast_shell_browser_test',
452           'type': '<(gtest_target_type)',
453           'dependencies': [
454             'cast_shell_test_support',
455             '../testing/gtest.gyp:gtest',
456           ],
457           'defines': [
458             'HAS_OUT_OF_PROC_TEST_RUNNER',
459           ],
460           'sources': [
461             'browser/test/chromecast_shell_browser_test.cc',
462           ],
463         },
464         {
465           'target_name': 'cast_shell_test_support',
466           'type': '<(component)',
467           'defines': [
468             'HAS_OUT_OF_PROC_TEST_RUNNER',
469           ],
470           'dependencies': [
471             'cast_shell_core',
472             '../content/content_shell_and_tests.gyp:content_browser_test_support',
473             '../testing/gtest.gyp:gtest',
474           ],
475           'sources': [
476             'browser/test/chromecast_browser_test.cc',
477             'browser/test/chromecast_browser_test.h',
478             'browser/test/chromecast_browser_test_runner.cc',
479           ],
480         },
481       ],  # end of targets
482     }],
483   ],  # end of conditions