Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / devtools / devtools.gyp
1 #
2 # Copyright (C) 2013 Google Inc. All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
6 # met:
7 #
8 #         * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 #         * Redistributions in binary form must reproduce the above
11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the
13 # distribution.
14 #         * Neither the name of Google Inc. nor the names of its
15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #
30
31 {
32     'includes': [
33       'devtools.gypi',
34     ],
35     'targets': [
36         {
37             'target_name': 'devtools_frontend_resources',
38             'type': 'none',
39             'dependencies': [
40                 'supported_css_properties',
41                 'frontend_protocol_sources',
42                 'build_applications',
43             ],
44             'conditions': [
45                 ['debug_devtools==0', {
46                     'dependencies': [
47                         'concatenated_devtools_css',
48                         'concatenated_toolbox_css',
49                     ],
50                 }],
51             ],
52             'copies': [
53                 {
54                     'destination': '<(PRODUCT_DIR)/resources/inspector/Images',
55                     'files': [
56                         '<@(devtools_image_files)',
57                     ],
58                 },
59             ],
60         },
61         {
62             'target_name': 'devtools_extension_api',
63             'type': 'none',
64             'actions': [{
65                 'action_name': 'devtools_extension_api',
66                 'script_name': 'scripts/generate_devtools_extension_api.py',
67                 'inputs': [
68                     '<@(_script_name)',
69                     '<@(devtools_extension_api_files)',
70                 ],
71                 'outputs': ['<(PRODUCT_DIR)/resources/inspector/devtools_extension_api.js'],
72                 'action': ['python', '<@(_script_name)', '<@(_outputs)', '<@(devtools_extension_api_files)'],
73             }],
74         },
75         {
76             'target_name': 'generate_devtools_grd',
77             'type': 'none',
78             'dependencies': [
79                 'devtools_extension_api',
80                 'devtools_frontend_resources',
81             ],
82             'conditions': [
83                 ['debug_devtools==0', {
84                     'actions': [{
85                         'action_name': 'generate_devtools_grd',
86                         'script_name': 'scripts/generate_devtools_grd.py',
87                         'relative_path_dirs': [
88                             '<(PRODUCT_DIR)/resources/inspector',
89                             'front_end'
90                         ],
91                         'static_files': [
92                             # Intentionally empty. Should get rebuilt when switching from debug_devtools==1.
93                         ],
94                         'devtools_static_files_list': '<|(devtools_static_grd_files.tmp <@(_static_files))',
95                         'generated_files': [
96                             '<(PRODUCT_DIR)/resources/inspector/devtools.css',
97                             '<(PRODUCT_DIR)/resources/inspector/devtools.html',
98                             '<(PRODUCT_DIR)/resources/inspector/devtools.js',
99                             '<(PRODUCT_DIR)/resources/inspector/toolbox.css',
100                             '<(PRODUCT_DIR)/resources/inspector/toolbox.html',
101                             '<(PRODUCT_DIR)/resources/inspector/toolbox.js',
102                             '<(PRODUCT_DIR)/resources/inspector/audits_module.js',
103                             '<(PRODUCT_DIR)/resources/inspector/console_module.js',
104                             '<(PRODUCT_DIR)/resources/inspector/devices_module.js',
105                             '<(PRODUCT_DIR)/resources/inspector/documentation_module.js',
106                             '<(PRODUCT_DIR)/resources/inspector/elements_module.js',
107                             '<(PRODUCT_DIR)/resources/inspector/heap_snapshot_worker_module.js',
108                             '<(PRODUCT_DIR)/resources/inspector/layers_module.js',
109                             '<(PRODUCT_DIR)/resources/inspector/network_module.js',
110                             '<(PRODUCT_DIR)/resources/inspector/profiler_module.js',
111                             '<(PRODUCT_DIR)/resources/inspector/promises_module.js',
112                             '<(PRODUCT_DIR)/resources/inspector/resources_module.js',
113                             '<(PRODUCT_DIR)/resources/inspector/script_formatter_worker_module.js',
114                             '<(PRODUCT_DIR)/resources/inspector/settings_module.js',
115                             '<(PRODUCT_DIR)/resources/inspector/source_frame_module.js',
116                             '<(PRODUCT_DIR)/resources/inspector/sources_module.js',
117                             '<(PRODUCT_DIR)/resources/inspector/temp_storage_shared_worker_module.js',
118                             '<(PRODUCT_DIR)/resources/inspector/timeline_module.js',
119                             '<(PRODUCT_DIR)/resources/inspector/devtools_extension_api.js',
120                         ],
121                         'inputs': [
122                             '<@(_script_name)',
123                             '<@(_static_files)',
124                             '<@(_generated_files)',
125                             '<@(devtools_image_files)',
126                             '<(_devtools_static_files_list)',
127                         ],
128                         'images_path': [
129                             'front_end/Images',
130                         ],
131                         'outputs': ['<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd'],
132                         'action': ['python', '<@(_script_name)', '<@(_generated_files)', '--static_files_list', '<(_devtools_static_files_list)', '--relative_path_dirs', '<@(_relative_path_dirs)', '--images', '<@(_images_path)', '--output', '<@(_outputs)'],
133                     }],
134                 },
135                 {
136                     # If we're not concatenating devtools files, we want to
137                     # run after the original files have been copied to
138                     # <(PRODUCT_DIR)/resources/inspector.
139                     'dependencies': ['devtools_frontend_resources'],
140                     'actions': [{
141                         'action_name': 'generate_devtools_grd',
142                         'script_name': 'scripts/generate_devtools_grd.py',
143                         'relative_path_dirs': [
144                             'front_end',
145                             '<(PRODUCT_DIR)/resources/inspector',
146                         ],
147                         'static_files': [
148                             '<@(all_devtools_files)',
149                             'front_end/Runtime.js',
150                         ],
151                         'devtools_static_files_list': '<|(devtools_static_grd_files.tmp <@(_static_files))',
152                         'generated_files': [
153                             '<(PRODUCT_DIR)/resources/inspector/InspectorBackendCommands.js',
154                             '<(PRODUCT_DIR)/resources/inspector/SupportedCSSProperties.js',
155                             '<(PRODUCT_DIR)/resources/inspector/devtools.html',
156                             '<(PRODUCT_DIR)/resources/inspector/toolbox.html',
157                         ],
158                         'inputs': [
159                             '<@(_script_name)',
160                             '<@(_static_files)',
161                             '<@(_generated_files)',
162                             '<@(devtools_image_files)',
163                             '<(_devtools_static_files_list)',
164                         ],
165                         'images_path': [
166                             'front_end/Images',
167                         ],
168                         # Note that other files are put under /devtools directory, together with declared devtools_resources.grd
169                         'outputs': ['<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd'],
170                         'action': ['python', '<@(_script_name)', '<@(_generated_files)', '--static_files_list', '<(_devtools_static_files_list)', '--relative_path_dirs', '<@(_relative_path_dirs)', '--images', '<@(_images_path)', '--output', '<@(_outputs)'],
171                     }],
172                 }],
173             ],
174         },
175         {
176           'target_name': 'frontend_protocol_sources',
177           'type': 'none',
178           'actions': [
179             {
180               'action_name': 'generateInspectorProtocolFrontendSources',
181               'inputs': [
182                 # The python script in action below.
183                 'scripts/CodeGeneratorFrontend.py',
184                 # Input file for the script.
185                 'protocol.json',
186               ],
187               'outputs': [
188                 '<(PRODUCT_DIR)/resources/inspector/InspectorBackendCommands.js',
189               ],
190               'action': [
191                 'python',
192                 'scripts/CodeGeneratorFrontend.py',
193                 'protocol.json',
194                 '--output_js_dir', '<(PRODUCT_DIR)/resources/inspector/',
195               ],
196               'message': 'Generating Inspector protocol frontend sources from protocol.json',
197             },
198           ]
199         },
200         {
201           'target_name': 'supported_css_properties',
202           'type': 'none',
203           'actions': [
204             {
205               'action_name': 'generateSupportedCSSProperties',
206               'inputs': [
207                 # The python script in action below.
208                 'scripts/generate_supported_css.py',
209                 # Input files for the script.
210                 '../core/css/CSSProperties.in',
211               ],
212               'outputs': [
213                 '<(PRODUCT_DIR)/resources/inspector/SupportedCSSProperties.js',
214               ],
215               'action': [
216                 'python',
217                 '<@(_inputs)',
218                 '<@(_outputs)',
219               ],
220               'message': 'Generating supported CSS properties for front end',
221             },
222           ]
223         },
224
225         # Frontend applications and modules.
226         {
227             'target_name': 'build_applications',
228             'type': 'none',
229             'dependencies': [
230                 'supported_css_properties',
231                 'frontend_protocol_sources',
232             ],
233             'output_path': '<(PRODUCT_DIR)/resources/inspector/',
234             'actions': [{
235                 'action_name': 'build_applications',
236                 'script_name': 'scripts/build_applications.py',
237                 'helper_scripts': [
238                     'scripts/modular_build.py',
239                     'scripts/concatenate_application_code.py',
240                 ],
241                 'inputs': [
242                     '<@(_script_name)',
243                     '<@(_helper_scripts)',
244                     '<@(all_devtools_files)',
245                     'front_end/devtools.html',
246                     'front_end/toolbox.html',
247                     '<(_output_path)/InspectorBackendCommands.js',
248                     '<(_output_path)/SupportedCSSProperties.js',
249                 ],
250                 'action': ['python', '<@(_script_name)', 'devtools', 'toolbox', '--input_path', 'front_end', '--output_path', '<@(_output_path)', '--debug', '<@(debug_devtools)'],
251                 'conditions': [
252                     ['debug_devtools==0', { # Release
253                         'outputs': [
254                             '<(_output_path)/devtools.html',
255                             '<(_output_path)/devtools.js',
256                             '<(_output_path)/toolbox.html',
257                             '<(_output_path)/toolbox.js',
258                             '<(_output_path)/audits_module.js',
259                             '<(_output_path)/console_module.js',
260                             '<(_output_path)/devices_module.js',
261                             '<(_output_path)/documentation_module.js',
262                             '<(_output_path)/elements_module.js',
263                             '<(_output_path)/heap_snapshot_worker_module.js',
264                             '<(_output_path)/layers_module.js',
265                             '<(_output_path)/network_module.js',
266                             '<(_output_path)/profiler_module.js',
267                             '<(_output_path)/promises_module.js',
268                             '<(_output_path)/resources_module.js',
269                             '<(_output_path)/script_formatter_worker_module.js',
270                             '<(_output_path)/settings_module.js',
271                             '<(_output_path)/source_frame_module.js',
272                             '<(_output_path)/sources_module.js',
273                             '<(_output_path)/temp_storage_shared_worker_module.js',
274                             '<(_output_path)/timeline_module.js',
275                         ],
276                     },
277                     { # Debug
278                         'outputs': [
279                             '<(_output_path)/devtools.html',
280                             '<(_output_path)/toolbox.html',
281                         ]
282                     }]
283                 ]
284             }],
285             'conditions': [
286                 ['debug_devtools==0', { # Release
287                 },
288                 { # Debug
289                   # Copy runtime core and non-module directories here.
290                     'copies': [
291                         {
292                             'destination': '<(_output_path)',
293                             'files': [
294                                 '<@(devtools_core_base_files)',
295                                 '<@(devtools_core_css_files)',
296                             ],
297                         },
298                         {
299                             'destination': '<(_output_path)/UglifyJS',
300                             'files': [
301                                 '<@(devtools_uglify_files)',
302                             ],
303                         },
304                         {
305                             'destination': '<(_output_path)/cm',
306                             'files': [
307                                 '<@(devtools_cm_js_files)',
308                                 '<@(devtools_cm_css_files)',
309                             ],
310                         },
311                     ]
312                 }]
313             ]
314         },
315     ], # targets
316     'conditions': [
317         ['debug_devtools==0', {
318             'targets': [
319                 {
320                     'target_name': 'concatenated_devtools_css',
321                     'type': 'none',
322                     'actions': [{
323                         'action_name': 'concatenate_devtools_css',
324                         'script_name': 'scripts/concatenate_css_files.py',
325                         'input_stylesheet': 'front_end/devtools.css',
326                         'inputs': [
327                             '<@(_script_name)',
328                             '<@(_input_stylesheet)',
329                             '<@(devtools_core_base_files)',
330                         ],
331                         'search_path': [ 'front_end' ],
332                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/devtools.css'],
333                         'action': ['python', '<@(_script_name)', '<@(_input_stylesheet)', '<@(_outputs)'],
334                     }],
335                 },
336                 {
337                     'target_name': 'concatenated_toolbox_css',
338                     'type': 'none',
339                     'actions': [{
340                         'action_name': 'concatenate_toolbox_css',
341                         'script_name': 'scripts/concatenate_css_files.py',
342                         'input_stylesheet': 'front_end/toolbox.css',
343                         'inputs': [
344                             '<@(_script_name)',
345                             '<@(_input_stylesheet)',
346                             '<@(devtools_core_base_files)',
347                         ],
348                         'search_path': [ 'front_end' ],
349                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/toolbox.css'],
350                         'action': ['python', '<@(_script_name)', '<@(_input_stylesheet)', '<@(_outputs)'],
351                     }],
352                 },
353             ],
354         }],
355     ], # conditions
356 }