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