OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 gypi_values = exec_script( |
| 6 "//build/gypi_to_gn.py", |
| 7 [ rebase_path("devtools.gypi") ], |
| 8 "scope", |
| 9 [ "devtools.gypi" ]) |
| 10 |
| 11 # Some of the files in the .gypi use GYP variable expansions, go through and |
| 12 # fix them. |
| 13 devtools_core_base_js_files = gypi_values.devtools_core_base_js_files - [ |
| 14 "<@(devtools_main_js_files)", |
| 15 "<@(devtools_standalone_files)", |
| 16 ] + gypi_values.devtools_main_js_files + gypi_values.devtools_standalone_files |
| 17 |
| 18 devtools_core_js_files = |
| 19 devtools_core_base_js_files + |
| 20 gypi_values.devtools_common_js_files + |
| 21 gypi_values.devtools_sdk_js_files + |
| 22 gypi_values.devtools_ui_js_files + |
| 23 gypi_values.devtools_components_js_files |
| 24 |
| 25 devtools_extensions_js_files = gypi_values.devtools_extensions_js_files - |
| 26 [ "<@(devtools_extension_api_files)" ] + |
| 27 gypi_values.devtools_extension_api_files |
| 28 |
| 29 devtools_modules_js_files = |
| 30 gypi_values.devtools_console_js_files + |
| 31 gypi_values.devtools_search_js_files + |
| 32 gypi_values.devtools_devices_js_files + |
| 33 gypi_values.devtools_elements_js_files + |
| 34 devtools_extensions_js_files + |
| 35 gypi_values.devtools_resources_js_files + |
| 36 gypi_values.devtools_network_js_files + |
| 37 gypi_values.devtools_source_frame_js_files + |
| 38 gypi_values.devtools_sources_js_files + |
| 39 gypi_values.devtools_timeline_js_files + |
| 40 gypi_values.devtools_profiler_js_files + |
| 41 gypi_values.devtools_audits_js_files + |
| 42 gypi_values.devtools_layers_js_files + |
| 43 gypi_values.devtools_heap_snapshot_worker_js_files + |
| 44 gypi_values.devtools_temp_storage_shared_worker_js_files + |
| 45 gypi_values.devtools_script_formatter_worker_js_files + |
| 46 gypi_values.devtools_uglify_files |
| 47 |
| 48 all_devtools_files = |
| 49 devtools_core_js_files + |
| 50 devtools_modules_js_files + |
| 51 gypi_values.devtools_cm_css_files + |
| 52 gypi_values.devtools_cm_js_files + |
| 53 gypi_values.devtools_module_json_files |
| 54 |
| 55 #------------------------------------------------------------------------------- |
| 56 |
| 57 visibility = "//third_party/WebKit/*" |
| 58 |
| 59 # Probably need to parameterize this. If we set it to true, there will be some |
| 60 # further work in the scripts below. |
| 61 debug_devtools = false |
| 62 |
| 63 group("devtools_frontend_resources") { |
| 64 deps = [ |
| 65 ":build_audits_module", |
| 66 ":build_console_module", |
| 67 ":build_core_module", |
| 68 ":build_devices_module", |
| 69 ":build_elements_module", |
| 70 ":build_extensions_module", |
| 71 ":build_heap_snapshot_worker_module", |
| 72 ":build_layers_module", |
| 73 ":build_network_module", |
| 74 ":build_profiler_module", |
| 75 ":build_resources_module", |
| 76 ":build_script_formatter_worker_module", |
| 77 ":build_search_module", |
| 78 ":build_settings_module", |
| 79 ":build_source_frame_module", |
| 80 ":build_sources_module", |
| 81 ":build_temp_storage_shared_worker_module", |
| 82 ":build_timeline_module", |
| 83 ":copy_inspector_images", |
| 84 ":devtools_html", |
| 85 ":frontend_protocol_sources", |
| 86 ":supported_css_properties", |
| 87 ] |
| 88 |
| 89 if (debug_devtools) { |
| 90 deps += [ ":concatenated_devtools_css" ] |
| 91 } |
| 92 } |
| 93 |
| 94 copy("copy_inspector_images") { |
| 95 sources = gypi_values.devtools_image_files |
| 96 outputs = [ "$root_out_dir/resources/inspector/Images/{{source_file_part}}" ] |
| 97 } |
| 98 |
| 99 # TODO(GYP) need debug_devtools support (this runs somewhat differently). |
| 100 action("generate_devtools_grd") { |
| 101 script = "scripts/generate_devtools_grd.py" |
| 102 |
| 103 input_pages = [ |
| 104 "$root_out_dir/resources/inspector/devtools.html", |
| 105 "$root_out_dir/resources/inspector/main/Main.js", |
| 106 "$root_out_dir/resources/inspector/search/AdvancedSearchView.js", |
| 107 "$root_out_dir/resources/inspector/console/ConsolePanel.js", |
| 108 "$root_out_dir/resources/inspector/elements/ElementsPanel.js", |
| 109 "$root_out_dir/resources/inspector/extensions/ExtensionServer.js", |
| 110 "$root_out_dir/resources/inspector/resources/ResourcesPanel.js", |
| 111 "$root_out_dir/resources/inspector/network/NetworkPanel.js", |
| 112 "$root_out_dir/resources/inspector/source_frame/SourceFrame.js", |
| 113 "$root_out_dir/resources/inspector/sources/SourcesPanel.js", |
| 114 "$root_out_dir/resources/inspector/timeline/TimelinePanel.js", |
| 115 "$root_out_dir/resources/inspector/profiler/ProfilesPanel.js", |
| 116 "$root_out_dir/resources/inspector/audits/AuditsPanel.js", |
| 117 "$root_out_dir/resources/inspector/layers/LayersPanel.js", |
| 118 "$root_out_dir/resources/inspector/profiler/heap_snapshot_worker/HeapSnapsho
tWorker.js", |
| 119 "$root_out_dir/resources/inspector/script_formatter_worker/ScriptFormatterWo
rker.js", |
| 120 "$root_out_dir/resources/inspector/temp_storage_shared_worker/TempStorageSha
redWorker.js", |
| 121 "$root_out_dir/resources/inspector/devices/DevicesView.js", |
| 122 "$root_out_dir/resources/inspector/inspector.css", |
| 123 "$root_out_dir/resources/inspector/devtools_extension_api.js", |
| 124 ] + gypi_values.devtools_standalone_files + gypi_values.devtools_cm_css_files |
| 125 |
| 126 images = gypi_values.devtools_image_files |
| 127 images_path = "front_end/Images" |
| 128 |
| 129 source_prereqs = input_pages + images |
| 130 |
| 131 outfile = "$root_gen_dir/devtools/devtools_resources.grd" |
| 132 outputs = [ outfile ] |
| 133 |
| 134 relative_path_dirs = [ |
| 135 "$root_out_dir/resources/inspector", |
| 136 "frontend", |
| 137 ] |
| 138 |
| 139 args = rebase_path(input_pages, root_build_dir) + [ |
| 140 "--relative_path_dirs" ] + |
| 141 rebase_path(relative_path_dirs, root_build_dir) + [ |
| 142 "--images", rebase_path(images_path, root_build_dir), |
| 143 "--output", rebase_path(outfile, root_build_dir), |
| 144 ] |
| 145 |
| 146 deps = [ |
| 147 ":devtools_html", |
| 148 ":devtools_extension_api", |
| 149 ":devtools_frontend_resources", |
| 150 ] |
| 151 } |
| 152 |
| 153 action("devtools_html") { |
| 154 script = "scripts/generate_devtools_html.py" |
| 155 |
| 156 source_prereqs = [ "front_end/inspector.html"] |
| 157 outputs = [ "$root_out_dir/resources/inspector/devtools.html"] |
| 158 |
| 159 args = rebase_path(source_prereqs, root_build_dir) + |
| 160 rebase_path(outputs, root_build_dir) |
| 161 |
| 162 if (debug_devtools) { |
| 163 args += [ "1" ] |
| 164 } else { |
| 165 args += [ "0" ] |
| 166 } |
| 167 } |
| 168 |
| 169 action("devtools_extension_api") { |
| 170 script = "scripts/generate_devtools_extension_api.py" |
| 171 |
| 172 source_prereqs = gypi_values.devtools_extension_api_files |
| 173 outputs = [ "$root_out_dir/resources/inspector/devtools_extension_api.js" ] |
| 174 |
| 175 args = rebase_path(outputs, root_build_dir) + |
| 176 rebase_path(gypi_values.devtools_extension_api_files, root_build_dir) |
| 177 } |
| 178 |
| 179 action("supported_css_properties") { |
| 180 script = "scripts/generate_supported_css.py" |
| 181 |
| 182 source_prereqs = [ |
| 183 "../core/css/CSSPropertyNames.in", |
| 184 "../core/css/SVGCSSPropertyNames.in", |
| 185 "../core/css/CSSShorthands.in", |
| 186 ] |
| 187 |
| 188 outputs = [ |
| 189 "$root_gen_dir/blink/SupportedCSSProperties.js" |
| 190 ] |
| 191 |
| 192 args = rebase_path(source_prereqs, root_build_dir) + |
| 193 rebase_path(outputs, root_build_dir) |
| 194 } |
| 195 |
| 196 action("frontend_protocol_sources") { |
| 197 script = "scripts/CodeGeneratorFrontend.py" |
| 198 |
| 199 source_prereqs = [ "protocol.json" ] |
| 200 outputs = [ "$root_gen_dir/blink/InspectorBackendCommands.js" ] |
| 201 |
| 202 args = rebase_path(source_prereqs, root_build_dir) + [ |
| 203 "--output_js_dir", rebase_path("$root_gen_dir/blink", root_build_dir), |
| 204 ] |
| 205 } |
| 206 |
| 207 # Runs the inline_js_imports script. |
| 208 # input: (String) The input .js file to read. |
| 209 # imported_files: (List of strings) The list of files the input depends on. |
| 210 # output: (String) The .js file to write. |
| 211 template("inline_js_imports") { |
| 212 assert(defined(invoker.input), target_name) |
| 213 assert(defined(invoker.imported_files), target_name) |
| 214 assert(defined(invoker.output), target_name) |
| 215 |
| 216 action(target_name) { |
| 217 script = "scripts/inline_js_imports.py" |
| 218 |
| 219 source_prereqs = [ invoker.input ] + invoker.imported_files |
| 220 outputs = [ invoker.output ] |
| 221 |
| 222 args = [ |
| 223 rebase_path(invoker.input, root_build_dir), |
| 224 rebase_path(invoker.output, root_build_dir), |
| 225 ] |
| 226 } |
| 227 } |
| 228 |
| 229 inline_js_imports("build_audits_module") { |
| 230 input = "front_end/audits/AuditsPanel.js" |
| 231 imported_files = gypi_values.devtools_audits_js_files |
| 232 output = "$root_out_dir/resources/inspector/audits/AuditsPanel.js" |
| 233 } |
| 234 |
| 235 action("build_core_module") { |
| 236 script = "scripts/concatenate_js_files.py" |
| 237 input_page = "front_end/inspector.html" |
| 238 source_prereqs = [ |
| 239 input_page, |
| 240 "$root_gen_dir/blink/InspectorBackendCommands.js", |
| 241 "$root_gen_dir/blink/SupportedCSSProperties.js", |
| 242 "$root_gen_dir/blink/common/modules.js", |
| 243 ] + devtools_core_js_files |
| 244 |
| 245 search_path = [ |
| 246 "$root_gen_dir/blink", |
| 247 "front_end", |
| 248 ] |
| 249 outputs = [ |
| 250 "$root_out_dir/resources/inspector/main/Main.js", |
| 251 ] |
| 252 |
| 253 args = [ |
| 254 rebase_path(input_page, root_build_dir), |
| 255 ] |
| 256 args += rebase_path(search_path, root_build_dir) |
| 257 args += rebase_path(outputs, root_build_dir) |
| 258 |
| 259 deps = [ |
| 260 ":devtools_html", |
| 261 ":supported_css_properties", |
| 262 ":frontend_protocol_sources", |
| 263 ":concatenated_module_descriptors", |
| 264 ] |
| 265 } |
| 266 |
| 267 inline_js_imports("build_console_module") { |
| 268 input = "front_end/console/ConsolePanel.js" |
| 269 imported_files = gypi_values.devtools_console_js_files |
| 270 output = "$root_out_dir/resources/inspector/console/ConsolePanel.js" |
| 271 } |
| 272 |
| 273 inline_js_imports("build_devices_module") { |
| 274 input = "front_end/devices/DevicesView.js" |
| 275 imported_files = gypi_values.devtools_devices_js_files |
| 276 output = "$root_out_dir/resources/inspector/devices/DevicesView.js" |
| 277 } |
| 278 |
| 279 inline_js_imports("build_elements_module") { |
| 280 input = "front_end/elements/ElementsPanel.js" |
| 281 imported_files = gypi_values.devtools_elements_js_files |
| 282 output = "$root_out_dir/resources/inspector/elements/ElementsPanel.js" |
| 283 } |
| 284 |
| 285 inline_js_imports("build_extensions_module") { |
| 286 input = "front_end/extensions/ExtensionServer.js" |
| 287 imported_files = devtools_extensions_js_files |
| 288 output = "$root_out_dir/resources/inspector/extensions/ExtensionServer.js" |
| 289 } |
| 290 |
| 291 inline_js_imports("build_layers_module") { |
| 292 input = "front_end/layers/LayersPanel.js" |
| 293 imported_files = gypi_values.devtools_layers_js_files |
| 294 output = "$root_out_dir/resources/inspector/layers/LayersPanel.js" |
| 295 } |
| 296 |
| 297 inline_js_imports("build_network_module") { |
| 298 input = "front_end/network/NetworkPanel.js" |
| 299 imported_files = gypi_values.devtools_network_js_files |
| 300 output = "$root_out_dir/resources/inspector/network/NetworkPanel.js" |
| 301 } |
| 302 |
| 303 inline_js_imports("build_profiler_module") { |
| 304 input = "front_end/profiler/ProfilesPanel.js" |
| 305 imported_files = gypi_values.devtools_profiler_js_files |
| 306 output = "$root_out_dir/resources/inspector/profiler/ProfilesPanel.js" |
| 307 } |
| 308 |
| 309 inline_js_imports("build_resources_module") { |
| 310 input = "front_end/resources/ResourcesPanel.js" |
| 311 imported_files = gypi_values.devtools_resources_js_files |
| 312 output = "$root_out_dir/resources/inspector/resources/ResourcesPanel.js" |
| 313 } |
| 314 |
| 315 inline_js_imports("build_search_module") { |
| 316 input = "front_end/search/AdvancedSearchView.js" |
| 317 imported_files = gypi_values.devtools_search_js_files |
| 318 output = "$root_out_dir/resources/inspector/search/AdvancedSearchView.js" |
| 319 } |
| 320 |
| 321 inline_js_imports("build_settings_module") { |
| 322 input = "front_end/settings/SettingsScreen.js" |
| 323 imported_files = gypi_values.devtools_settings_js_files |
| 324 output = "$root_out_dir/resources/inspector/settings/SettingsScreen.js" |
| 325 } |
| 326 |
| 327 inline_js_imports("build_source_frame_module") { |
| 328 input = "front_end/source_frame/SourceFrame.js" |
| 329 imported_files = gypi_values.devtools_source_frame_js_files + |
| 330 gypi_values.devtools_cm_js_files |
| 331 output = "$root_out_dir/resources/inspector/source_frame/SourceFrame.js" |
| 332 } |
| 333 |
| 334 inline_js_imports("build_sources_module") { |
| 335 input = "front_end/sources/SourcesPanel.js" |
| 336 imported_files = gypi_values.devtools_sources_js_files |
| 337 output = "$root_out_dir/resources/inspector/sources/SourcesPanel.js" |
| 338 } |
| 339 |
| 340 inline_js_imports("build_timeline_module") { |
| 341 input = "front_end/timeline/TimelinePanel.js" |
| 342 imported_files = gypi_values.devtools_timeline_js_files |
| 343 output = "$root_out_dir/resources/inspector/timeline/TimelinePanel.js" |
| 344 } |
| 345 |
| 346 inline_js_imports("build_heap_snapshot_worker_module") { |
| 347 input = "front_end/profiler/heap_snapshot_worker/HeapSnapshotWorker.js" |
| 348 imported_files = gypi_values.devtools_heap_snapshot_worker_js_files |
| 349 output = "$root_out_dir/resources/inspector/profiler/heap_snapshot_worker/Heap
SnapshotWorker.js" |
| 350 } |
| 351 |
| 352 inline_js_imports("build_script_formatter_worker_module") { |
| 353 input = "front_end/script_formatter_worker/ScriptFormatterWorker.js" |
| 354 imported_files = gypi_values.devtools_uglify_files |
| 355 output = "$root_out_dir/resources/inspector/script_formatter_worker/ScriptForm
atterWorker.js" |
| 356 } |
| 357 |
| 358 inline_js_imports("build_temp_storage_shared_worker_module") { |
| 359 input = "front_end/temp_storage_shared_worker/TempStorageSharedWorker.js" |
| 360 imported_files = gypi_values.devtools_temp_storage_shared_worker_js_files |
| 361 output = "$root_out_dir/resources/inspector/temp_storage_shared_worker/TempSto
rageSharedWorker.js" |
| 362 } |
| 363 |
| 364 action("concatenated_module_descriptors") { |
| 365 script = "scripts/concatenate_module_descriptors.py" |
| 366 |
| 367 input = "front_end/common/modules.js" |
| 368 source_prereqs = [ input ] + gypi_values.devtools_module_json_files |
| 369 outputs = [ "$root_gen_dir/blink/common/modules.js" ] |
| 370 |
| 371 args = rebase_path([ input ] + outputs + gypi_values.devtools_module_json_file
s, root_build_dir) |
| 372 } |
| 373 |
| 374 action("concatenated_devtools_css") { |
| 375 script = "scripts/concatenate_css_files.py" |
| 376 |
| 377 input_page = "front_end/inspector.html" |
| 378 source_prereqs = [ input_page ] + all_devtools_files |
| 379 search_path = [ "front_end" ] |
| 380 |
| 381 outputs = [ "$root_out_dir/resources/inspector/inspector.css" ] |
| 382 |
| 383 args = [ rebase_path(input_page, root_build_dir) ] + |
| 384 rebase_path(search_path, root_build_dir) + |
| 385 rebase_path(outputs, root_build_dir) |
| 386 } |
OLD | NEW |