Return backed up TemplateURL on default search change
[chromium-blink-merge.git] / chrome / chrome_resources.gyp
blob59b614345b2d75445a8bd74185ffe37c5c6146df
1 # Copyright (c) 2011 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.
5   'variables': {
6     'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
7     'repack_locales_cmd': ['python', 'tools/build/repack_locales.py'],
8   },
9   'targets': [
10     {
11       'target_name': 'chrome_extra_resources',
12       'type': 'none',
13       'dependencies': [
14         '../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:generate_devtools_grd',
15       ],
16       # These resources end up in resources.pak because they are resources
17       # used by internal pages.  Putting them in a spearate pak file makes
18       # it easier for us to reference them internally.
19       'actions': [
20         {
21           'action_name': 'component_extension_resources',
22           'variables': {
23             'grit_grd_file': 'browser/resources/component_extension_resources.grd',
24           },
25           'includes': [ '../build/grit_action.gypi' ],
26         },
27         {
28           'action_name': 'net_internals_resources',
29           'variables': {
30             'grit_grd_file': 'browser/resources/net_internals_resources.grd',
31           },
32           'includes': [ '../build/grit_action.gypi' ],
33         },
34         {
35           'action_name': 'options_resources',
36           'variables': {
37             'grit_grd_file': 'browser/resources/options_resources.grd',
38           },
39           'includes': [ '../build/grit_action.gypi' ],
40         },
41         {
42           'action_name': 'options2_resources',
43           'variables': {
44             'grit_grd_file': 'browser/resources/options2_resources.grd',
45           },
46           'includes': [ '../build/grit_action.gypi' ],
47         },
48         {
49           'action_name': 'quota_internals_resources',
50           'variables': {
51             'grit_grd_file': 'browser/resources/quota_internals_resources.grd',
52           },
53           'includes': [ '../build/grit_action.gypi' ],
54         },
55         {
56           'action_name': 'shared_resources',
57           'variables': {
58             'grit_grd_file': 'browser/resources/shared_resources.grd',
59           },
60           'includes': [ '../build/grit_action.gypi' ],
61         },
62         {
63           'action_name': 'sync_internals_resources',
64           'variables': {
65             'grit_grd_file': 'browser/resources/sync_internals_resources.grd',
66           },
67           'includes': [ '../build/grit_action.gypi' ],
68         },
69         {
70           'action_name': 'workers_resources',
71           'variables': {
72             'grit_grd_file': 'browser/resources/workers_resources.grd',
73           },
74           'includes': [ '../build/grit_action.gypi' ],
75         },
76         {
77           'action_name': 'devtools_frontend_resources',
78           'variables': {
79             'grit_grd_file':
80                'browser/debugger/frontend/devtools_frontend_resources.grd',
81           },
82           'includes': [ '../build/grit_action.gypi' ]
83         },
84         {
85           'action_name': 'devtools_resources',
86           # This can't use ../build/grit_action.gypi because the grd file
87           # is generated a build time, so the trick of using grit_info to get
88           # the real inputs/outputs at GYP time isn't possible.
89           'variables': {
90             'grit_cmd': ['python', '../tools/grit/grit.py'],
91             'grit_grd_file': '<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd',
92           },
93           'inputs': [
94             '<(grit_grd_file)',
95             '<!@pymod_do_main(grit_info --inputs)',
96           ],
97           'outputs': [
98             '<(grit_out_dir)/grit/devtools_resources.h',
99             '<(grit_out_dir)/devtools_resources.pak',
100             '<(grit_out_dir)/grit/devtools_resources_map.cc',
101             '<(grit_out_dir)/grit/devtools_resources_map.h',
102           ],
103           'action': ['<@(grit_cmd)',
104                      '-i', '<(grit_grd_file)', 'build',
105                      '-o', '<(grit_out_dir)',
106                      '-D', 'SHARED_INTERMEDIATE_DIR=<(SHARED_INTERMEDIATE_DIR)',
107                      '<@(grit_defines)' ],
108           'message': 'Generating resources from <(grit_grd_file)',
109         },
110       ],
111       'includes': [ '../build/grit_target.gypi' ],
112     },
113     {
114       # TODO(mark): It would be better if each static library that needed
115       # to run grit would list its own .grd files, but unfortunately some
116       # of the static libraries currently have circular dependencies among
117       # generated headers.
118       'target_name': 'chrome_resources',
119       'type': 'none',
120       'actions': [
121         # Data resources.
122         {
123           'action_name': 'browser_resources',
124           'variables': {
125             'grit_grd_file': 'browser/browser_resources.grd',
126           },
127           'includes': [ '../build/grit_action.gypi' ],
128         },
129         {
130           'action_name': 'common_resources',
131           'variables': {
132             'grit_grd_file': 'common/common_resources.grd',
133           },
134           'includes': [ '../build/grit_action.gypi' ],
135         },
136         {
137           'action_name': 'renderer_resources',
138           'variables': {
139             'grit_grd_file': 'renderer/renderer_resources.grd',
140           },
141           'includes': [ '../build/grit_action.gypi' ],
142         },
143       ],
144       'includes': [ '../build/grit_target.gypi' ],
145     },
146     {
147       # TODO(mark): It would be better if each static library that needed
148       # to run grit would list its own .grd files, but unfortunately some
149       # of the static libraries currently have circular dependencies among
150       # generated headers.
151       'target_name': 'chrome_strings',
152       'type': 'none',
153       'conditions': [
154         ['OS=="win"', {
155           # HACK(nsylvain): We want to enforce a fake dependency on
156           # intaller_util_string.  install_util depends on both
157           # chrome_strings and installer_util_strings, but for some reasons
158           # Incredibuild does not enforce it (most likely a bug). By changing
159           # the type and making sure we depend on installer_util_strings, it
160           # will always get built before installer_util.
161           'type': 'dummy_executable',
162           'dependencies': ['chrome.gyp:installer_util_strings'],
163         }],
164       ],
165       'actions': [
166         # Localizable resources.
167         {
168           'action_name': 'locale_settings',
169           'variables': {
170             'grit_grd_file': 'app/resources/locale_settings.grd',
171           },
172           'includes': [ '../build/grit_action.gypi' ],
173         },
174         {
175           'action_name': 'chromium_strings.grd',
176           'variables': {
177             'grit_grd_file': 'app/chromium_strings.grd',
178           },
179           'includes': [ '../build/grit_action.gypi' ],
180         },
181         {
182           'action_name': 'generated_resources',
183           'variables': {
184             'grit_grd_file': 'app/generated_resources.grd',
185           },
186           'includes': [ '../build/grit_action.gypi' ],
187         },
188         {
189           'action_name': 'google_chrome_strings',
190           'variables': {
191             'grit_grd_file': 'app/google_chrome_strings.grd',
192           },
193           'includes': [ '../build/grit_action.gypi' ],
194         },
195       ],
196       'includes': [ '../build/grit_target.gypi' ],
197     },
198     {
199       'target_name': 'platform_locale_settings',
200       'type': 'none',
201       'variables': {
202         'conditions': [
203           ['OS=="win"', {
204             'platform_locale_settings_grd':
205                 'app/resources/locale_settings_win.grd',
206           },],
207           ['OS=="linux"', {
208             'conditions': [
209               ['chromeos==1', {
210                 'platform_locale_settings_grd':
211                     'app/resources/locale_settings_cros.grd',
212               }],
213               ['chromeos!=1', {
214                 'platform_locale_settings_grd':
215                     'app/resources/locale_settings_linux.grd',
216               }],
217             ],
218           },],
219           ['os_posix == 1 and OS != "mac" and OS != "linux"', {
220             'platform_locale_settings_grd':
221                 'app/resources/locale_settings_linux.grd',
222           },],
223           ['OS=="mac"', {
224             'platform_locale_settings_grd':
225                 'app/resources/locale_settings_mac.grd',
226           }],
227         ],  # conditions
228       },  # variables
229       'actions': [
230         {
231           'action_name': 'platform_locale_settings',
232           'variables': {
233             'grit_grd_file': '<(platform_locale_settings_grd)',
234           },
235           'includes': [ '../build/grit_action.gypi' ],
236         },
237       ],
238       'includes': [ '../build/grit_target.gypi' ],
239     },
240     {
241       'target_name': 'theme_resources',
242       'type': 'none',
243       'actions': [
244         {
245           'action_name': 'theme_resources',
246           'variables': {
247             'grit_grd_file': 'app/theme/theme_resources.grd',
248           },
249           'includes': [ '../build/grit_action.gypi' ],
250         },
251         {
252           'action_name': 'theme_resources_large',
253           'variables': {
254             'grit_grd_file': 'app/theme/theme_resources_large.grd',
255           },
256           'includes': [ '../build/grit_action.gypi' ],
257         },
258         {
259           'action_name': 'theme_resources_standard',
260           'variables': {
261             'grit_grd_file': 'app/theme/theme_resources_standard.grd',
262           },
263           'includes': [ '../build/grit_action.gypi' ],
264         },
265       ],
266       'includes': [ '../build/grit_target.gypi' ],
267     },
268     {
269       'target_name': 'packed_extra_resources',
270       'type': 'none',
271       'variables': {
272         'repack_path': '../tools/grit/grit/format/repack.py',
273       },
274       'dependencies': [
275         'chrome_extra_resources',
276       ],
277       'actions': [
278         {
279           'includes': ['chrome_repack_resources.gypi']
280         },
281       ],
282       'conditions': [
283         ['OS != "mac"', {
284           # We'll install the resource files to the product directory.  The Mac
285           # copies the results over as bundle resources in its own special way.
286           'copies': [
287             {
288               'destination': '<(PRODUCT_DIR)',
289               'files': [
290                 '<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak'
291               ],
292             },
293           ],
294         }]
295       ]
296     },
297     {
298       'target_name': 'packed_resources',
299       'type': 'none',
300       'variables': {
301         'repack_path': '../tools/grit/grit/format/repack.py',
302       },
303       'dependencies': [
304         # MSVS needs the dependencies explictly named, Make is able to
305         # derive the dependencies from the output files.
306         'chrome_resources',
307         'chrome_strings',
308         'default_plugin/default_plugin.gyp:default_plugin_resources',
309         'platform_locale_settings',
310         'theme_resources',
311         '<(DEPTH)/content/content_resources.gyp:content_resources',
312         '<(DEPTH)/net/net.gyp:net_resources',
313         '<(DEPTH)/ui/base/strings/ui_strings.gyp:ui_strings',
314         '<(DEPTH)/ui/ui.gyp:gfx_resources',
315         '<(DEPTH)/ui/ui.gyp:ui_resources',
316         '<(DEPTH)/ui/ui.gyp:ui_resources_large',
317         '<(DEPTH)/ui/ui.gyp:ui_resources_standard',
318         '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_resources',
319         '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_strings',
320       ],
321       'actions': [
322         {
323           'includes': ['chrome_repack_chrome.gypi']
324         },
325         {
326           'includes': ['chrome_repack_locales.gypi']
327         },
328         {
329           'includes': ['chrome_repack_pseudo_locales.gypi']
330         },
331       ],
332       'conditions': [
333         ['OS != "mac"', {
334           # We'll install the resource files to the product directory.  The Mac
335           # copies the results over as bundle resources in its own special way.
336           'copies': [
337             {
338               'destination': '<(PRODUCT_DIR)',
339               'files': [
340                 '<(SHARED_INTERMEDIATE_DIR)/repack/chrome.pak'
341               ],
342             },
343             {
344               'destination': '<(PRODUCT_DIR)/locales',
345               'files': [
346                 '<!@pymod_do_main(repack_locales -o -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(locales))'
347               ],
348             },
349             {
350               'destination': '<(PRODUCT_DIR)/pseudo_locales',
351               'files': [
352                 '<!@pymod_do_main(repack_locales -o -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(pseudo_locales))'
353               ],
354             },
355           ],
356           'conditions': [
357             ['branding=="Chrome"', {
358               'copies': [
359                 {
360                   # This location is for the Windows and Linux builds. For
361                   # Windows, the chrome.release file ensures that these files
362                   # are copied into the installer. Note that we have a separate
363                   # section in chrome_dll.gyp to copy these files for Mac, as it
364                   # needs to be dropped inside the framework.
365                   'destination': '<(PRODUCT_DIR)/default_apps',
366                   'files': ['<@(default_apps_list)']
367                 },
368               ],
369             }],
370           ], # conditions
371         }], # end OS != "mac"
372       ], # conditions
373     },
374   ], # targets