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