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