Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / extensions / shell / app_shell.gyp
blob9c6ead50705836643ad84228b58ecdb6102df1b4
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   'includes': [
7     'app_shell.gypi',
8   ],
9   'variables': {
10     # Product name is used for Mac bundle.
11     'app_shell_product_name': 'App Shell',
12     # The version is high enough to be supported by Omaha (at least 31)
13     # but fake enough to be obviously not a Chrome release.
14     'app_shell_version': '38.1234.5678.9',
15     'chromium_code': 1,
16   },
17   'targets': [
18     {
19       'target_name': 'app_shell_lib',
20       'type': 'static_library',
21       'dependencies': [
22         'app_shell_version_header',
23         '<(DEPTH)/base/base.gyp:base',
24         '<(DEPTH)/base/base.gyp:base_prefs',
25         '<(DEPTH)/components/components.gyp:devtools_discovery',
26         '<(DEPTH)/components/components.gyp:devtools_http_handler',
27         '<(DEPTH)/components/components.gyp:pref_registry',
28         '<(DEPTH)/components/components.gyp:update_client',
29         '<(DEPTH)/components/components.gyp:user_prefs',
30         '<(DEPTH)/components/components.gyp:web_cache_renderer',
31         '<(DEPTH)/content/content.gyp:content',
32         '<(DEPTH)/content/content.gyp:content_browser',
33         '<(DEPTH)/content/content.gyp:content_gpu',
34         '<(DEPTH)/content/content.gyp:content_ppapi_plugin',
35         '<(DEPTH)/content/content_shell_and_tests.gyp:content_shell_lib',
36         '<(DEPTH)/device/core/core.gyp:device_core',
37         '<(DEPTH)/device/hid/hid.gyp:device_hid',
38         '<(DEPTH)/extensions/browser/api/api_registration.gyp:extensions_api_registration',
39         '<(DEPTH)/extensions/common/api/api.gyp:extensions_api',
40         '<(DEPTH)/extensions/extensions.gyp:extensions_browser',
41         '<(DEPTH)/extensions/extensions.gyp:extensions_common',
42         '<(DEPTH)/extensions/extensions.gyp:extensions_renderer',
43         '<(DEPTH)/extensions/extensions.gyp:extensions_shell_and_test_pak',
44         '<(DEPTH)/extensions/extensions.gyp:extensions_utility',
45         '<(DEPTH)/extensions/extensions_resources.gyp:extensions_resources',
46         '<(DEPTH)/extensions/shell/browser/api/api_registration.gyp:shell_api_registration',
47         '<(DEPTH)/extensions/shell/common/api/api.gyp:shell_api',
48         '<(DEPTH)/mojo/mojo_base.gyp:mojo_environment_chromium',
49         '<(DEPTH)/skia/skia.gyp:skia',
50         '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
51         '<(DEPTH)/third_party/mojo/mojo_edk.gyp:mojo_system_impl',
52         '<(DEPTH)/ui/base/ime/ui_base_ime.gyp:ui_base_ime',
53         '<(DEPTH)/ui/base/ui_base.gyp:ui_base',
54         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
55       ],
56       'export_dependent_settings': [
57         '<(DEPTH)/content/content.gyp:content_browser',
58       ],
59       'include_dirs': [
60         '../..',
61         '<(SHARED_INTERMEDIATE_DIR)',
62         '<(SHARED_INTERMEDIATE_DIR)/extensions/shell',
63       ],
64       'sources': [
65         '<@(app_shell_lib_sources)',
66       ],
67       'conditions': [
68         [ 'cld_version==2', {
69               'dependencies': [
70                 '<(DEPTH)/third_party/cld_2/cld_2.gyp:cld2_platform_impl', ],
71         }],
72         ['use_aura==1', {
73           'dependencies': [
74             '<(DEPTH)/ui/wm/wm.gyp:wm',
75           ],
76           'sources': [
77             '<@(app_shell_lib_sources_aura)',
78           ],
79         }],
80         ['chromeos==1', {
81           'dependencies': [
82             '<(DEPTH)/chromeos/chromeos.gyp:chromeos',
83             '<(DEPTH)/ui/chromeos/ui_chromeos.gyp:ui_chromeos',
84             '<(DEPTH)/ui/display/display.gyp:display',
85           ],
86           'sources': [
87             '<@(app_shell_lib_sources_chromeos)',
88           ],
89         }],
90         ['disable_nacl==0 and OS=="linux"', {
91           'dependencies': [
92             '<(DEPTH)/components/nacl.gyp:nacl_helper',
93           ],
94         }],
95         ['disable_nacl==0', {
96           'dependencies': [
97             '<(DEPTH)/components/nacl.gyp:nacl',
98             '<(DEPTH)/components/nacl.gyp:nacl_browser',
99             '<(DEPTH)/components/nacl.gyp:nacl_common',
100             '<(DEPTH)/components/nacl.gyp:nacl_renderer',
101             '<(DEPTH)/components/nacl.gyp:nacl_switches',
102           ],
103           'sources': [
104             '<@(app_shell_lib_sources_nacl)',
105           ],
106         }],
107       ],
108     },
109     {
110       'target_name': 'app_shell',
111       'type': 'executable',
112       'mac_bundle': 1,
113       'dependencies': [
114         'app_shell_lib',
115         '<(DEPTH)/extensions/extensions.gyp:extensions_shell_and_test_pak',
116       ],
117       'include_dirs': [
118         '../..',
119       ],
120       'sources': [
121         '<@(app_shell_sources)',
122       ],
123       'conditions': [
124         ['OS=="win"', {
125           'msvs_settings': {
126             'VCLinkerTool': {
127               'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
128             },
129           },
130           'dependencies': [
131             '<(DEPTH)/sandbox/sandbox.gyp:sandbox',
132           ],
133         }],
134         ['OS=="win" and win_use_allocator_shim==1', {
135           'dependencies': [
136             '<(DEPTH)/base/allocator/allocator.gyp:allocator',
137           ],
138         }],
139         ['OS=="mac"', {
140           'product_name': '<(app_shell_product_name)',
141           'dependencies!': [
142             'app_shell_lib',
143           ],
144           'dependencies': [
145             'app_shell_framework',
146             'app_shell_helper',
147           ],
148           'mac_bundle_resources': [
149             'app/app-Info.plist',
150           ],
151           # TODO(mark): Come up with a fancier way to do this.  It should only
152           # be necessary to list app-Info.plist once, not the three times it is
153           # listed here.
154           'mac_bundle_resources!': [
155             'app/app-Info.plist',
156           ],
157           'xcode_settings': {
158             'INFOPLIST_FILE': 'app/app-Info.plist',
159           },
160           'copies': [{
161               'destination': '<(PRODUCT_DIR)/<(app_shell_product_name).app/Contents/Frameworks',
162               'files': [
163                 '<(PRODUCT_DIR)/<(app_shell_product_name) Helper.app',
164               ],
165           }],
166           'postbuilds': [
167             {
168               'postbuild_name': 'Copy <(app_shell_product_name) Framework.framework',
169               'action': [
170                 '../../build/mac/copy_framework_unversioned.sh',
171                 '${BUILT_PRODUCTS_DIR}/<(app_shell_product_name) Framework.framework',
172                 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Frameworks',
173               ],
174             },
175             {
176               # Modify the Info.plist as needed.
177               'postbuild_name': 'Tweak Info.plist',
178               'action': ['../../build/mac/tweak_info_plist.py',
179                          '--scm=1',
180                          '--version=<(app_shell_version)'],
181             },
182             {
183               # This postbuild step is responsible for creating the following
184               # helpers:
185               #
186               # App Shell Helper EH.app and App Shell Helper NP.app are
187               # created from App Shell Helper.app.
188               #
189               # The EH helper is marked for an executable heap. The NP helper
190               # is marked for no PIE (ASLR).
191               'postbuild_name': 'Make More Helpers',
192               'action': [
193                 '../../build/mac/make_more_helpers.sh',
194                 'Frameworks',
195                 '<(app_shell_product_name)',
196               ],
197             },
198             {
199               # Make sure there isn't any Objective-C in the shell's
200               # executable.
201               'postbuild_name': 'Verify No Objective-C',
202               'action': [
203                 '../../build/mac/verify_no_objc.sh',
204               ],
205             },
206           ],
207         }],
208       ],
209     },
210     {
211       'target_name': 'app_shell_unittests',
212       'type': 'executable',
213       'dependencies': [
214         'app_shell_lib',
215         '<(DEPTH)/base/base.gyp:base',
216         '<(DEPTH)/base/base.gyp:test_support_base',
217         '<(DEPTH)/content/content.gyp:content_app_both',
218         '<(DEPTH)/content/content_shell_and_tests.gyp:test_support_content',
219         '<(DEPTH)/extensions/extensions.gyp:extensions_shell_and_test_pak',
220         '<(DEPTH)/extensions/extensions.gyp:extensions_test_support',
221         '<(DEPTH)/testing/gtest.gyp:gtest',
222       ],
223       'sources': [
224         '<@(app_shell_unittests_sources)',
225       ],
226       'conditions': [
227         ['disable_nacl==0', {
228           'sources': [
229             '<@(app_shell_unittests_sources_nacl)',
230           ],
231         }],
232         ['use_aura==1', {
233           'sources': [
234             '<@(app_shell_unittests_sources_aura)',
235           ],
236           'dependencies': [
237             '<(DEPTH)/ui/aura/aura.gyp:aura_test_support',
238           ],
239         }],
240         ['chromeos==1', {
241           'dependencies': [
242             '<(DEPTH)/chromeos/chromeos.gyp:chromeos_test_support_without_gmock',
243           ],
244           'sources': [
245             '<@(app_shell_unittests_sources_chromeos)',
246           ],
247         }],
248         ['OS=="win" and win_use_allocator_shim==1', {
249           'dependencies': [
250             '<(DEPTH)/base/allocator/allocator.gyp:allocator',
251           ],
252         }],
253       ],
254     },
255     {
256       'target_name': 'app_shell_version_header',
257       'type': 'none',
258       'direct_dependent_settings': {
259         'include_dirs': [
260           '<(SHARED_INTERMEDIATE_DIR)',
261         ],
262       },
263       'actions': [
264         {
265           'action_name': 'version_header',
266           'message': 'Generating version header file: <@(_outputs)',
267           'variables': {
268             'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
269           },
270           'inputs': [
271             '<(version_path)',
272             '<(lastchange_path)',
273             'common/version.h.in',
274           ],
275           'outputs': [
276             '<(SHARED_INTERMEDIATE_DIR)/extensions/shell/common/version.h',
277           ],
278           'action': [
279             'python',
280             '<(version_py_path)',
281             '-f', '<(lastchange_path)',
282             '-f', '<(version_path)',
283             'common/version.h.in',
284             '<@(_outputs)',
285           ],
286           'includes': [
287             '../../build/util/version.gypi',
288           ],
289         },
290       ],
291     },
292   ],  # targets
294   'conditions': [
295     ['OS=="mac"', {
296       'targets': [
297         {
298           'target_name': 'app_shell_framework',
299           'type': 'shared_library',
300           'product_name': '<(app_shell_product_name) Framework',
301           'mac_bundle': 1,
302           'mac_bundle_resources': [
303             '<(PRODUCT_DIR)/extensions_shell_and_test.pak',
304             'app/framework-Info.plist',
305           ],
306           'mac_bundle_resources!': [
307             'app/framework-Info.plist',
308           ],
309           'xcode_settings': {
310             # The framework is placed within the .app's Framework
311             # directory.  DYLIB_INSTALL_NAME_BASE and
312             # LD_DYLIB_INSTALL_NAME affect -install_name.
313             'DYLIB_INSTALL_NAME_BASE':
314                 '@executable_path/../Frameworks',
315             # See /build/mac/copy_framework_unversioned.sh for
316             # information on LD_DYLIB_INSTALL_NAME.
317             'LD_DYLIB_INSTALL_NAME':
318                 '$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(WRAPPER_NAME)/$(PRODUCT_NAME)',
320             'INFOPLIST_FILE': 'app/framework-Info.plist',
321           },
322           'dependencies': [
323             'app_shell_lib',
324           ],
325           'include_dirs': [
326             '../..',
327           ],
328           'sources': [
329             '<@(app_shell_sources_mac)',
330           ],
331           'postbuilds': [
332             {
333               # Modify the Info.plist as needed.  The script explains why
334               # this is needed.  This is also done in the chrome target.
335               # The framework needs the Breakpad keys if this feature is
336               # enabled.  It does not need the Keystone keys; these always
337               # come from the outer application bundle.  The framework
338               # doesn't currently use the SCM keys for anything,
339               # but this seems like a really good place to store them.
340               'postbuild_name': 'Tweak Info.plist',
341               'action': ['../../build/mac/tweak_info_plist.py',
342                          '--breakpad=1',
343                          '--keystone=0',
344                          '--scm=1',
345                          '--version=<(app_shell_version)',
346                          '--branding=<(app_shell_product_name)'],
347             },
348           ],
349           'conditions': [
350             ['icu_use_data_file_flag==1', {
351               'mac_bundle_resources': [
352                 '<(PRODUCT_DIR)/icudtl.dat',
353               ],
354             }],
355             ['v8_use_external_startup_data==1', {
356               'mac_bundle_resources': [
357                 '<(PRODUCT_DIR)/natives_blob.bin',
358                 '<(PRODUCT_DIR)/snapshot_blob.bin',
359               ],
360             }],
361           ],
362         },  # target app_shell_framework
363         {
364           'target_name': 'app_shell_helper',
365           'type': 'executable',
366           'variables': { 'enable_wexit_time_destructors': 1, },
367           'product_name': '<(app_shell_product_name) Helper',
368           'mac_bundle': 1,
369           'dependencies': [
370             'app_shell_framework',
371           ],
372           'sources': [
373             'app/shell_main.cc',
374             'app/helper-Info.plist',
375           ],
376           # TODO(mark): Come up with a fancier way to do this.  It should only
377           # be necessary to list helper-Info.plist once, not the three times it
378           # is listed here.
379           'mac_bundle_resources!': [
380             'app/helper-Info.plist',
381           ],
382           # TODO(mark): For now, don't put any resources into this app.  Its
383           # resources directory will be a symbolic link to the browser app's
384           # resources directory.
385           'mac_bundle_resources/': [
386             ['exclude', '.*'],
387           ],
388           'xcode_settings': {
389             'INFOPLIST_FILE': 'app/helper-Info.plist',
390           },
391           'postbuilds': [
392             {
393               # The framework defines its load-time path
394               # (DYLIB_INSTALL_NAME_BASE) relative to the main executable
395               # (chrome).  A different relative path needs to be used in
396               # helper_app.
397               'postbuild_name': 'Fix Framework Link',
398               'action': [
399                 'install_name_tool',
400                 '-change',
401                 '@executable_path/../Frameworks/<(app_shell_product_name) Framework.framework/<(app_shell_product_name) Framework',
402                 '@executable_path/../../../<(app_shell_product_name) Framework.framework/<(app_shell_product_name) Framework',
403                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
404               ],
405             },
406             {
407               # Modify the Info.plist as needed.  The script explains why this
408               # is needed.  This is also done in the chrome and chrome_dll
409               # targets.  In this case, --breakpad=0, --keystone=0, and --scm=0
410               # are used because Breakpad, Keystone, and SCM keys are
411               # never placed into the helper.
412               'postbuild_name': 'Tweak Info.plist',
413               'action': ['../../build/mac/tweak_info_plist.py',
414                          '--breakpad=0',
415                          '--keystone=0',
416                          '--scm=0',
417                          '--version=<(app_shell_version)'],
418             },
419             {
420               # Make sure there isn't any Objective-C in the helper app's
421               # executable.
422               'postbuild_name': 'Verify No Objective-C',
423               'action': [
424                 '../../build/mac/verify_no_objc.sh',
425               ],
426             },
427           ],
428         },  # target app_shell_helper
429       ],
430     }],  # OS=="mac"
431     ['test_isolation_mode != "noop"', {
432       'targets': [
433         {
434           'target_name': 'app_shell_unittests_run',
435           'type': 'none',
436           'dependencies': [
437             'app_shell_unittests',
438           ],
439           'includes': [
440             '../../build/isolate.gypi',
441           ],
442           'sources': [
443             'app_shell_unittests.isolate',
444           ],
445         },
446       ],
447     }],
448   ],