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