| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
| 6 import("//third_party/WebKit/Source/core/core.gni") | 6 import("//third_party/WebKit/Source/core/core.gni") |
| 7 | 7 |
| 8 gypi_values = exec_script("//build/gypi_to_gn.py", | 8 gypi_values = exec_script("//build/gypi_to_gn.py", |
| 9 [ rebase_path("devtools.gypi") ], | 9 [ rebase_path("devtools.gypi") ], |
| 10 "scope", | 10 "scope", |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 # FIXME: Fix the generate_devtools_grd.py script to accept trailing slashes. | 66 # FIXME: Fix the generate_devtools_grd.py script to accept trailing slashes. |
| 67 resources_out_dir_no_slash = "$root_out_dir/resources/inspector" | 67 resources_out_dir_no_slash = "$root_out_dir/resources/inspector" |
| 68 resources_out_dir = resources_out_dir_no_slash + "/" | 68 resources_out_dir = resources_out_dir_no_slash + "/" |
| 69 | 69 |
| 70 generated_scripts = [ | 70 generated_scripts = [ |
| 71 resources_out_dir + "InspectorBackendCommands.js", | 71 resources_out_dir + "InspectorBackendCommands.js", |
| 72 resources_out_dir + "SupportedCSSProperties.js", | 72 resources_out_dir + "SupportedCSSProperties.js", |
| 73 ] | 73 ] |
| 74 | 74 |
| 75 generated_entry_files = [ |
| 76 resources_out_dir + "inspector.html", |
| 77 resources_out_dir + "inspector.js", |
| 78 resources_out_dir + "toolbox.html", |
| 79 resources_out_dir + "toolbox.js", |
| 80 ] |
| 81 |
| 82 generated_workers = [ |
| 83 resources_out_dir + "formatter_worker.js", |
| 84 resources_out_dir + "heap_snapshot_worker.js", |
| 85 resources_out_dir + "temp_storage_shared_worker.js", |
| 86 ] |
| 87 |
| 88 generated_bundled_modules = [ |
| 89 resources_out_dir + "animation/animation_module.js", |
| 90 resources_out_dir + "audits/audits_module.js", |
| 91 resources_out_dir + "components_lazy/components_lazy_module.js", |
| 92 resources_out_dir + "console/console_module.js", |
| 93 resources_out_dir + "devices/devices_module.js", |
| 94 resources_out_dir + "diff/diff_module.js", |
| 95 resources_out_dir + "elements/elements_module.js", |
| 96 resources_out_dir + "es_tree/es_tree_module.js", |
| 97 resources_out_dir + "layers/layers_module.js", |
| 98 resources_out_dir + "network/network_module.js", |
| 99 resources_out_dir + "profiler/profiler_module.js", |
| 100 resources_out_dir + "resources/resources_module.js", |
| 101 resources_out_dir + "sass/sass_module.js", |
| 102 resources_out_dir + "security/security_module.js", |
| 103 resources_out_dir + "settings/settings_module.js", |
| 104 resources_out_dir + "snippets/snippets_module.js", |
| 105 resources_out_dir + "source_frame/source_frame_module.js", |
| 106 resources_out_dir + "sources/sources_module.js", |
| 107 resources_out_dir + "text_editor/text_editor_module.js", |
| 108 resources_out_dir + "timeline_model/timeline_model_module.js", |
| 109 resources_out_dir + "timeline/timeline_module.js", |
| 110 resources_out_dir + "ui_lazy/ui_lazy_module.js", |
| 111 ] |
| 112 |
| 113 generated_remote_modules = [ |
| 114 resources_out_dir + "accessibility/accessibility_module.js", |
| 115 resources_out_dir + "cm_modes/cm_modes_module.js", |
| 116 resources_out_dir + "emulated_devices/emulated_devices_module.js", |
| 117 resources_out_dir + "gonzales/gonzales_module.js", |
| 118 resources_out_dir + "screencast/screencast_module.js", |
| 119 ] |
| 120 |
| 75 #------------------------------------------------------------------------------- | 121 #------------------------------------------------------------------------------- |
| 76 | 122 |
| 77 visibility = [ "//third_party/WebKit/*" ] | 123 visibility = [ "//third_party/WebKit/*" ] |
| 78 | 124 |
| 79 group("devtools_frontend_resources") { | 125 group("devtools_frontend_resources") { |
| 80 public_deps = [ | 126 public_deps = [ |
| 81 ":build_applications", | 127 ":build_release_devtools", |
| 82 ":copy_embedder_scripts", | 128 ":copy_embedder_scripts", |
| 83 ":copy_emulated_devices_images", | 129 ":copy_emulated_devices_images", |
| 84 ":copy_inspector_images", | 130 ":copy_inspector_images", |
| 85 ":devtools_extension_api", | 131 ":devtools_extension_api", |
| 86 ":frontend_protocol_sources", | 132 ":frontend_protocol_sources", |
| 87 ":supported_css_properties", | 133 ":supported_css_properties", |
| 88 ] | 134 ] |
| 135 if (debug_devtools) { |
| 136 public_deps += [ ":build_debug_devtools" ] |
| 137 } |
| 89 } | 138 } |
| 90 | 139 |
| 91 copy("copy_embedder_scripts") { | 140 copy("copy_embedder_scripts") { |
| 92 sources = gypi_values.devtools_embedder_scripts | 141 sources = gypi_values.devtools_embedder_scripts |
| 93 outputs = [ | 142 outputs = [ |
| 94 resources_out_dir + "{{source_file_part}}", | 143 resources_out_dir + "{{source_file_part}}", |
| 95 ] | 144 ] |
| 96 } | 145 } |
| 97 | 146 |
| 98 copy("copy_inspector_images") { | 147 copy("copy_inspector_images") { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 111 | 160 |
| 112 action("generate_devtools_grd") { | 161 action("generate_devtools_grd") { |
| 113 script = "scripts/generate_devtools_grd.py" | 162 script = "scripts/generate_devtools_grd.py" |
| 114 | 163 |
| 115 deps = [ | 164 deps = [ |
| 116 ":devtools_frontend_resources", | 165 ":devtools_frontend_resources", |
| 117 ] | 166 ] |
| 118 inputs = gypi_values.devtools_image_files + all_devtools_files | 167 inputs = gypi_values.devtools_image_files + all_devtools_files |
| 119 inputs += gypi_values.devtools_embedder_scripts | 168 inputs += gypi_values.devtools_embedder_scripts |
| 120 | 169 |
| 121 if (debug_devtools) { | 170 generated_files = |
| 122 # Debug: all files are picked as-is. | 171 generated_entry_files + generated_workers + generated_bundled_modules + |
| 123 generated_files = generated_scripts + [ | 172 [ resources_out_dir + "devtools_extension_api.js" ] |
| 124 resources_out_dir + "inspector.html", | |
| 125 resources_out_dir + "toolbox.html", | |
| 126 ] | |
| 127 | |
| 128 # Use a response file since the static files can be too long for the | |
| 129 # command line. The args here will be added to the command line. | |
| 130 static_files = all_devtools_files + [ "front_end/Runtime.js" ] | |
| 131 response_file_contents = rebase_path(static_files, root_build_dir) | |
| 132 static_files_args = [ | |
| 133 "--static_files_args", | |
| 134 "{{response_file_name}}", | |
| 135 ] | |
| 136 } else { | |
| 137 # Release: pick compiled non-remote modules and concatenated app files. | |
| 138 generated_files = [ | |
| 139 resources_out_dir + "inspector.html", | |
| 140 resources_out_dir + "inspector.js", | |
| 141 resources_out_dir + "toolbox.html", | |
| 142 resources_out_dir + "toolbox.js", | |
| 143 resources_out_dir + "formatter_worker.js", | |
| 144 resources_out_dir + "heap_snapshot_worker.js", | |
| 145 resources_out_dir + "temp_storage_shared_worker.js", | |
| 146 resources_out_dir + "audits/audits_module.js", | |
| 147 resources_out_dir + "animation/animation_module.js", | |
| 148 resources_out_dir + "components_lazy/components_lazy_module.js", | |
| 149 resources_out_dir + "console/console_module.js", | |
| 150 resources_out_dir + "devices/devices_module.js", | |
| 151 resources_out_dir + "diff/diff_module.js", | |
| 152 resources_out_dir + "elements/elements_module.js", | |
| 153 resources_out_dir + "es_tree/es_tree_module.js", | |
| 154 resources_out_dir + "layers/layers_module.js", | |
| 155 resources_out_dir + "network/network_module.js", | |
| 156 resources_out_dir + "profiler/profiler_module.js", | |
| 157 resources_out_dir + "resources/resources_module.js", | |
| 158 resources_out_dir + "sass/sass_module.js", | |
| 159 resources_out_dir + "security/security_module.js", | |
| 160 resources_out_dir + "settings/settings_module.js", | |
| 161 resources_out_dir + "snippets/snippets_module.js", | |
| 162 resources_out_dir + "source_frame/source_frame_module.js", | |
| 163 resources_out_dir + "sources/sources_module.js", | |
| 164 resources_out_dir + "text_editor/text_editor_module.js", | |
| 165 resources_out_dir + "timeline_model/timeline_model_module.js", | |
| 166 resources_out_dir + "timeline/timeline_module.js", | |
| 167 resources_out_dir + "ui_lazy/ui_lazy_module.js", | |
| 168 resources_out_dir + "devtools_extension_api.js", | |
| 169 ] | |
| 170 static_files_args = [] # Nothing needed for this | |
| 171 } | |
| 172 | 173 |
| 173 images_path = "front_end/Images" | 174 images_path = "front_end/Images" |
| 174 | 175 |
| 175 inputs += generated_files | 176 inputs += generated_files |
| 176 | 177 |
| 177 outfile = "$root_gen_dir/devtools/devtools_resources.grd" | 178 outfile = "$root_gen_dir/devtools/devtools_resources.grd" |
| 178 outputs = [ | 179 outputs = [ |
| 179 outfile, | 180 outfile, |
| 180 ] | 181 ] |
| 181 | 182 |
| 182 relative_path_dirs = [ | 183 relative_path_dirs = [ |
| 183 resources_out_dir_no_slash, | 184 resources_out_dir_no_slash, |
| 184 "front_end", | 185 "front_end", |
| 185 ] | 186 ] |
| 186 | 187 |
| 187 args = rebase_path(generated_files, root_build_dir) + | 188 args = rebase_path(generated_files, root_build_dir) + |
| 188 rebase_path(generated_files, root_build_dir) + | 189 rebase_path(generated_files, root_build_dir) + |
| 189 rebase_path(gypi_values.devtools_embedder_scripts, root_build_dir) + | 190 rebase_path(gypi_values.devtools_embedder_scripts, root_build_dir) + |
| 190 static_files_args + [ "--relative_path_dirs" ] + | 191 [ "--relative_path_dirs" ] + |
| 191 rebase_path(relative_path_dirs, root_build_dir) + | 192 rebase_path(relative_path_dirs, root_build_dir) + |
| 192 [ | 193 [ |
| 193 "--images", | 194 "--images", |
| 194 rebase_path(images_path, root_build_dir), | 195 rebase_path(images_path, root_build_dir), |
| 195 "--output", | 196 "--output", |
| 196 rebase_path(outfile, root_build_dir), | 197 rebase_path(outfile, root_build_dir), |
| 197 ] | 198 ] |
| 198 } | 199 } |
| 199 | 200 |
| 200 action("devtools_extension_api") { | 201 action("devtools_extension_api") { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 outputs = [ | 236 outputs = [ |
| 236 resources_out_dir + "InspectorBackendCommands.js", | 237 resources_out_dir + "InspectorBackendCommands.js", |
| 237 ] | 238 ] |
| 238 | 239 |
| 239 args = rebase_path(inputs, root_build_dir) + [ | 240 args = rebase_path(inputs, root_build_dir) + [ |
| 240 "--output_js_dir", | 241 "--output_js_dir", |
| 241 rebase_path(resources_out_dir, root_build_dir), | 242 rebase_path(resources_out_dir, root_build_dir), |
| 242 ] | 243 ] |
| 243 } | 244 } |
| 244 | 245 |
| 245 action("build_applications") { | 246 action("build_release_devtools") { |
| 246 script = "scripts/build_applications.py" | 247 script = "scripts/build_applications.py" |
| 248 |
| 249 deps = [ |
| 250 ":frontend_protocol_sources", |
| 251 ":supported_css_properties", |
| 252 ] |
| 253 |
| 247 helper_scripts = [ | 254 helper_scripts = [ |
| 248 "scripts/modular_build.py", | 255 "scripts/modular_build.py", |
| 249 "scripts/concatenate_application_code.py", | 256 "scripts/concatenate_application_code.py", |
| 250 "scripts/rjsmin.py", | 257 "scripts/rjsmin.py", |
| 251 ] | 258 ] |
| 252 | 259 |
| 253 inputs = helper_scripts + all_devtools_files + generated_scripts + [ | 260 inputs = helper_scripts + all_devtools_files + generated_scripts + [ |
| 254 "front_end/inspector.html", | 261 "front_end/inspector.html", |
| 255 "front_end/toolbox.html", | 262 "front_end/toolbox.html", |
| 256 ] | 263 ] |
| 257 | 264 |
| 258 outputs = [ | 265 outputs = generated_entry_files + generated_workers + |
| 259 resources_out_dir + "inspector.html", | 266 generated_bundled_modules + generated_remote_modules |
| 260 resources_out_dir + "toolbox.html", | |
| 261 ] | |
| 262 | 267 |
| 263 deps = [ | 268 debug_mode = "0" |
| 264 ":frontend_protocol_sources", | |
| 265 ":supported_css_properties", | |
| 266 ] | |
| 267 | |
| 268 if (debug_devtools) { | |
| 269 deps += [ ":copy_debug_non_modules" ] | |
| 270 | |
| 271 debug_mode = "1" | |
| 272 } else { | |
| 273 outputs += [ | |
| 274 resources_out_dir + "inspector.js", | |
| 275 resources_out_dir + "toolbox.js", | |
| 276 resources_out_dir + "formatter_worker.js", | |
| 277 resources_out_dir + "heap_snapshot_worker.js", | |
| 278 resources_out_dir + "temp_storage_shared_worker.js", | |
| 279 resources_out_dir + "accessibility/accessibility_module.js", | |
| 280 resources_out_dir + "animation/animation_module.js", | |
| 281 resources_out_dir + "audits/audits_module.js", | |
| 282 resources_out_dir + "cm_modes/cm_modes_module.js", | |
| 283 resources_out_dir + "components_lazy/components_lazy_module.js", | |
| 284 resources_out_dir + "console/console_module.js", | |
| 285 resources_out_dir + "devices/devices_module.js", | |
| 286 resources_out_dir + "diff/diff_module.js", | |
| 287 resources_out_dir + "elements/elements_module.js", | |
| 288 resources_out_dir + "emulated_devices/emulated_devices_module.js", | |
| 289 resources_out_dir + "es_tree/es_tree_module.js", | |
| 290 resources_out_dir + "gonzales/gonzales_module.js", | |
| 291 resources_out_dir + "layers/layers_module.js", | |
| 292 resources_out_dir + "network/network_module.js", | |
| 293 resources_out_dir + "profiler/profiler_module.js", | |
| 294 resources_out_dir + "resources/resources_module.js", | |
| 295 resources_out_dir + "sass/sass_module.js", | |
| 296 resources_out_dir + "screencast/screencast_module.js", | |
| 297 resources_out_dir + "security/security_module.js", | |
| 298 resources_out_dir + "settings/settings_module.js", | |
| 299 resources_out_dir + "snippets/snippets_module.js", | |
| 300 resources_out_dir + "source_frame/source_frame_module.js", | |
| 301 resources_out_dir + "sources/sources_module.js", | |
| 302 resources_out_dir + "text_editor/text_editor_module.js", | |
| 303 resources_out_dir + "timeline_model/timeline_model_module.js", | |
| 304 resources_out_dir + "timeline/timeline_module.js", | |
| 305 resources_out_dir + "ui_lazy/ui_lazy_module.js", | |
| 306 ] | |
| 307 | |
| 308 debug_mode = "0" | |
| 309 } | |
| 310 | 269 |
| 311 args = [ | 270 args = [ |
| 312 "inspector", | 271 "inspector", |
| 313 "toolbox", | 272 "toolbox", |
| 314 "formatter_worker", | 273 "formatter_worker", |
| 315 "heap_snapshot_worker", | 274 "heap_snapshot_worker", |
| 316 "temp_storage_shared_worker", | 275 "temp_storage_shared_worker", |
| 317 "--input_path", | 276 "--input_path", |
| 318 rebase_path("front_end", root_build_dir), | 277 rebase_path("front_end", root_build_dir), |
| 319 "--output_path", | 278 "--output_path", |
| 320 rebase_path(resources_out_dir, root_build_dir), | 279 rebase_path(resources_out_dir, root_build_dir), |
| 321 "--debug", | 280 "--debug", |
| 322 debug_mode, | 281 debug_mode, |
| 323 ] | 282 ] |
| 324 } | 283 } |
| 325 | 284 |
| 326 if (debug_devtools) { | 285 if (debug_devtools) { |
| 327 # Debug: copy non-module directories and core into resources_out_dir as-is. | 286 resources_out_debug_dir = "$root_out_dir/resources/inspector/debug/" |
| 328 group("copy_debug_non_modules") { | 287 |
| 288 action("build_debug_devtools") { |
| 289 script = "scripts/build_applications.py" |
| 290 |
| 291 deps = [ |
| 292 ":copy_debug_files", |
| 293 ] |
| 294 |
| 295 inputs = all_devtools_files + [ |
| 296 "front_end/inspector.html", |
| 297 "front_end/toolbox.html", |
| 298 ] |
| 299 |
| 300 outputs = [ |
| 301 resources_out_debug_dir + "inspector.html", |
| 302 resources_out_debug_dir + "toolbox.html", |
| 303 ] |
| 304 |
| 305 debug_mode = "1" |
| 306 |
| 307 args = [ |
| 308 "inspector", |
| 309 "toolbox", |
| 310 "formatter_worker", |
| 311 "heap_snapshot_worker", |
| 312 "temp_storage_shared_worker", |
| 313 "--input_path", |
| 314 rebase_path("front_end", root_build_dir), |
| 315 "--output_path", |
| 316 rebase_path(resources_out_debug_dir, root_build_dir), |
| 317 "--debug", |
| 318 debug_mode, |
| 319 ] |
| 320 } |
| 321 |
| 322 group("copy_debug_files") { |
| 329 public_deps = [ | 323 public_deps = [ |
| 330 ":copy_acorn_js_files", | 324 ":copy_acorn_js_files", |
| 331 ":copy_codemirror_files", | 325 ":copy_codemirror_files", |
| 326 ":copy_emulated_devices_images_debug", |
| 327 ":copy_generated_scripts", |
| 328 ":copy_inspector_images_debug", |
| 332 ":copy_runtime_core", | 329 ":copy_runtime_core", |
| 333 ] | 330 ] |
| 334 } | 331 } |
| 335 | 332 |
| 336 copy("copy_runtime_core") { | 333 copy("copy_runtime_core") { |
| 337 sources = gypi_values.devtools_core_base_files | 334 sources = gypi_values.devtools_core_base_files |
| 338 outputs = [ | 335 outputs = [ |
| 339 resources_out_dir + "/{{source_file_part}}", | 336 resources_out_debug_dir + "/{{source_file_part}}", |
| 340 ] | 337 ] |
| 341 } | 338 } |
| 342 | 339 |
| 343 copy("copy_acorn_js_files") { | 340 copy("copy_acorn_js_files") { |
| 344 sources = gypi_values.devtools_acorn_files | 341 sources = gypi_values.devtools_acorn_files |
| 345 outputs = [ | 342 outputs = [ |
| 346 resources_out_dir + "acorn/{{source_file_part}}", | 343 resources_out_debug_dir + "acorn/{{source_file_part}}", |
| 347 ] | 344 ] |
| 348 } | 345 } |
| 349 | 346 |
| 350 copy("copy_codemirror_files") { | 347 copy("copy_codemirror_files") { |
| 351 sources = | 348 sources = |
| 352 gypi_values.devtools_cm_js_files + gypi_values.devtools_cm_css_files | 349 gypi_values.devtools_cm_js_files + gypi_values.devtools_cm_css_files |
| 353 outputs = [ | 350 outputs = [ |
| 354 resources_out_dir + "cm/{{source_file_part}}", | 351 resources_out_debug_dir + "cm/{{source_file_part}}", |
| 352 ] |
| 353 } |
| 354 |
| 355 copy("copy_generated_scripts") { |
| 356 deps = [ |
| 357 ":frontend_protocol_sources", |
| 358 ":supported_css_properties", |
| 359 ] |
| 360 sources = generated_scripts |
| 361 outputs = [ |
| 362 resources_out_debug_dir + "/{{source_file_part}}", |
| 363 ] |
| 364 } |
| 365 copy("copy_inspector_images_debug") { |
| 366 sources = gypi_values.devtools_image_files |
| 367 outputs = [ |
| 368 resources_out_debug_dir + "Images/{{source_file_part}}", |
| 369 ] |
| 370 } |
| 371 |
| 372 copy("copy_emulated_devices_images_debug") { |
| 373 sources = gypi_values.devtools_emulated_devices_images |
| 374 outputs = [ |
| 375 resources_out_debug_dir + "emulated_devices/{{source_file_part}}", |
| 355 ] | 376 ] |
| 356 } | 377 } |
| 357 } | 378 } |
| OLD | NEW |