Supervised user SafeSites: Ignore trailing slash in URL path
[chromium-blink-merge.git] / chromecast / chromecast.gyp
blob7bf86298741aaadf94fdf8762ea0dd145517ff41
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/key_systems_cast.cc',
178         'renderer/key_systems_cast.h',
179       ],
180       'conditions': [
181         ['chromecast_branding=="Chrome"', {
182           'dependencies': [
183             '<(cast_internal_gyp):cast_shell_internal',
184           ],
185         }, {
186           'sources': [
187             'browser/cast_network_delegate_simple.cc',
188             'browser/devtools/remote_debugging_server_simple.cc',
189             'browser/metrics/platform_metrics_providers_simple.cc',
190             'browser/pref_service_helper_simple.cc',
191             'common/platform_client_auth_simple.cc',
192             'renderer/key_systems_cast_simple.cc',
193           ],
194           'conditions': [
195             ['OS=="android"', {
196               'sources': [
197                 'browser/service/cast_service_android.cc',
198                 'browser/service/cast_service_android.h',
199               ],
200             }, {
201               'sources': [
202                 'browser/service/cast_service_simple.cc',
203                 'browser/service/cast_service_simple.h',
204               ],
205             }],
206           ],
207         }],
208         # ExternalMetrics not necessary on Android and (as of this writing) uses
209         # non-portable filesystem operations. Also webcrypto is not used on
210         # Android either.
211         ['OS=="linux"', {
212           'sources': [
213             'browser/metrics/external_metrics.cc',
214             'browser/metrics/external_metrics.h',
215           ],
216           'dependencies': [
217             '../components/components.gyp:metrics_serialization',
218           ],
219         }],
220       ],
221     },
222     {
223       'target_name': 'cast_version_header',
224       'type': 'none',
225       'direct_dependent_settings': {
226         'include_dirs': [
227           '<(SHARED_INTERMEDIATE_DIR)',
228         ],
229       },
230       'actions': [
231         {
232           'action_name': 'version_header',
233           'message': 'Generating version header file: <@(_outputs)',
234           'inputs': [
235             '<(version_path)',
236             'common/version.h.in',
237           ],
238           'outputs': [
239             '<(SHARED_INTERMEDIATE_DIR)/chromecast/common/version.h',
240           ],
241           'action': [
242             'python',
243             '<(version_py_path)',
244             '-e', 'VERSION_FULL="<(version_full)"',
245             # Revision is taken from buildbot if available; otherwise, a dev string is used.
246             '-e', 'CAST_BUILD_REVISION="<!(echo ${CAST_BUILD_REVISION:="eng.${USER}.<!(date +%Y%m%d.%H%M%S)"})"',
247             '-e', 'CAST_IS_DEBUG_BUILD=1 if "<(CONFIGURATION_NAME)" == "Debug" else 0',
248             'common/version.h.in',
249             '<@(_outputs)',
250           ],
251           'includes': [
252             '../build/util/version.gypi',
253           ],
254         },
255       ],
256     },
257   ],  # end of targets
259   # Targets for Android receiver.
260   'conditions': [
261     ['OS=="android"', {
262       'targets': [
263         {
264           'target_name': 'libcast_shell_android',
265           'type': 'shared_library',
266           'dependencies': [
267             'cast_jni_headers',
268             'cast_shell_common',
269             'cast_shell_pak',
270             'cast_version_header',
271             '../base/base.gyp:base',
272             '../breakpad/breakpad.gyp:breakpad_client',
273             '../components/components.gyp:breakpad_host',
274             '../components/components.gyp:crash_component',
275             '../content/content.gyp:content_app_browser',
276             '../content/content.gyp:content',
277             '../skia/skia.gyp:skia',
278             '../ui/gfx/gfx.gyp:gfx',
279             '../ui/gl/gl.gyp:gl',
280           ],
281           'include_dirs': [
282             '../breakpad/src',
283           ],
284           'sources': [
285             'android/cast_jni_registrar.cc',
286             'android/cast_jni_registrar.h',
287             'android/chromecast_config_android.cc',
288             'android/chromecast_config_android.h',
289             'android/platform_jni_loader.h',
290             'app/android/cast_jni_loader.cc',
291             'browser/android/cast_window_android.cc',
292             'browser/android/cast_window_android.h',
293             'browser/android/cast_window_manager.cc',
294             'browser/android/cast_window_manager.h',
295             'browser/android/external_video_surface_container_impl.cc',
296             'browser/android/external_video_surface_container_impl.h',
297             'crash/android/cast_crash_reporter_client_android.cc',
298             'crash/android/cast_crash_reporter_client_android.h',
299             'crash/android/crash_handler.cc',
300             'crash/android/crash_handler.h',
301           ],
302           'conditions': [
303             ['chromecast_branding=="Chrome"', {
304               'dependencies': [
305                 '<(cast_internal_gyp):cast_shell_android_internal'
306               ],
307             }, {
308               'sources': [
309                 'android/chromecast_config_android_stub.cc',
310                 'android/platform_jni_loader_stub.cc',
311               ],
312             }]
313           ],
314         },  # end of target 'libcast_shell_android'
315         {
316           'target_name': 'cast_shell_java',
317           'type': 'none',
318           'dependencies': [
319             '<(android_support_v13_target)',
320             '../base/base.gyp:base_java',
321             '../content/content.gyp:content_java',
322             '../media/media.gyp:media_java',
323             '../net/net.gyp:net_java',
324             '../ui/android/ui_android.gyp:ui_java',
325           ],
326           'variables': {
327             'has_java_resources': 1,
328             'java_in_dir': 'browser/android/apk',
329             'resource_dir': 'browser/android/apk/res',
330             'R_package': 'org.chromium.chromecast.shell',
331           },
332           'includes': ['../build/java.gypi'],
333         },  # end of target 'cast_shell_java'
334         {
335           'target_name': 'cast_shell_manifest',
336           'type': 'none',
337           'variables': {
338             'jinja_inputs': ['browser/android/apk/AndroidManifest.xml.jinja2'],
339             'jinja_output': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
340           },
341           'includes': [ '../build/android/jinja_template.gypi' ],
342         },
343         {
344           'target_name': 'cast_shell_apk',
345           'type': 'none',
346           'dependencies': [
347             'cast_shell_java',
348             'libcast_shell_android',
349           ],
350           'variables': {
351             'apk_name': 'CastShell',
352             'manifest_package_name': 'org.chromium.chromecast.shell',
353             # Note(gunsch): there are no Java files in the android/ directory.
354             # Unfortunately, the java_apk.gypi target rigidly insists on having
355             # a java_in_dir directory, but complains about duplicate classes
356             # from the common cast_shell_java target (shared with internal APK)
357             # if the actual Java path is used.
358             # This will hopefully be removable after the great GN migration.
359             'java_in_dir': 'android',
360             'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
361             'package_name': 'org.chromium.chromecast.shell',
362             'native_lib_target': 'libcast_shell_android',
363             'asset_location': '<(PRODUCT_DIR)/assets',
364             'additional_input_paths': ['<(PRODUCT_DIR)/assets/cast_shell.pak'],
365           },
366           'includes': [ '../build/java_apk.gypi' ],
367         },
368         {
369           'target_name': 'cast_jni_headers',
370           'type': 'none',
371           'sources': [
372             'browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java',
373             'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java',
374             'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowManager.java',
375             'browser/android/apk/src/org/chromium/chromecast/shell/ExternalVideoSurfaceContainer.java',
376           ],
377           'direct_dependent_settings': {
378             'include_dirs': [
379               '<(SHARED_INTERMEDIATE_DIR)/chromecast',
380             ],
381           },
382           'variables': {
383             'jni_gen_package': 'chromecast',
384           },
385           'includes': [ '../build/jni_generator.gypi' ],
386         },
387       ],  # end of targets
388     }, {  # OS != "android"
389       'targets': [
390         {
391           'target_name': 'cast_crash_client',
392           'type': '<(component)',
393           'dependencies': [
394             '../breakpad/breakpad.gyp:breakpad_client',
395             '../components/components.gyp:crash_component',
396           ],
397           'sources': [
398             'crash/cast_crash_reporter_client.cc',
399             'crash/cast_crash_reporter_client.h',
400           ],
401           'conditions': [
402             ['chromecast_branding=="Chrome"', {
403               'dependencies': [
404                 '<(cast_internal_gyp):crash_internal',
405               ],
406             }, {
407               'sources': [
408                 'crash/cast_crash_reporter_client_simple.cc',
409               ],
410             }],
411           ]
412         },  # end of target 'cast_crash_client'
413         # This target contains all of the primary code of |cast_shell|, except
414         # for |main|. This allows end-to-end tests using |cast_shell|.
415         # This also includes all targets that cannot be built on Android.
416         {
417           'target_name': 'cast_shell_core',
418           'type': '<(component)',
419           'dependencies': [
420             'cast_crash_client',
421             'cast_net',
422             'cast_shell_common',
423             'media/media.gyp:cast_media',
424             '../ui/aura/aura.gyp:aura_test_support',
425           ],
426           'conditions': [
427             ['chromecast_branding=="Chrome"', {
428               'dependencies': [
429                 '<(cast_internal_gyp):cast_gfx_internal',
430               ],
431             }, {
432               'dependencies': [
433                 '../ui/ozone/ozone.gyp:eglplatform_shim_x11',
434               ],
435             }],
436           ],
437         },
438         {
439           'target_name': 'cast_shell',
440           'type': 'executable',
441           'dependencies': [
442             'cast_shell_core',
443           ],
444           'sources': [
445             'app/cast_main.cc',
446           ],
447         },
448       ],  # end of targets
449     }],
450   ],  # end of conditions