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