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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 all_devtools_files = | 61 all_devtools_files = |
62 gypi_values.devtools_cm_css_files + gypi_values.devtools_cm_js_files + | 62 gypi_values.devtools_cm_css_files + gypi_values.devtools_cm_js_files + |
63 devtools_core_files + gypi_values.devtools_module_json_files + | 63 devtools_core_files + gypi_values.devtools_module_json_files + |
64 devtools_modules_js_files + gypi_values.devtools_acorn_files | 64 devtools_modules_js_files + gypi_values.devtools_acorn_files |
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 resources_out_debug_dir = "$root_out_dir/resources/inspector/debug/" |
| 71 |
70 generated_scripts = [ | 72 generated_scripts = [ |
71 resources_out_dir + "InspectorBackendCommands.js", | 73 resources_out_dir + "InspectorBackendCommands.js", |
72 resources_out_dir + "SupportedCSSProperties.js", | 74 resources_out_dir + "SupportedCSSProperties.js", |
73 ] | 75 ] |
74 | 76 |
| 77 generated_entry_files = [ |
| 78 resources_out_dir + "inspector.html", |
| 79 resources_out_dir + "inspector.js", |
| 80 resources_out_dir + "toolbox.html", |
| 81 resources_out_dir + "toolbox.js", |
| 82 ] |
| 83 |
| 84 generated_workers = [ |
| 85 resources_out_dir + "formatter_worker.js", |
| 86 resources_out_dir + "heap_snapshot_worker.js", |
| 87 resources_out_dir + "temp_storage_shared_worker.js", |
| 88 ] |
| 89 |
| 90 generated_bundled_modules = [ |
| 91 resources_out_dir + "animation/animation_module.js", |
| 92 resources_out_dir + "audits/audits_module.js", |
| 93 resources_out_dir + "components_lazy/components_lazy_module.js", |
| 94 resources_out_dir + "console/console_module.js", |
| 95 resources_out_dir + "devices/devices_module.js", |
| 96 resources_out_dir + "diff/diff_module.js", |
| 97 resources_out_dir + "elements/elements_module.js", |
| 98 resources_out_dir + "es_tree/es_tree_module.js", |
| 99 resources_out_dir + "layers/layers_module.js", |
| 100 resources_out_dir + "network/network_module.js", |
| 101 resources_out_dir + "profiler/profiler_module.js", |
| 102 resources_out_dir + "resources/resources_module.js", |
| 103 resources_out_dir + "sass/sass_module.js", |
| 104 resources_out_dir + "security/security_module.js", |
| 105 resources_out_dir + "settings/settings_module.js", |
| 106 resources_out_dir + "snippets/snippets_module.js", |
| 107 resources_out_dir + "source_frame/source_frame_module.js", |
| 108 resources_out_dir + "sources/sources_module.js", |
| 109 resources_out_dir + "text_editor/text_editor_module.js", |
| 110 resources_out_dir + "timeline_model/timeline_model_module.js", |
| 111 resources_out_dir + "timeline/timeline_module.js", |
| 112 resources_out_dir + "ui_lazy/ui_lazy_module.js", |
| 113 ] |
| 114 |
| 115 generated_remote_modules = [ |
| 116 resources_out_dir + "accessibility/accessibility_module.js", |
| 117 resources_out_dir + "cm_modes/cm_modes_module.js", |
| 118 resources_out_dir + "emulated_devices/emulated_devices_module.js", |
| 119 resources_out_dir + "gonzales/gonzales_module.js", |
| 120 resources_out_dir + "screencast/screencast_module.js", |
| 121 ] |
| 122 |
75 #------------------------------------------------------------------------------- | 123 #------------------------------------------------------------------------------- |
76 | 124 |
77 visibility = [ "//third_party/WebKit/*" ] | 125 visibility = [ "//third_party/WebKit/*" ] |
78 | 126 |
79 group("devtools_frontend_resources") { | 127 group("devtools_frontend_resources") { |
80 public_deps = [ | 128 public_deps = [ |
81 ":build_applications", | 129 ":build_release_devtools", |
82 ":copy_embedder_scripts", | 130 ":copy_embedder_scripts", |
83 ":copy_emulated_devices_images", | 131 ":copy_emulated_devices_images", |
84 ":copy_inspector_images", | 132 ":copy_inspector_images", |
85 ":devtools_extension_api", | 133 ":devtools_extension_api", |
86 ":frontend_protocol_sources", | 134 ":frontend_protocol_sources", |
87 ":supported_css_properties", | 135 ":supported_css_properties", |
88 ] | 136 ] |
| 137 if (debug_devtools) { |
| 138 public_deps += [ ":build_debug_devtools" ] |
| 139 } |
89 } | 140 } |
90 | 141 |
91 copy("copy_embedder_scripts") { | 142 copy("copy_embedder_scripts") { |
92 sources = gypi_values.devtools_embedder_scripts | 143 sources = gypi_values.devtools_embedder_scripts |
93 outputs = [ | 144 outputs = [ |
94 resources_out_dir + "{{source_file_part}}", | 145 resources_out_dir + "{{source_file_part}}", |
95 ] | 146 ] |
96 } | 147 } |
97 | 148 |
98 copy("copy_inspector_images") { | 149 copy("copy_inspector_images") { |
(...skipping 12 matching lines...) Expand all Loading... |
111 | 162 |
112 action("generate_devtools_grd") { | 163 action("generate_devtools_grd") { |
113 script = "scripts/generate_devtools_grd.py" | 164 script = "scripts/generate_devtools_grd.py" |
114 | 165 |
115 deps = [ | 166 deps = [ |
116 ":devtools_frontend_resources", | 167 ":devtools_frontend_resources", |
117 ] | 168 ] |
118 inputs = gypi_values.devtools_image_files + all_devtools_files | 169 inputs = gypi_values.devtools_image_files + all_devtools_files |
119 inputs += gypi_values.devtools_embedder_scripts | 170 inputs += gypi_values.devtools_embedder_scripts |
120 | 171 |
121 if (debug_devtools) { | 172 generated_files = |
122 # Debug: all files are picked as-is. | 173 generated_entry_files + generated_workers + generated_bundled_modules + |
123 generated_files = generated_scripts + [ | 174 [ 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 | 175 |
173 images_path = "front_end/Images" | 176 images_path = "front_end/Images" |
174 | 177 |
175 inputs += generated_files | 178 inputs += generated_files |
176 | 179 |
177 outfile = "$root_gen_dir/devtools/devtools_resources.grd" | 180 outfile = "$root_gen_dir/devtools/devtools_resources.grd" |
178 outputs = [ | 181 outputs = [ |
179 outfile, | 182 outfile, |
180 ] | 183 ] |
181 | 184 |
182 relative_path_dirs = [ | 185 relative_path_dirs = [ |
183 resources_out_dir_no_slash, | 186 resources_out_dir_no_slash, |
184 "front_end", | 187 "front_end", |
185 ] | 188 ] |
186 | 189 |
187 args = rebase_path(generated_files, root_build_dir) + | 190 args = rebase_path(generated_files, root_build_dir) + |
188 rebase_path(generated_files, root_build_dir) + | 191 rebase_path(generated_files, root_build_dir) + |
189 rebase_path(gypi_values.devtools_embedder_scripts, root_build_dir) + | 192 rebase_path(gypi_values.devtools_embedder_scripts, root_build_dir) + |
190 static_files_args + [ "--relative_path_dirs" ] + | 193 [ "--relative_path_dirs" ] + |
191 rebase_path(relative_path_dirs, root_build_dir) + | 194 rebase_path(relative_path_dirs, root_build_dir) + |
192 [ | 195 [ |
193 "--images", | 196 "--images", |
194 rebase_path(images_path, root_build_dir), | 197 rebase_path(images_path, root_build_dir), |
195 "--output", | 198 "--output", |
196 rebase_path(outfile, root_build_dir), | 199 rebase_path(outfile, root_build_dir), |
197 ] | 200 ] |
198 } | 201 } |
199 | 202 |
200 action("devtools_extension_api") { | 203 action("devtools_extension_api") { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 outputs = [ | 238 outputs = [ |
236 resources_out_dir + "InspectorBackendCommands.js", | 239 resources_out_dir + "InspectorBackendCommands.js", |
237 ] | 240 ] |
238 | 241 |
239 args = rebase_path(inputs, root_build_dir) + [ | 242 args = rebase_path(inputs, root_build_dir) + [ |
240 "--output_js_dir", | 243 "--output_js_dir", |
241 rebase_path(resources_out_dir, root_build_dir), | 244 rebase_path(resources_out_dir, root_build_dir), |
242 ] | 245 ] |
243 } | 246 } |
244 | 247 |
245 action("build_applications") { | 248 action("build_release_devtools") { |
246 script = "scripts/build_applications.py" | 249 script = "scripts/build_applications.py" |
| 250 |
| 251 deps = [ |
| 252 ":frontend_protocol_sources", |
| 253 ":supported_css_properties", |
| 254 ] |
| 255 |
247 helper_scripts = [ | 256 helper_scripts = [ |
248 "scripts/modular_build.py", | 257 "scripts/modular_build.py", |
249 "scripts/concatenate_application_code.py", | 258 "scripts/concatenate_application_code.py", |
250 "scripts/rjsmin.py", | 259 "scripts/rjsmin.py", |
251 ] | 260 ] |
252 | 261 |
253 inputs = helper_scripts + all_devtools_files + generated_scripts + [ | 262 inputs = helper_scripts + all_devtools_files + generated_scripts + [ |
254 "front_end/inspector.html", | 263 "front_end/inspector.html", |
255 "front_end/toolbox.html", | 264 "front_end/toolbox.html", |
256 ] | 265 ] |
257 | 266 |
258 outputs = [ | 267 outputs = generated_entry_files + generated_workers + |
259 resources_out_dir + "inspector.html", | 268 generated_bundled_modules + generated_remote_modules |
260 resources_out_dir + "toolbox.html", | |
261 ] | |
262 | 269 |
263 deps = [ | 270 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 | 271 |
311 args = [ | 272 args = [ |
312 "inspector", | 273 "inspector", |
313 "toolbox", | 274 "toolbox", |
314 "formatter_worker", | 275 "formatter_worker", |
315 "heap_snapshot_worker", | 276 "heap_snapshot_worker", |
316 "temp_storage_shared_worker", | 277 "temp_storage_shared_worker", |
317 "--input_path", | 278 "--input_path", |
318 rebase_path("front_end", root_build_dir), | 279 rebase_path("front_end", root_build_dir), |
319 "--output_path", | 280 "--output_path", |
320 rebase_path(resources_out_dir, root_build_dir), | 281 rebase_path(resources_out_dir, root_build_dir), |
321 "--debug", | 282 "--debug", |
322 debug_mode, | 283 debug_mode, |
323 ] | 284 ] |
324 } | 285 } |
325 | 286 |
326 if (debug_devtools) { | 287 if (debug_devtools) { |
327 # Debug: copy non-module directories and core into resources_out_dir as-is. | 288 action("build_debug_devtools") { |
328 group("copy_debug_non_modules") { | 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 |