Chromium Code Reviews| 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") | |
| 6 | |
| 7 app_names = [ | |
|
brettw
2014/09/26 18:24:12
Are we anticipating adding lots more apps here? If
apavlov
2014/09/26 19:47:06
Another app is actually pending addition (from dgo
| |
| 8 "devtools", | |
| 9 "toolbox" | |
| 10 ] | |
| 11 | |
| 5 gypi_values = exec_script( | 12 gypi_values = exec_script( |
| 6 "//build/gypi_to_gn.py", | 13 "//build/gypi_to_gn.py", |
| 7 [ rebase_path("devtools.gypi") ], | 14 [ rebase_path("devtools.gypi") ], |
| 8 "scope", | 15 "scope", |
| 9 [ "devtools.gypi" ]) | 16 [ "devtools.gypi" ]) |
| 10 | 17 |
| 11 # Some of the files in the .gypi use GYP variable expansions, go through and | 18 # Some of the files in the .gypi use GYP variable expansions, go through and |
| 12 # fix them. | 19 # fix them. |
| 13 devtools_core_base_files = gypi_values.devtools_core_base_files - [ | 20 devtools_core_base_files = gypi_values.devtools_core_base_files - [ |
| 14 "<@(devtools_standalone_files)", | 21 "<@(devtools_standalone_files)", |
| 15 ] + gypi_values.devtools_standalone_files | 22 ] + gypi_values.devtools_standalone_files |
| 16 | 23 |
| 17 devtools_core_files = | 24 devtools_core_files = |
| 18 devtools_core_base_files + | 25 devtools_core_base_files + |
| 19 gypi_values.devtools_bindings_js_files + | 26 gypi_values.devtools_bindings_js_files + |
| 20 gypi_values.devtools_common_js_files + | 27 gypi_values.devtools_common_js_files + |
| 21 gypi_values.devtools_components_js_files + | 28 gypi_values.devtools_components_js_files + |
| 22 gypi_values.devtools_host_js_files + | 29 gypi_values.devtools_host_js_files + |
| 23 gypi_values.devtools_main_js_files + | 30 gypi_values.devtools_main_js_files + |
| 24 gypi_values.devtools_sdk_js_files + | 31 gypi_values.devtools_sdk_js_files + |
| 25 gypi_values.devtools_screencast_js_files + | 32 gypi_values.devtools_screencast_js_files + |
| 33 gypi_values.devtools_sdk_js_files + | |
|
dgozman
2014/09/26 15:35:37
sdk duplicated
apavlov
2014/09/26 19:47:07
Thanks, it's a bad rebase
| |
| 26 gypi_values.devtools_toolbox_js_files + | 34 gypi_values.devtools_toolbox_js_files + |
| 27 gypi_values.devtools_toolbox_bootstrap_js_files + | 35 gypi_values.devtools_toolbox_bootstrap_js_files + |
| 28 gypi_values.devtools_ui_js_files + | 36 gypi_values.devtools_ui_js_files + |
| 29 gypi_values.devtools_workspace_js_files | 37 gypi_values.devtools_workspace_js_files |
| 30 | 38 |
| 31 devtools_extensions_js_files = gypi_values.devtools_extensions_js_files - | 39 devtools_extensions_js_files = gypi_values.devtools_extensions_js_files - |
| 32 [ "<@(devtools_extension_api_files)" ] + | 40 [ "<@(devtools_extension_api_files)" ] + |
| 33 gypi_values.devtools_extension_api_files | 41 gypi_values.devtools_extension_api_files |
| 34 | 42 |
| 43 if (debug_devtools) { | |
| 44 # Adding a new <module_name> here requires | |
| 45 # a new ":build_<module_name>_module" target. | |
| 46 core_modules = [ | |
| 47 "bindings", | |
| 48 "common", | |
| 49 "components", | |
| 50 "host", | |
| 51 "main", | |
| 52 "screencast", | |
| 53 "sdk", | |
| 54 "toolbox", | |
| 55 "toolbox_bootstrap", | |
| 56 "ui", | |
| 57 "workspace", | |
| 58 ] | |
| 59 | |
| 60 devtools_modules_js_files = | |
| 61 gypi_values.devtools_audits_js_files + | |
| 62 gypi_values.devtools_console_js_files + | |
| 63 gypi_values.devtools_devices_js_files + | |
| 64 gypi_values.devtools_documentation_js_files + | |
| 65 gypi_values.devtools_elements_js_files + | |
| 66 devtools_extensions_js_files + | |
| 67 gypi_values.devtools_heap_snapshot_worker_js_files + | |
| 68 gypi_values.devtools_layers_js_files + | |
| 69 gypi_values.devtools_network_js_files + | |
| 70 gypi_values.devtools_profiler_js_files + | |
| 71 gypi_values.devtools_promises_js_files + | |
| 72 gypi_values.devtools_resources_js_files + | |
| 73 gypi_values.devtools_script_formatter_worker_js_files + | |
| 74 gypi_values.devtools_settings_js_files + | |
| 75 gypi_values.devtools_source_frame_js_files + | |
| 76 gypi_values.devtools_sources_js_files + | |
| 77 gypi_values.devtools_temp_storage_shared_worker_js_files + | |
| 78 gypi_values.devtools_timeline_js_files | |
| 79 | |
| 80 all_devtools_files = | |
| 81 gypi_values.devtools_cm_css_files + | |
| 82 gypi_values.devtools_cm_js_files + | |
| 83 devtools_core_files + | |
| 84 gypi_values.devtools_module_json_files + | |
| 85 devtools_modules_js_files + | |
| 86 gypi_values.devtools_uglify_files | |
| 87 } | |
| 88 | |
| 35 #------------------------------------------------------------------------------- | 89 #------------------------------------------------------------------------------- |
| 36 | 90 |
| 37 visibility = [ "//third_party/WebKit/*" ] | 91 visibility = [ "//third_party/WebKit/*" ] |
| 38 | 92 |
| 39 # Probably need to parameterize this. If we set it to true, there will be some | |
| 40 # further work in the scripts below. | |
| 41 debug_devtools = false | |
| 42 | |
| 43 group("devtools_frontend_resources") { | 93 group("devtools_frontend_resources") { |
| 44 deps = [ | 94 deps = [ |
| 95 ":app_htmls", | |
| 45 ":copy_inspector_images", | 96 ":copy_inspector_images", |
| 46 ":devtools_html", | |
| 47 ":toolbox_html", | |
| 48 ":frontend_protocol_sources", | 97 ":frontend_protocol_sources", |
| 49 ":supported_css_properties", | 98 ":supported_css_properties", |
| 50 ":build_applications", | 99 ":build_applications", |
| 51 ] | 100 ] |
| 52 | 101 |
| 53 if (!debug_devtools) { | 102 if (!debug_devtools) { |
| 54 deps += [ | 103 foreach(app, app_names) { |
| 55 ":concatenated_devtools_css", | 104 deps += [ ":concatenated_" + app + "_css" ] |
| 56 ":concatenated_toolbox_css", | 105 } |
| 57 ] | |
| 58 } | 106 } |
| 59 } | 107 } |
| 60 | 108 |
| 109 # FIXME: Fix the generate_devtools_grd.py script to accept trailing slashes. | |
| 110 resources_out_dir_no_slash = "$root_out_dir/resources/inspector" | |
| 111 resources_out_dir = resources_out_dir_no_slash + "/" | |
| 112 | |
| 61 copy("copy_inspector_images") { | 113 copy("copy_inspector_images") { |
| 62 sources = gypi_values.devtools_image_files | 114 sources = gypi_values.devtools_image_files |
| 63 outputs = [ "$root_out_dir/resources/inspector/Images/{{source_file_part}}" ] | 115 outputs = [ resources_out_dir + "Images/{{source_file_part}}" ] |
| 64 } | 116 } |
| 65 | 117 |
| 66 # TODO(GYP) need debug_devtools support (this runs somewhat differently). | |
| 67 action("generate_devtools_grd") { | 118 action("generate_devtools_grd") { |
| 68 script = "scripts/generate_devtools_grd.py" | 119 script = "scripts/generate_devtools_grd.py" |
| 69 | 120 |
| 70 input_pages = [ | 121 if (debug_devtools) { |
| 71 "$root_out_dir/resources/inspector/devtools.css", | 122 input_pages = all_devtools_files + [ |
| 72 "$root_out_dir/resources/inspector/devtools.html", | 123 "front_end/Runtime.js", |
| 73 "$root_out_dir/resources/inspector/devtools.js", | 124 resources_out_dir + "InspectorBackendCommands.js", |
| 74 "$root_out_dir/resources/inspector/toolbox.css", | 125 resources_out_dir + "SupportedCSSProperties.js", |
| 75 "$root_out_dir/resources/inspector/toolbox.html", | 126 ] |
| 76 "$root_out_dir/resources/inspector/toolbox.js", | 127 foreach(app, app_names) { |
| 77 "$root_out_dir/resources/inspector/audits_module.js", | 128 input_pages += [ |
| 78 "$root_out_dir/resources/inspector/console_module.js", | 129 resources_out_dir + app + ".html", |
| 79 "$root_out_dir/resources/inspector/devices_module.js", | 130 ] |
| 80 "$root_out_dir/resources/inspector/documentation_module.js", | 131 } |
| 81 "$root_out_dir/resources/inspector/elements_module.js", | 132 } else { |
| 82 "$root_out_dir/resources/inspector/extensions_module.js", | 133 input_pages = [ |
| 83 "$root_out_dir/resources/inspector/heap_snapshot_worker_module.js", | 134 resources_out_dir + "audits_module.js", |
| 84 "$root_out_dir/resources/inspector/layers_module.js", | 135 resources_out_dir + "console_module.js", |
| 85 "$root_out_dir/resources/inspector/network_module.js", | 136 resources_out_dir + "devices_module.js", |
| 86 "$root_out_dir/resources/inspector/profiler_module.js", | 137 resources_out_dir + "documentation_module.js", |
| 87 "$root_out_dir/resources/inspector/promises_module.js", | 138 resources_out_dir + "elements_module.js", |
| 88 "$root_out_dir/resources/inspector/resources_module.js", | 139 resources_out_dir + "extensions_module.js", |
| 89 "$root_out_dir/resources/inspector/script_formatter_worker_module.js", | 140 resources_out_dir + "heap_snapshot_worker_module.js", |
| 90 "$root_out_dir/resources/inspector/settings_module.js", | 141 resources_out_dir + "layers_module.js", |
| 91 "$root_out_dir/resources/inspector/source_frame_module.js", | 142 resources_out_dir + "network_module.js", |
| 92 "$root_out_dir/resources/inspector/sources_module.js", | 143 resources_out_dir + "profiler_module.js", |
| 93 "$root_out_dir/resources/inspector/temp_storage_shared_worker_module.js", | 144 resources_out_dir + "promises_module.js", |
| 94 "$root_out_dir/resources/inspector/timeline_module.js", | 145 resources_out_dir + "resources_module.js", |
| 95 "$root_out_dir/resources/inspector/devtools_extension_api.js", | 146 resources_out_dir + "script_formatter_worker_module.js", |
| 96 ] + gypi_values.devtools_standalone_files + gypi_values.devtools_cm_css_files | 147 resources_out_dir + "settings_module.js", |
| 148 resources_out_dir + "source_frame_module.js", | |
| 149 resources_out_dir + "sources_module.js", | |
| 150 resources_out_dir + "temp_storage_shared_worker_module.js", | |
| 151 resources_out_dir + "timeline_module.js", | |
| 152 resources_out_dir + "devtools_extension_api.js", | |
| 153 ] | |
| 154 input_pages += gypi_values.devtools_standalone_files + | |
| 155 gypi_values.devtools_cm_css_files | |
| 156 | |
| 157 foreach(app, app_names) { | |
| 158 input_pages += [ | |
| 159 resources_out_dir + app + ".css", | |
| 160 resources_out_dir + app + ".html", | |
| 161 resources_out_dir + app + ".js", | |
| 162 ] | |
| 163 } | |
| 164 } | |
| 97 | 165 |
| 98 images = gypi_values.devtools_image_files | 166 images = gypi_values.devtools_image_files |
| 99 images_path = "front_end/Images" | 167 images_path = "front_end/Images" |
| 100 | 168 |
| 101 inputs = input_pages + images | 169 inputs = input_pages + images |
| 102 | 170 |
| 103 outfile = "$root_gen_dir/devtools/devtools_resources.grd" | 171 outfile = "$root_gen_dir/devtools/devtools_resources.grd" |
| 104 outputs = [ outfile ] | 172 outputs = [ outfile ] |
| 105 | 173 |
| 106 relative_path_dirs = [ | 174 relative_path_dirs = [ |
| 107 "$root_out_dir/resources/inspector", | 175 resources_out_dir_no_slash, |
| 108 "front_end", | 176 "front_end", |
| 109 ] | 177 ] |
| 110 | 178 |
| 111 args = rebase_path(input_pages, root_build_dir) + [ | 179 args = rebase_path(input_pages, root_build_dir) + [ |
| 112 "--relative_path_dirs" ] + | 180 "--relative_path_dirs" ] + |
| 113 rebase_path(relative_path_dirs, root_build_dir) + [ | 181 rebase_path(relative_path_dirs, root_build_dir) + [ |
| 114 "--images", rebase_path(images_path, root_build_dir), | 182 "--images", rebase_path(images_path, root_build_dir), |
| 115 "--output", rebase_path(outfile, root_build_dir), | 183 "--output", rebase_path(outfile, root_build_dir), |
| 116 ] | 184 ] |
| 117 | 185 |
| 118 deps = [ | 186 # Only :devtools_frontend_resources is required for !debug_devtools mode. |
| 119 ":devtools_html", | 187 deps = [ ":devtools_frontend_resources" ] |
| 120 ":toolbox_html", | 188 |
| 121 ":devtools_extension_api", | 189 if (debug_devtools) { |
| 122 ":devtools_frontend_resources", | 190 deps += [ |
| 123 ] | 191 ":app_htmls", |
| 192 ":devtools_extension_api", | |
| 193 ] | |
| 194 } | |
| 124 } | 195 } |
| 125 | 196 |
| 126 template("generate_app_html") { | 197 template("generate_app_html") { |
| 127 assert(defined(invoker.app_name), target_name) | 198 assert(defined(invoker.app_name), target_name) |
| 199 app_name = invoker.app_name | |
| 128 | 200 |
| 129 action(target_name) { | 201 action(target_name) { |
| 130 script = "scripts/generate_devtools_html.py" | 202 script = "scripts/generate_devtools_html.py" |
| 131 | 203 |
| 132 inputs = [ "front_end/" + invoker.app_name + ".html"] | 204 inputs = [ "front_end/" + app_name + ".html"] |
| 133 outputs = [ | 205 outputs = [ resources_out_dir + app_name + ".html" ] |
| 134 "$root_out_dir/resources/inspector/" + invoker.app_name + ".html" | |
| 135 ] | |
| 136 | 206 |
| 137 args = rebase_path(inputs, root_build_dir) + | 207 args = rebase_path(inputs, root_build_dir) + |
| 138 rebase_path(outputs, root_build_dir) | 208 rebase_path(outputs, root_build_dir) |
| 139 | 209 |
| 140 if (debug_devtools) { | 210 if (debug_devtools) { |
| 141 args += [ "1" ] | 211 args += [ "1" ] |
| 142 } else { | 212 } else { |
| 143 args += [ "0" ] | 213 args += [ "0" ] |
| 144 } | 214 } |
| 145 } | 215 } |
| 146 } | 216 } |
| 147 | 217 |
| 148 generate_app_html("devtools_html") { | 218 foreach(app, app_names) { |
| 149 app_name = "devtools" | 219 generate_app_html(app + "_html") { |
| 150 } | 220 app_name = app |
| 151 | 221 } |
| 152 generate_app_html("toolbox_html") { | |
| 153 app_name = "toolbox" | |
| 154 } | 222 } |
| 155 | 223 |
| 156 action("devtools_extension_api") { | 224 action("devtools_extension_api") { |
| 157 script = "scripts/generate_devtools_extension_api.py" | 225 script = "scripts/generate_devtools_extension_api.py" |
| 158 | 226 |
| 159 inputs = gypi_values.devtools_extension_api_files | 227 inputs = gypi_values.devtools_extension_api_files |
| 160 outputs = [ "$root_out_dir/resources/inspector/devtools_extension_api.js" ] | 228 outputs = [ resources_out_dir + "devtools_extension_api.js" ] |
| 161 | 229 |
| 162 args = rebase_path(outputs, root_build_dir) + | 230 args = rebase_path(outputs, root_build_dir) + |
| 163 rebase_path(gypi_values.devtools_extension_api_files, root_build_dir) | 231 rebase_path(gypi_values.devtools_extension_api_files, root_build_dir) |
| 164 } | 232 } |
| 165 | 233 |
| 166 action("supported_css_properties") { | 234 action("supported_css_properties") { |
| 167 script = "scripts/generate_supported_css.py" | 235 script = "scripts/generate_supported_css.py" |
| 168 | 236 |
| 169 inputs = [ | 237 inputs = [ "../core/css/CSSProperties.in" ] |
| 170 "../core/css/CSSProperties.in", | |
| 171 ] | |
| 172 | 238 |
| 173 outputs = [ | 239 outputs = [ resources_out_dir + "SupportedCSSProperties.js" ] |
| 174 "$root_out_dir/resources/inspector/SupportedCSSProperties.js" | |
| 175 ] | |
| 176 | 240 |
| 177 args = rebase_path(inputs, root_build_dir) + | 241 args = rebase_path(inputs, root_build_dir) + |
| 178 rebase_path(outputs, root_build_dir) | 242 rebase_path(outputs, root_build_dir) |
| 179 } | 243 } |
| 180 | 244 |
| 181 action("frontend_protocol_sources") { | 245 action("frontend_protocol_sources") { |
| 182 script = "scripts/CodeGeneratorFrontend.py" | 246 script = "scripts/CodeGeneratorFrontend.py" |
| 183 | 247 |
| 184 inputs = [ "protocol.json" ] | 248 inputs = [ "protocol.json" ] |
| 185 outputs = [ "$root_out_dir/resources/inspector/InspectorBackendCommands.js" ] | 249 outputs = [ resources_out_dir + "InspectorBackendCommands.js" ] |
| 186 | 250 |
| 187 args = rebase_path(inputs, root_build_dir) + [ | 251 args = rebase_path(inputs, root_build_dir) + [ |
| 188 "--output_js_dir", | 252 "--output_js_dir", |
| 189 rebase_path("$root_out_dir/resources/inspector", root_build_dir), | 253 rebase_path(resources_out_dir, root_build_dir), |
| 190 ] | 254 ] |
| 191 } | 255 } |
| 192 | 256 |
| 193 action("build_applications") { | 257 group("build_modules") { |
| 194 script = "scripts/build_applications.py" | |
| 195 helper_scripts = [ | |
| 196 "scripts/modular_build.py", | |
| 197 "scripts/concatenate_application_code.py", | |
| 198 ] | |
| 199 | |
| 200 app_descriptor_names = [ | |
| 201 "front_end/devtools.json", | |
| 202 "front_end/toolbox.json", | |
| 203 ] | |
| 204 | |
| 205 app_loader_names = [ | |
| 206 "front_end/devtools.js", | |
| 207 "front_end/toolbox.js", | |
| 208 ] | |
| 209 | |
| 210 generated_inputs = [ | |
| 211 "$root_out_dir/resources/inspector/Runtime.js", | |
| 212 "$root_out_dir/resources/inspector/InspectorBackendCommands.js", | |
| 213 "$root_out_dir/resources/inspector/SupportedCSSProperties.js", | |
| 214 ] | |
| 215 | |
| 216 inputs = | |
| 217 helper_scripts + app_descriptor_names + app_loader_names + | |
| 218 devtools_core_files + gypi_values.devtools_module_json_files + | |
| 219 generated_inputs | |
| 220 | |
| 221 output_path = "$root_out_dir/resources/inspector/" | |
| 222 outputs = [ | |
| 223 output_path + "devtools.js", | |
| 224 output_path + "toolbox.js", | |
| 225 output_path + "heap_snapshot_worker/heap_snapshot_worker.js", | |
| 226 output_path + "temp_storage_shared_worker/temp_storage_shared_worker.js", | |
| 227 output_path + "script_formatter_worker/script_formatter_worker.js", | |
| 228 ] | |
| 229 | |
| 230 if (debug_devtools) { | |
| 231 debug_flag = "1" | |
| 232 } else { | |
| 233 debug_flag = "0" | |
| 234 } | |
| 235 | |
| 236 app_names = [ | |
| 237 "devtools", | |
| 238 "toolbox" | |
| 239 ] | |
| 240 | |
| 241 args = app_names + [ | |
| 242 "--input_path", rebase_path("front_end", root_build_dir), | |
| 243 "--output_path", rebase_path(output_path, root_build_dir), | |
| 244 "--debug", debug_flag | |
| 245 ] | |
| 246 | |
| 247 deps = [ | 258 deps = [ |
| 248 ":build_audits_module", | 259 ":build_audits_module", |
| 249 ":build_console_module", | 260 ":build_console_module", |
| 250 ":build_devices_module", | 261 ":build_devices_module", |
| 251 ":build_documentation_module", | 262 ":build_documentation_module", |
| 252 ":build_elements_module", | 263 ":build_elements_module", |
| 253 ":build_extensions_module", | 264 ":build_extensions_module", |
| 254 ":build_heap_snapshot_worker_module", | 265 ":build_heap_snapshot_worker_module", |
| 255 ":build_layers_module", | 266 ":build_layers_module", |
| 256 ":build_network_module", | 267 ":build_network_module", |
| 257 ":build_profiler_module", | 268 ":build_profiler_module", |
| 258 ":build_promises_module", | 269 ":build_promises_module", |
| 259 ":build_resources_module", | 270 ":build_resources_module", |
| 260 ":build_script_formatter_worker_module", | 271 ":build_script_formatter_worker_module", |
| 261 ":build_settings_module", | 272 ":build_settings_module", |
| 262 ":build_source_frame_module", | 273 ":build_source_frame_module", |
| 263 ":build_sources_module", | 274 ":build_sources_module", |
| 264 ":build_temp_storage_shared_worker_module", | 275 ":build_temp_storage_shared_worker_module", |
| 265 ":build_timeline_module", | 276 ":build_timeline_module", |
| 266 ] | 277 ] |
| 267 | 278 |
| 279 if (debug_devtools) { | |
| 280 foreach(module_name, core_modules) { | |
| 281 deps += [ | |
| 282 ":build_" + module_name + "_module", | |
| 283 ] | |
| 284 } | |
| 285 | |
| 286 copy("copy_runtime_core") { | |
| 287 sources = devtools_core_base_files | |
| 288 outputs = [ resources_out_dir + "/{{source_file_part}}" ] | |
| 289 } | |
| 290 deps += [ ":copy_runtime_core" ] | |
| 291 } | |
| 292 } | |
| 293 | |
| 294 group("build_applications") { | |
| 295 deps = [ ":build_modules" ] | |
| 296 | |
| 268 if (!debug_devtools) { | 297 if (!debug_devtools) { |
| 269 deps += [ | 298 # Required for !debug_devtools mode only. |
| 270 ":devtools_html", | 299 action("build_applications_release") { |
| 271 ":toolbox_html", | 300 script = "scripts/build_applications.py" |
| 272 ":supported_css_properties", | 301 helper_scripts = [ |
| 273 ":frontend_protocol_sources", | 302 "scripts/modular_build.py", |
| 274 ":concatenated_module_descriptors", | 303 "scripts/concatenate_application_code.py", |
| 275 ] | 304 ] |
| 276 } | 305 |
| 277 } | 306 app_descriptor_names = [] |
| 278 | 307 app_loader_names = [] |
| 279 # Runs the concatenate_module_scripts script. | 308 |
| 309 outputs = [] | |
| 310 | |
| 311 foreach(app, app_names) { | |
| 312 app_descriptor_names += [ "front_end/" + app + ".json" ] | |
| 313 app_loader_names += [ "front_end/" + app + ".js" ] | |
| 314 outputs += [ resources_out_dir + app + ".js" ] | |
| 315 } | |
| 316 | |
| 317 generated_inputs = [ | |
| 318 resources_out_dir + "Runtime.js", | |
| 319 resources_out_dir + "InspectorBackendCommands.js", | |
| 320 resources_out_dir + "SupportedCSSProperties.js", | |
| 321 ] | |
| 322 | |
| 323 inputs = | |
| 324 helper_scripts + app_descriptor_names + app_loader_names + | |
| 325 devtools_core_files + gypi_values.devtools_module_json_files + | |
| 326 generated_inputs | |
| 327 | |
| 328 outputs += [ | |
| 329 resources_out_dir + "heap_snapshot_worker/heap_snapshot_worker.js", | |
| 330 resources_out_dir + | |
| 331 "temp_storage_shared_worker/temp_storage_shared_worker.js", | |
| 332 resources_out_dir + | |
| 333 "script_formatter_worker/script_formatter_worker.js", | |
| 334 ] | |
| 335 | |
| 336 args = app_names + [ | |
| 337 "--input_path", rebase_path("front_end", root_build_dir), | |
| 338 "--output_path", rebase_path(resources_out_dir, root_build_dir), | |
| 339 "--debug", "1" | |
| 340 ] | |
| 341 | |
| 342 deps += [ | |
| 343 ":app_htmls", | |
| 344 ":supported_css_properties", | |
| 345 ":frontend_protocol_sources", | |
| 346 ":concatenated_module_descriptors", | |
| 347 ] | |
| 348 } | |
| 349 } | |
| 350 } | |
| 351 | |
| 352 group("app_htmls") { | |
| 353 deps = [] | |
| 354 | |
| 355 foreach(app, app_names) { | |
| 356 deps += [ ":" + app + "_html" ] | |
| 357 } | |
| 358 } | |
| 359 | |
| 360 # Runs the build_module script. | |
| 280 # module_name: (String) The JS module name to process. | 361 # module_name: (String) The JS module name to process. |
| 281 # imported_files: (List of strings) The list of files the input depends on. | 362 # imported_files: (List of strings) The list of files the input depends on. |
| 282 template("concatenate_module_scripts") { | 363 template("build_module") { |
| 283 assert(defined(invoker.module_name), target_name) | 364 assert(defined(invoker.module_name), target_name) |
| 284 assert(defined(invoker.imported_files), target_name) | 365 assert(defined(invoker.imported_files), target_name) |
| 285 | 366 |
| 286 action(target_name) { | 367 imported_files = invoker.imported_files |
| 287 script = "scripts/concatenate_module_scripts.py" | 368 module_name = invoker.module_name |
| 288 module_name = invoker.module_name | 369 module_json = "front_end/" + module_name + "/module.json" |
| 289 | 370 |
| 290 input = "front_end/" + module_name + "/module.json" | 371 if (debug_devtools) { |
| 291 inputs = [ input ] + invoker.imported_files | 372 copy(target_name) { |
| 292 | 373 sources = [ module_json ] + imported_files |
| 293 output = "$root_out_dir/resources/inspector/" + module_name + "_module.js" | 374 outputs = [ resources_out_dir + module_name + "/{{source_file_part}}" ] |
| 294 outputs = [ output ] | 375 } |
| 295 | 376 } else { |
| 296 args = [ | 377 action(target_name) { |
| 297 rebase_path(input, root_build_dir), | 378 script = "scripts/concatenate_module_scripts.py" |
| 298 rebase_path(output, root_build_dir), | 379 |
| 299 ] | 380 inputs = [ module_json ] + imported_files |
| 300 } | 381 |
| 301 } | 382 output = resources_out_dir + module_name + "_module.js" |
| 302 | 383 outputs = [ output ] |
| 303 concatenate_module_scripts("build_audits_module") { | 384 |
| 385 args = [ | |
| 386 rebase_path(module_json, root_build_dir), | |
| 387 rebase_path(output, root_build_dir), | |
| 388 ] | |
| 389 } | |
| 390 } | |
| 391 } | |
| 392 | |
| 393 build_module("build_audits_module") { | |
| 304 module_name = "audits" | 394 module_name = "audits" |
| 305 imported_files = gypi_values.devtools_audits_js_files | 395 imported_files = gypi_values.devtools_audits_js_files |
| 306 } | 396 } |
| 307 | 397 |
| 308 concatenate_module_scripts("build_console_module") { | 398 build_module("build_console_module") { |
| 309 module_name = "console" | 399 module_name = "console" |
| 310 imported_files = gypi_values.devtools_console_js_files | 400 imported_files = gypi_values.devtools_console_js_files |
| 311 } | 401 } |
| 312 | 402 |
| 313 concatenate_module_scripts("build_devices_module") { | 403 build_module("build_devices_module") { |
| 314 module_name = "devices" | 404 module_name = "devices" |
| 315 imported_files = gypi_values.devtools_devices_js_files | 405 imported_files = gypi_values.devtools_devices_js_files |
| 316 } | 406 } |
| 317 | 407 |
| 318 concatenate_module_scripts("build_documentation_module") { | 408 build_module("build_documentation_module") { |
| 319 module_name = "documentation" | 409 module_name = "documentation" |
| 320 imported_files = gypi_values.devtools_documentation_js_files | 410 imported_files = gypi_values.devtools_documentation_js_files |
| 321 } | 411 } |
| 322 | 412 |
| 323 concatenate_module_scripts("build_elements_module") { | 413 build_module("build_elements_module") { |
| 324 module_name = "elements" | 414 module_name = "elements" |
| 325 imported_files = gypi_values.devtools_elements_js_files | 415 imported_files = gypi_values.devtools_elements_js_files |
| 326 } | 416 } |
| 327 | 417 |
| 328 concatenate_module_scripts("build_extensions_module") { | 418 build_module("build_extensions_module") { |
| 329 module_name = "extensions" | 419 module_name = "extensions" |
| 330 imported_files = devtools_extensions_js_files | 420 imported_files = devtools_extensions_js_files |
| 331 } | 421 } |
| 332 | 422 |
| 333 concatenate_module_scripts("build_heap_snapshot_worker_module") { | 423 build_module("build_heap_snapshot_worker_module") { |
| 334 module_name = "heap_snapshot_worker" | 424 module_name = "heap_snapshot_worker" |
| 335 imported_files = gypi_values.devtools_heap_snapshot_worker_js_files | 425 imported_files = gypi_values.devtools_heap_snapshot_worker_js_files |
| 336 } | 426 } |
| 337 | 427 |
| 338 concatenate_module_scripts("build_layers_module") { | 428 build_module("build_layers_module") { |
| 339 module_name = "layers" | 429 module_name = "layers" |
| 340 imported_files = gypi_values.devtools_layers_js_files | 430 imported_files = gypi_values.devtools_layers_js_files |
| 341 } | 431 } |
| 342 | 432 |
| 343 concatenate_module_scripts("build_network_module") { | 433 build_module("build_network_module") { |
| 344 module_name = "network" | 434 module_name = "network" |
| 345 imported_files = gypi_values.devtools_network_js_files | 435 imported_files = gypi_values.devtools_network_js_files |
| 346 } | 436 } |
| 347 | 437 |
| 348 concatenate_module_scripts("build_profiler_module") { | 438 build_module("build_profiler_module") { |
| 349 module_name = "profiler" | 439 module_name = "profiler" |
| 350 imported_files = gypi_values.devtools_profiler_js_files | 440 imported_files = gypi_values.devtools_profiler_js_files |
| 351 } | 441 } |
| 352 | 442 |
| 353 concatenate_module_scripts("build_promises_module") { | 443 build_module("build_promises_module") { |
| 354 module_name = "promises" | 444 module_name = "promises" |
| 355 imported_files = gypi_values.devtools_promises_js_files | 445 imported_files = gypi_values.devtools_promises_js_files |
| 356 } | 446 } |
| 357 | 447 |
| 358 concatenate_module_scripts("build_resources_module") { | 448 build_module("build_resources_module") { |
| 359 module_name = "resources" | 449 module_name = "resources" |
| 360 imported_files = gypi_values.devtools_resources_js_files | 450 imported_files = gypi_values.devtools_resources_js_files |
| 361 } | 451 } |
| 362 | 452 |
| 363 concatenate_module_scripts("build_script_formatter_worker_module") { | 453 group("build_script_formatter_worker_module") { |
| 364 module_name = "script_formatter_worker" | 454 build_module("build_script_formatter_worker_module_base") { |
| 365 imported_files = gypi_values.devtools_uglify_files + | 455 module_name = "script_formatter_worker" |
| 366 gypi_values.devtools_script_formatter_worker_js_files | 456 imported_files = gypi_values.devtools_uglify_files + |
| 367 } | 457 gypi_values.devtools_script_formatter_worker_js_files |
| 368 | 458 } |
| 369 concatenate_module_scripts("build_settings_module") { | 459 |
| 460 # Required for debug_devtools mode only. | |
| 461 copy("copy_uglify_js_files") { | |
| 462 sources = gypi_values.devtools_uglify_files | |
| 463 outputs = [ resources_out_dir + "UglifyJS/{{source_file_part}}" ] | |
| 464 } | |
| 465 | |
| 466 deps = [ | |
| 467 ":build_script_formatter_worker_module_base", | |
| 468 ":copy_uglify_js_files" | |
| 469 ] | |
| 470 } | |
| 471 | |
| 472 build_module("build_settings_module") { | |
| 370 module_name = "settings" | 473 module_name = "settings" |
| 371 imported_files = gypi_values.devtools_settings_js_files | 474 imported_files = gypi_values.devtools_settings_js_files |
| 372 } | 475 } |
| 373 | 476 |
| 374 group("build_source_frame_module") { | 477 group("build_source_frame_module") { |
| 375 concatenate_module_scripts("concatenate_source_frame_module") { | 478 build_module("build_source_frame_module_base") { |
| 376 module_name = "source_frame" | 479 module_name = "source_frame" |
| 377 imported_files = gypi_values.devtools_source_frame_js_files + | 480 imported_files = gypi_values.devtools_source_frame_js_files |
| 378 gypi_values.devtools_cm_js_files | 481 # if (!debug_devtools) { |
| 482 imported_files += gypi_values.devtools_cm_js_files | |
| 483 # } | |
| 379 } | 484 } |
| 380 | 485 |
| 381 copy("copy_codemirror_files") { | 486 copy("copy_codemirror_files") { |
| 382 sources = gypi_values.devtools_cm_css_files | 487 sources = gypi_values.devtools_cm_css_files |
| 383 outputs = [ "$root_out_dir/resources/inspector/cm/{{source_file_part}}" ] | 488 # if (debug_devtools) { |
| 489 sources += gypi_values.devtools_cm_js_files | |
| 490 # } | |
| 491 outputs = [ resources_out_dir + "cm/{{source_file_part}}" ] | |
| 384 } | 492 } |
| 385 | 493 |
| 386 deps = [ | 494 deps = [ |
| 387 ":concatenate_source_frame_module", | 495 ":build_source_frame_module_base", |
| 388 ":copy_codemirror_files", | 496 ":copy_codemirror_files", |
| 389 ] | 497 ] |
| 390 } | 498 } |
| 391 | 499 |
| 392 concatenate_module_scripts("build_sources_module") { | 500 build_module("build_sources_module") { |
| 393 module_name = "sources" | 501 module_name = "sources" |
| 394 imported_files = gypi_values.devtools_sources_js_files | 502 imported_files = gypi_values.devtools_sources_js_files |
| 395 } | 503 } |
| 396 | 504 |
| 397 concatenate_module_scripts("build_temp_storage_shared_worker_module") { | 505 build_module("build_temp_storage_shared_worker_module") { |
| 398 module_name = "temp_storage_shared_worker" | 506 module_name = "temp_storage_shared_worker" |
| 399 imported_files = gypi_values.devtools_temp_storage_shared_worker_js_files | 507 imported_files = gypi_values.devtools_temp_storage_shared_worker_js_files |
| 400 } | 508 } |
| 401 | 509 |
| 402 concatenate_module_scripts("build_timeline_module") { | 510 build_module("build_timeline_module") { |
| 403 module_name = "timeline" | 511 module_name = "timeline" |
| 404 imported_files = gypi_values.devtools_timeline_js_files | 512 imported_files = gypi_values.devtools_timeline_js_files |
| 405 } | 513 } |
| 406 | 514 |
| 407 action("concatenated_module_descriptors") { | 515 if (debug_devtools) { |
| 408 script = "scripts/concatenate_module_descriptors.py" | 516 build_module("build_common_module") { |
| 409 | 517 module_name = "common" |
| 410 input = "front_end/Runtime.js" | 518 imported_files = gypi_values.devtools_common_js_files |
| 411 inputs = [ input ] + gypi_values.devtools_module_json_files | 519 } |
| 412 outputs = [ "$root_out_dir/resources/inspector/Runtime.js" ] | 520 |
| 413 | 521 build_module("build_host_module") { |
| 414 args = rebase_path([ input ] + outputs + | 522 module_name = "host" |
| 415 gypi_values.devtools_module_json_files, root_build_dir) | 523 imported_files = gypi_values.devtools_host_js_files |
| 416 } | 524 } |
| 417 | 525 |
| 418 template("concatenate_css") { | 526 build_module("build_sdk_module") { |
| 419 assert(defined(invoker.app_name), target_name) | 527 module_name = "sdk" |
| 420 | 528 imported_files = gypi_values.devtools_sdk_js_files |
| 421 action(target_name) { | 529 } |
| 422 script = "scripts/concatenate_css_files.py" | 530 |
| 423 | 531 build_module("build_ui_module") { |
| 424 input_stylesheet = "front_end/" + invoker.app_name + ".css" | 532 module_name = "ui" |
| 425 inputs = [ input_stylesheet ] + devtools_core_base_files | 533 imported_files = gypi_values.devtools_ui_js_files |
| 426 | 534 } |
| 427 outputs = [ | 535 |
| 428 "$root_out_dir/resources/inspector/" + invoker.app_name + ".css" | 536 build_module("build_components_module") { |
| 429 ] | 537 module_name = "components" |
| 430 | 538 imported_files = gypi_values.devtools_components_js_files |
| 431 args = [ rebase_path(input_stylesheet, root_build_dir) ] + | 539 } |
| 432 rebase_path(outputs, root_build_dir) | 540 |
| 433 } | 541 build_module("build_workspace_module") { |
| 434 } | 542 module_name = "workspace" |
| 435 | 543 imported_files = gypi_values.devtools_workspace_js_files |
| 436 concatenate_css("concatenated_devtools_css") { | 544 } |
| 437 app_name = "devtools" | 545 |
| 438 } | 546 build_module("build_bindings_module") { |
| 439 | 547 module_name = "bindings" |
| 440 concatenate_css("concatenated_toolbox_css") { | 548 imported_files = gypi_values.devtools_bindings_js_files |
| 441 app_name = "toolbox" | 549 } |
| 442 } | 550 |
| 551 build_module("build_screencast_module") { | |
| 552 module_name = "screencast" | |
| 553 imported_files = gypi_values.devtools_screencast_js_files | |
| 554 } | |
| 555 | |
| 556 build_module("build_toolbox_module") { | |
| 557 module_name = "toolbox" | |
| 558 imported_files = gypi_values.devtools_toolbox_js_files | |
| 559 } | |
| 560 | |
| 561 build_module("build_toolbox_bootstrap_module") { | |
| 562 module_name = "toolbox_bootstrap" | |
| 563 imported_files = gypi_values.devtools_toolbox_bootstrap_js_files | |
| 564 } | |
| 565 | |
| 566 build_module("build_main_module") { | |
| 567 module_name = "main" | |
| 568 imported_files = gypi_values.devtools_main_js_files | |
| 569 } | |
| 570 } else { | |
| 571 template("concatenate_css") { | |
| 572 assert(defined(invoker.app_name), target_name) | |
| 573 app_name = invoker.app_name | |
| 574 | |
| 575 action(target_name) { | |
| 576 script = "scripts/concatenate_css_files.py" | |
| 577 | |
| 578 input_stylesheet = "front_end/" + app_name + ".css" | |
| 579 inputs = [ input_stylesheet ] + devtools_core_base_files | |
| 580 | |
| 581 outputs = [ resources_out_dir + app_name + ".css" ] | |
| 582 | |
| 583 args = [ rebase_path(input_stylesheet, root_build_dir) ] + | |
| 584 rebase_path(outputs, root_build_dir) | |
| 585 } | |
| 586 } | |
| 587 | |
| 588 foreach(app, app_names) { | |
| 589 concatenate_css("concatenated_" + app + "_css") { | |
| 590 app_name = app | |
| 591 } | |
| 592 } | |
| 593 | |
| 594 action("concatenated_module_descriptors") { | |
| 595 script = "scripts/concatenate_module_descriptors.py" | |
| 596 | |
| 597 input = "front_end/Runtime.js" | |
| 598 inputs = [ input ] + gypi_values.devtools_module_json_files | |
| 599 outputs = [ resources_out_dir + "Runtime.js" ] | |
| 600 | |
| 601 args = rebase_path([ input ] + outputs + | |
| 602 gypi_values.devtools_module_json_files, root_build_dir) | |
| 603 } | |
| 604 } | |
| OLD | NEW |