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