Upstream version 5.34.104.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                 'devtools_html',
41                 'supported_css_properties',
42                 'frontend_protocol_sources',
43             ],
44             'conditions': [
45                 ['debug_devtools==0', {
46                     'dependencies': ['concatenated_devtools_js',
47                                      'concatenated_devtools_elements_js',
48                                      'concatenated_devtools_resources_js',
49                                      'concatenated_devtools_network_js',
50                                      'concatenated_devtools_extensions_js',
51                                      'concatenated_devtools_scripts_js',
52                                      'concatenated_devtools_timeline_js',
53                                      'concatenated_devtools_profiles_js',
54                                      'concatenated_devtools_audits_js',
55                                      'concatenated_devtools_codemirror_js',
56                                      'concatenated_devtools_layers_js',
57                                      'concatenated_heap_snapshot_worker_js',
58                                      'concatenated_script_formatter_worker_js',
59                                      'concatenated_temp_storage_shared_worker_js',
60                                      'concatenated_devtools_css'],
61                 }],
62             ],
63             'copies': [
64                 {
65                     'destination': '<(PRODUCT_DIR)/resources/inspector',
66                     'conditions': [
67                         ['debug_devtools==1', {
68                             'files': [
69                                 '<@(devtools_files)',
70                                 '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorBackendCommands.js',
71                                 '<(SHARED_INTERMEDIATE_DIR)/blink/SupportedCSSProperties.js',
72                                 '<@(devtools_heap_snapshot_worker_js_files)',
73                                 '<@(devtools_temp_storage_shared_worker_js_files)',
74                                 '<@(devtools_script_formatter_worker_js_files)',
75                             ],
76                         },
77                         {
78                             'files': [],
79                         }],
80                     ],
81                 },
82                 {
83                     'destination': '<(PRODUCT_DIR)/resources/inspector/UglifyJS',
84                     'conditions': [
85                         ['debug_devtools==1', {
86                             'files': [
87                                 '<@(devtools_uglify_files)',
88                             ],
89                         },
90                         {
91                             'files': [],
92                         }],
93                     ],
94                 },
95                 {
96                     'destination': '<(PRODUCT_DIR)/resources/inspector/cm',
97                     'conditions': [
98                         ['debug_devtools==1', {
99                             'files': [
100                                 '<@(devtools_cm_files)',
101                             ],
102                         },
103                         {
104                             'files': [],
105                         }],
106                     ],
107                 },
108                 {
109                     'destination': '<(PRODUCT_DIR)/resources/inspector/Images',
110                     'files': [
111                         '<@(devtools_image_files)',
112                     ],
113                 },
114             ],
115         },
116         {
117             'target_name': 'devtools_html',
118             'type': 'none',
119             'sources': ['<(PRODUCT_DIR)/resources/inspector/devtools.html'],
120             'actions': [{
121                 'action_name': 'devtools_html',
122                 'script_name': 'scripts/generate_devtools_html.py',
123                 'input_page': 'front_end/inspector.html',
124                 'inputs': [
125                     '<@(_script_name)',
126                     '<@(_input_page)',
127                 ],
128                 'outputs': ['<(PRODUCT_DIR)/resources/inspector/devtools.html'],
129                 'action': ['python', '<@(_script_name)', '<@(_input_page)', '<@(_outputs)', '<@(debug_devtools)'],
130             }],
131         },
132         {
133             'target_name': 'devtools_extension_api',
134             'type': 'none',
135             'actions': [{
136                 'action_name': 'devtools_html',
137                 'script_name': 'scripts/generate_devtools_extension_api.py',
138                 'inputs': [
139                     '<@(_script_name)',
140                     '<@(devtools_extension_api_files)',
141                 ],
142                 'outputs': ['<(PRODUCT_DIR)/resources/inspector/devtools_extension_api.js'],
143                 'action': ['python', '<@(_script_name)', '<@(_outputs)', '<@(devtools_extension_api_files)'],
144             }],
145         },
146         {
147             'target_name': 'generate_devtools_grd',
148             'type': 'none',
149             'dependencies': [
150                 'devtools_html',
151                 'devtools_extension_api'
152             ],
153             'conditions': [
154                 ['debug_devtools==0', {
155                     'dependencies': ['concatenated_devtools_js',
156                                      'concatenated_devtools_elements_js',
157                                      'concatenated_devtools_resources_js',
158                                      'concatenated_devtools_network_js',
159                                      'concatenated_devtools_extensions_js',
160                                      'concatenated_devtools_scripts_js',
161                                      'concatenated_devtools_timeline_js',
162                                      'concatenated_devtools_profiles_js',
163                                      'concatenated_devtools_audits_js',
164                                      'concatenated_devtools_codemirror_js',
165                                      'concatenated_devtools_layers_js',
166                                      'concatenated_heap_snapshot_worker_js',
167                                      'concatenated_script_formatter_worker_js',
168                                      'concatenated_temp_storage_shared_worker_js',
169                                      'concatenated_devtools_css'],
170                     'actions': [{
171                         'action_name': 'generate_devtools_grd',
172                         'script_name': 'scripts/generate_devtools_grd.py',
173                         'input_pages': [
174                             '<(PRODUCT_DIR)/resources/inspector/devtools.html',
175                             '<(PRODUCT_DIR)/resources/inspector/inspector.js',
176                             '<(PRODUCT_DIR)/resources/inspector/ElementsPanel.js',
177                             '<(PRODUCT_DIR)/resources/inspector/ExtensionServer.js',
178                             '<(PRODUCT_DIR)/resources/inspector/ResourcesPanel.js',
179                             '<(PRODUCT_DIR)/resources/inspector/NetworkPanel.js',
180                             '<(PRODUCT_DIR)/resources/inspector/SourcesPanel.js',
181                             '<(PRODUCT_DIR)/resources/inspector/TimelinePanel.js',
182                             '<(PRODUCT_DIR)/resources/inspector/ProfilesPanel.js',
183                             '<(PRODUCT_DIR)/resources/inspector/AuditsPanel.js',
184                             '<(PRODUCT_DIR)/resources/inspector/LayersPanel.js',
185                             '<(PRODUCT_DIR)/resources/inspector/CodeMirrorTextEditor.js',
186                             '<(PRODUCT_DIR)/resources/inspector/HeapSnapshotWorker.js',
187                             '<(PRODUCT_DIR)/resources/inspector/ScriptFormatterWorker.js',
188                             '<(PRODUCT_DIR)/resources/inspector/TempStorageSharedWorker.js',
189                             '<(PRODUCT_DIR)/resources/inspector/inspector.css',
190                             '<(PRODUCT_DIR)/resources/inspector/devtools_extension_api.js',
191                             '<@(devtools_standalone_files)',
192                         ],
193                         'images': [
194                             '<@(devtools_image_files)',
195                         ],
196                         'inputs': [
197                             '<@(_script_name)',
198                             '<@(_input_pages)',
199                             '<@(_images)',
200                         ],
201                         'search_path': [
202                             'front_end/Images',
203                         ],
204                         'outputs': ['<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd'],
205                         'action': ['python', '<@(_script_name)', '<@(_input_pages)', '--images', '<@(_search_path)', '--output', '<@(_outputs)'],
206                     }],
207                 },
208                 {
209                     # If we're not concatenating devtools files, we want to
210                     # run after the original files have been copied to
211                     # <(PRODUCT_DIR)/resources/inspector.
212                     'dependencies': ['devtools_frontend_resources'],
213                     'actions': [{
214                         'action_name': 'generate_devtools_grd',
215                         'script_name': 'scripts/generate_devtools_grd.py',
216                         'input_pages': [
217                             '<@(devtools_files)',
218                             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorBackendCommands.js',
219                             '<(SHARED_INTERMEDIATE_DIR)/blink/SupportedCSSProperties.js',
220                             '<(PRODUCT_DIR)/resources/inspector/devtools.html',
221                         ],
222                         'images': [
223                             '<@(devtools_image_files)',
224                         ],
225                         'inputs': [
226                             '<@(_script_name)',
227                             '<@(_input_pages)',
228                             '<@(_images)',
229                         ],
230                         'search_path': [
231                             'front_end/Images',
232                         ],
233                         # Note that other files are put under /devtools directory, together with declared devtools_resources.grd
234                         'outputs': ['<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd'],
235                         'action': ['python', '<@(_script_name)', '<@(_input_pages)', '--images', '<@(_search_path)', '--output', '<@(_outputs)'],
236                     }],
237                 }],
238             ],
239         },
240         {
241           'target_name': 'frontend_protocol_sources',
242           'type': 'none',
243           'actions': [
244             {
245               'action_name': 'generateInspectorProtocolFrontendSources',
246               'inputs': [
247                 # The python script in action below.
248                 'scripts/CodeGeneratorFrontend.py',
249                 # Input file for the script.
250                 'protocol.json',
251               ],
252               'outputs': [
253                 '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorBackendCommands.js',
254               ],
255               'action': [
256                 'python',
257                 'scripts/CodeGeneratorFrontend.py',
258                 'protocol.json',
259                 '--output_js_dir', '<(SHARED_INTERMEDIATE_DIR)/blink',
260               ],
261               'message': 'Generating Inspector protocol frontend sources from protocol.json',
262             },
263           ]
264         },
265         {
266           'target_name': 'supported_css_properties',
267           'type': 'none',
268           'actions': [
269             {
270               'action_name': 'generateSupportedCSSProperties',
271               'inputs': [
272                 # The python script in action below.
273                 'scripts/generate_supported_css.py',
274                 # Input files for the script.
275                 '../core/css/CSSPropertyNames.in',
276                 '../core/css/SVGCSSPropertyNames.in',
277                 '../core/css/CSSShorthands.in',
278               ],
279               'outputs': [
280                 '<(SHARED_INTERMEDIATE_DIR)/blink/SupportedCSSProperties.js',
281               ],
282               'action': [
283                 'python',
284                 '<@(_inputs)',
285                 '<@(_outputs)',
286               ],
287               'message': 'Generating supported CSS properties for front end',
288             },
289           ]
290         },
291     ], # targets
292     'conditions': [
293         ['debug_devtools==0', {
294             'targets': [
295                 {
296                     'target_name': 'concatenated_devtools_js',
297                     'type': 'none',
298                     'dependencies': [
299                         'devtools_html',
300                         'supported_css_properties',
301                         'frontend_protocol_sources'
302                     ],
303                     'actions': [{
304                         'action_name': 'concatenate_devtools_js',
305                         'script_name': 'scripts/concatenate_js_files.py',
306                         'input_page': 'front_end/inspector.html',
307                         'inputs': [
308                             '<@(_script_name)',
309                             '<@(_input_page)',
310                             '<@(devtools_files)',
311                             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorBackendCommands.js',
312                             '<(SHARED_INTERMEDIATE_DIR)/blink/SupportedCSSProperties.js'
313                         ],
314                         'search_path': [
315                             'front_end',
316                             '<(SHARED_INTERMEDIATE_DIR)/blink',
317                         ],
318                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/inspector.js'],
319                         'action': ['python', '<@(_script_name)', '<@(_input_page)', '<@(_search_path)', '<@(_outputs)'],
320                     }],
321                 },
322                 {
323                     'target_name': 'concatenated_devtools_elements_js',
324                     'type': 'none',
325                     'actions': [{
326                         'action_name': 'concatenate_devtools_elements_js',
327                         'script_name': 'scripts/inline_js_imports.py',
328                         'input_file': 'front_end/ElementsPanel.js',
329                         'inputs': [
330                             '<@(_script_name)',
331                             '<@(devtools_elements_js_files)',
332                         ],
333                         'search_path': 'front_end',
334                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/ElementsPanel.js'],
335                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
336                     }],
337                 },
338                 {
339                     'target_name': 'concatenated_devtools_resources_js',
340                     'type': 'none',
341                     'actions': [{
342                         'action_name': 'concatenate_devtools_resources_js',
343                         'script_name': 'scripts/inline_js_imports.py',
344                         'input_file': 'front_end/ResourcesPanel.js',
345                         'inputs': [
346                             '<@(_script_name)',
347                             '<@(devtools_resources_js_files)',
348                         ],
349                         'search_path': 'front_end',
350                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/ResourcesPanel.js'],
351                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
352                     }],
353                 },
354                 {
355                     'target_name': 'concatenated_devtools_network_js',
356                     'type': 'none',
357                     'actions': [{
358                         'action_name': 'concatenate_devtools_network_js',
359                         'script_name': 'scripts/inline_js_imports.py',
360                         'input_file': 'front_end/NetworkPanel.js',
361                         'inputs': [
362                             '<@(_script_name)',
363                             '<@(devtools_network_js_files)',
364                         ],
365                         'search_path': 'front_end',
366                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/NetworkPanel.js'],
367                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
368                     }],
369                 },
370                 {
371                     'target_name': 'concatenated_devtools_extensions_js',
372                     'type': 'none',
373                     'actions': [{
374                         'action_name': 'concatenate_devtools_extensions_js',
375                         'script_name': 'scripts/inline_js_imports.py',
376                         'input_file': 'front_end/ExtensionServer.js',
377                         'inputs': [
378                             '<@(_script_name)',
379                             '<@(devtools_extensions_js_files)',
380                         ],
381                         'search_path': 'front_end',
382                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/ExtensionServer.js'],
383                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
384                     }],
385                 },
386                 {
387                     'target_name': 'concatenated_devtools_scripts_js',
388                     'type': 'none',
389                     'actions': [{
390                         'action_name': 'concatenate_devtools_scripts_js',
391                         'script_name': 'scripts/inline_js_imports.py',
392                         'input_file': 'front_end/SourcesPanel.js',
393                         'inputs': [
394                             '<@(_script_name)',
395                             '<@(devtools_scripts_js_files)',
396                         ],
397                         'search_path': 'front_end',
398                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/SourcesPanel.js'],
399                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
400                     }],
401                 },
402                 {
403                     'target_name': 'concatenated_devtools_timeline_js',
404                     'type': 'none',
405                     'actions': [{
406                         'action_name': 'concatenate_devtools_timeline_js',
407                         'script_name': 'scripts/inline_js_imports.py',
408                         'input_file': 'front_end/TimelinePanel.js',
409                         'inputs': [
410                             '<@(_script_name)',
411                             '<@(devtools_timeline_js_files)',
412                         ],
413                         'search_path': 'front_end',
414                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/TimelinePanel.js'],
415                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
416                     }],
417                 },
418                 {
419                     'target_name': 'concatenated_devtools_profiles_js',
420                     'type': 'none',
421                     'actions': [{
422                         'action_name': 'concatenate_devtools_profiles_js',
423                         'script_name': 'scripts/inline_js_imports.py',
424                         'input_file': 'front_end/ProfilesPanel.js',
425                         'inputs': [
426                             '<@(_script_name)',
427                             '<@(devtools_profiles_js_files)',
428                         ],
429                         'search_path': 'front_end',
430                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/ProfilesPanel.js'],
431                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
432                     }],
433                 },
434                 {
435                     'target_name': 'concatenated_devtools_audits_js',
436                     'type': 'none',
437                     'actions': [{
438                         'action_name': 'concatenate_devtools_audits_js',
439                         'script_name': 'scripts/inline_js_imports.py',
440                         'input_file': 'front_end/AuditsPanel.js',
441                         'inputs': [
442                             '<@(_script_name)',
443                             '<@(devtools_audits_js_files)',
444                         ],
445                         'search_path': 'front_end',
446                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/AuditsPanel.js'],
447                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
448                     }],
449                 },
450                 {
451                     'target_name': 'concatenated_devtools_codemirror_js',
452                     'type': 'none',
453                     'actions': [{
454                         'action_name': 'concatenate_devtools_codemirror_js',
455                         'script_name': 'scripts/inline_js_imports.py',
456                         'input_file': 'front_end/CodeMirrorTextEditor.js',
457                         'inputs': [
458                             '<@(_script_name)',
459                             '<@(devtools_codemirror_js_files)',
460                             '<@(devtools_cm_files)',
461                         ],
462                         'search_path': 'front_end',
463                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/CodeMirrorTextEditor.js'],
464                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
465                     }],
466                 },
467                 {
468                     'target_name': 'concatenated_heap_snapshot_worker_js',
469                     'type': 'none',
470                     'actions': [{
471                         'action_name': 'concatenate_heap_snapshot_worker_js',
472                         'script_name': 'scripts/inline_js_imports.py',
473                         'input_file': 'front_end/HeapSnapshotWorker.js',
474                         'inputs': [
475                             '<@(_script_name)',
476                             '<@(_input_file)',
477                             '<@(devtools_heap_snapshot_worker_js_files)',
478                         ],
479                         'search_path': 'front_end',
480                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/HeapSnapshotWorker.js'],
481                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
482                     }],
483                 },
484                 {
485                     'target_name': 'concatenated_script_formatter_worker_js',
486                     'type': 'none',
487                     'actions': [{
488                         'action_name': 'concatenate_script_formatter_worker_js',
489                         'script_name': 'scripts/inline_js_imports.py',
490                         'input_file': 'front_end/ScriptFormatterWorker.js',
491                         'inputs': [
492                             '<@(_script_name)',
493                             '<@(_input_file)',
494                             '<@(devtools_uglify_files)'
495                         ],
496                         'search_path': 'front_end',
497                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/ScriptFormatterWorker.js'],
498                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
499                     }],
500                 },
501                 {
502                     'target_name': 'concatenated_temp_storage_shared_worker_js',
503                     'type': 'none',
504                     'actions': [{
505                         'action_name': 'concatenate_temp_storage_shared_worker_js',
506                         'script_name': 'scripts/inline_js_imports.py',
507                         'input_file': 'front_end/TempStorageSharedWorker.js',
508                         'inputs': [
509                             '<@(_script_name)',
510                             '<@(devtools_temp_storage_shared_worker_js_files)'
511                         ],
512                         'search_path': 'front_end',
513                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/TempStorageSharedWorker.js'],
514                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
515                     }],
516                 },
517                 {
518                     'target_name': 'concatenated_devtools_layers_js',
519                     'type': 'none',
520                     'actions': [{
521                         'action_name': 'concatenate_devtools_layers_js',
522                         'script_name': 'scripts/inline_js_imports.py',
523                         'input_file': 'front_end/LayersPanel.js',
524                         'inputs': [
525                             '<@(_script_name)',
526                             '<@(devtools_layers_js_files)',
527                         ],
528                         'search_path': 'front_end',
529                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/LayersPanel.js'],
530                         'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
531                     }],
532                 },
533                 {
534                     'target_name': 'concatenated_devtools_css',
535                     'type': 'none',
536                     'dependencies': [
537                         'devtools_html'
538                     ],
539                     'actions': [{
540                         'action_name': 'concatenate_devtools_css',
541                         'script_name': 'scripts/concatenate_css_files.py',
542                         'input_page': 'front_end/inspector.html',
543                         'inputs': [
544                             '<@(_script_name)',
545                             '<@(_input_page)',
546                             '<@(devtools_files)',
547                         ],
548                         'search_path': [ 'front_end' ],
549                         'outputs': ['<(PRODUCT_DIR)/resources/inspector/inspector.css'],
550                         'action': ['python', '<@(_script_name)', '<@(_input_page)', '<@(_search_path)', '<@(_outputs)'],
551                     }],
552                     'copies': [{
553                         'destination': '<(PRODUCT_DIR)/resources/inspector',
554                         'files': [
555                             '<@(devtools_standalone_files)',
556                         ],
557                     }],
558                 },
559             ],
560         }],
561     ], # conditions
562 }