Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: third_party/WebKit/Source/devtools/BUILD.gn

Issue 2262743002: DevTools: Run devtools tests in release mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify build process Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_modules = [
pfeldman 2016/08/30 21:07:40 generated_bundled_modules
chenwilliam 2016/08/30 22:21:21 Done.
89 resources_out_dir + "accessibility/accessibility_module.js",
90 resources_out_dir + "animation/animation_module.js",
91 resources_out_dir + "audits/audits_module.js",
92 resources_out_dir + "components_lazy/components_lazy_module.js",
93 resources_out_dir + "console/console_module.js",
94 resources_out_dir + "devices/devices_module.js",
95 resources_out_dir + "diff/diff_module.js",
96 resources_out_dir + "elements/elements_module.js",
97 resources_out_dir + "es_tree/es_tree_module.js",
98 resources_out_dir + "layers/layers_module.js",
99 resources_out_dir + "network/network_module.js",
100 resources_out_dir + "profiler/profiler_module.js",
101 resources_out_dir + "resources/resources_module.js",
102 resources_out_dir + "sass/sass_module.js",
103 resources_out_dir + "security/security_module.js",
104 resources_out_dir + "settings/settings_module.js",
105 resources_out_dir + "snippets/snippets_module.js",
106 resources_out_dir + "source_frame/source_frame_module.js",
107 resources_out_dir + "sources/sources_module.js",
108 resources_out_dir + "text_editor/text_editor_module.js",
109 resources_out_dir + "timeline_model/timeline_model_module.js",
110 resources_out_dir + "timeline/timeline_module.js",
111 resources_out_dir + "ui_lazy/ui_lazy_module.js",
112 ]
113
75 #------------------------------------------------------------------------------- 114 #-------------------------------------------------------------------------------
76 115
77 visibility = [ "//third_party/WebKit/*" ] 116 visibility = [ "//third_party/WebKit/*" ]
78 117
79 group("devtools_frontend_resources") { 118 group("devtools_frontend_resources") {
80 public_deps = [ 119 public_deps = [
81 ":build_applications", 120 ":build_release_devtools",
82 ":copy_embedder_scripts", 121 ":copy_embedder_scripts",
83 ":copy_emulated_devices_images", 122 ":copy_emulated_devices_images",
84 ":copy_inspector_images", 123 ":copy_inspector_images",
85 ":devtools_extension_api", 124 ":devtools_extension_api",
86 ":frontend_protocol_sources", 125 ":frontend_protocol_sources",
87 ":supported_css_properties", 126 ":supported_css_properties",
88 ] 127 ]
128 if (debug_devtools) {
129 public_deps += [ ":build_debug_devtools" ]
130 }
89 } 131 }
90 132
91 copy("copy_embedder_scripts") { 133 copy("copy_embedder_scripts") {
92 sources = gypi_values.devtools_embedder_scripts 134 sources = gypi_values.devtools_embedder_scripts
93 outputs = [ 135 outputs = [
94 resources_out_dir + "{{source_file_part}}", 136 resources_out_dir + "{{source_file_part}}",
95 ] 137 ]
96 } 138 }
97 139
98 copy("copy_inspector_images") { 140 copy("copy_inspector_images") {
(...skipping 12 matching lines...) Expand all
111 153
112 action("generate_devtools_grd") { 154 action("generate_devtools_grd") {
113 script = "scripts/generate_devtools_grd.py" 155 script = "scripts/generate_devtools_grd.py"
114 156
115 deps = [ 157 deps = [
116 ":devtools_frontend_resources", 158 ":devtools_frontend_resources",
117 ] 159 ]
118 inputs = gypi_values.devtools_image_files + all_devtools_files 160 inputs = gypi_values.devtools_image_files + all_devtools_files
119 inputs += gypi_values.devtools_embedder_scripts 161 inputs += gypi_values.devtools_embedder_scripts
120 162
121 if (debug_devtools) { 163 generated_files =
122 # Debug: all files are picked as-is. 164 generated_entry_files + generated_workers + generated_modules +
123 generated_files = generated_scripts + [ 165 [ 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)
pfeldman 2016/08/29 20:57:22 Why is this no longer needed?
chenwilliam 2016/08/29 22:45:33 I don't think we need the grd file in debug_devtoo
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 + "accessibility/accessibility_module.js",
147 resources_out_dir + "audits/audits_module.js",
148 resources_out_dir + "animation/animation_module.js",
149 resources_out_dir + "components_lazy/components_lazy_module.js",
150 resources_out_dir + "console/console_module.js",
151 resources_out_dir + "devices/devices_module.js",
152 resources_out_dir + "diff/diff_module.js",
153 resources_out_dir + "elements/elements_module.js",
154 resources_out_dir + "es_tree/es_tree_module.js",
155 resources_out_dir + "layers/layers_module.js",
156 resources_out_dir + "network/network_module.js",
157 resources_out_dir + "profiler/profiler_module.js",
158 resources_out_dir + "resources/resources_module.js",
159 resources_out_dir + "sass/sass_module.js",
160 resources_out_dir + "security/security_module.js",
161 resources_out_dir + "settings/settings_module.js",
162 resources_out_dir + "snippets/snippets_module.js",
163 resources_out_dir + "source_frame/source_frame_module.js",
164 resources_out_dir + "sources/sources_module.js",
165 resources_out_dir + "text_editor/text_editor_module.js",
166 resources_out_dir + "timeline_model/timeline_model_module.js",
167 resources_out_dir + "timeline/timeline_module.js",
168 resources_out_dir + "ui_lazy/ui_lazy_module.js",
169 resources_out_dir + "devtools_extension_api.js",
170 ]
171 static_files_args = [] # Nothing needed for this
172 }
173 166
174 images_path = "front_end/Images" 167 images_path = "front_end/Images"
175 168
176 inputs += generated_files 169 inputs += generated_files
177 170
178 outfile = "$root_gen_dir/devtools/devtools_resources.grd" 171 outfile = "$root_gen_dir/devtools/devtools_resources.grd"
179 outputs = [ 172 outputs = [
180 outfile, 173 outfile,
181 ] 174 ]
182 175
183 relative_path_dirs = [ 176 relative_path_dirs = [
184 resources_out_dir_no_slash, 177 resources_out_dir_no_slash,
185 "front_end", 178 "front_end",
186 ] 179 ]
187 180
188 args = rebase_path(generated_files, root_build_dir) + 181 args = rebase_path(generated_files, root_build_dir) +
189 rebase_path(generated_files, root_build_dir) + 182 rebase_path(generated_files, root_build_dir) +
190 rebase_path(gypi_values.devtools_embedder_scripts, root_build_dir) + 183 rebase_path(gypi_values.devtools_embedder_scripts, root_build_dir) +
191 static_files_args + [ "--relative_path_dirs" ] + 184 [ "--relative_path_dirs" ] +
192 rebase_path(relative_path_dirs, root_build_dir) + 185 rebase_path(relative_path_dirs, root_build_dir) +
193 [ 186 [
194 "--images", 187 "--images",
195 rebase_path(images_path, root_build_dir), 188 rebase_path(images_path, root_build_dir),
196 "--output", 189 "--output",
197 rebase_path(outfile, root_build_dir), 190 rebase_path(outfile, root_build_dir),
198 ] 191 ]
199 } 192 }
200 193
201 action("devtools_extension_api") { 194 action("devtools_extension_api") {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 outputs = [ 229 outputs = [
237 resources_out_dir + "InspectorBackendCommands.js", 230 resources_out_dir + "InspectorBackendCommands.js",
238 ] 231 ]
239 232
240 args = rebase_path(inputs, root_build_dir) + [ 233 args = rebase_path(inputs, root_build_dir) + [
241 "--output_js_dir", 234 "--output_js_dir",
242 rebase_path(resources_out_dir, root_build_dir), 235 rebase_path(resources_out_dir, root_build_dir),
243 ] 236 ]
244 } 237 }
245 238
246 action("build_applications") { 239 action("build_release_devtools") {
247 script = "scripts/build_applications.py" 240 script = "scripts/build_applications.py"
241
242 deps = [
243 ":frontend_protocol_sources",
244 ":supported_css_properties",
245 ]
246
248 helper_scripts = [ 247 helper_scripts = [
249 "scripts/modular_build.py", 248 "scripts/modular_build.py",
250 "scripts/concatenate_application_code.py", 249 "scripts/concatenate_application_code.py",
251 "scripts/rjsmin.py", 250 "scripts/rjsmin.py",
252 ] 251 ]
253 252
254 inputs = helper_scripts + all_devtools_files + generated_scripts + [ 253 inputs = helper_scripts + all_devtools_files + generated_scripts + [
255 "front_end/inspector.html", 254 "front_end/inspector.html",
256 "front_end/toolbox.html", 255 "front_end/toolbox.html",
257 ] 256 ]
258 257
259 outputs = [ 258 generated_remote_modules = [
pfeldman 2016/08/30 21:07:40 ^^ generated_remote_modules
chenwilliam 2016/08/30 22:21:21 Done.
260 resources_out_dir + "inspector.html", 259 resources_out_dir + "cm_modes/cm_modes_module.js",
261 resources_out_dir + "toolbox.html", 260 resources_out_dir + "emulated_devices/emulated_devices_module.js",
261 resources_out_dir + "gonzales/gonzales_module.js",
262 resources_out_dir + "screencast/screencast_module.js",
262 ] 263 ]
263 264
264 deps = [ 265 outputs = generated_entry_files + generated_workers + generated_modules +
265 ":frontend_protocol_sources", 266 generated_remote_modules
266 ":supported_css_properties",
267 ]
268 267
269 if (debug_devtools) { 268 debug_mode = "0"
270 deps += [ ":copy_debug_non_modules" ]
271
272 debug_mode = "1"
273 } else {
274 outputs += [
275 resources_out_dir + "inspector.js",
276 resources_out_dir + "toolbox.js",
277 resources_out_dir + "formatter_worker.js",
278 resources_out_dir + "heap_snapshot_worker.js",
279 resources_out_dir + "temp_storage_shared_worker.js",
280 resources_out_dir + "accessibility/accessibility_module.js",
281 resources_out_dir + "animation/animation_module.js",
282 resources_out_dir + "audits/audits_module.js",
283 resources_out_dir + "cm_modes/cm_modes_module.js",
284 resources_out_dir + "components_lazy/components_lazy_module.js",
285 resources_out_dir + "console/console_module.js",
286 resources_out_dir + "devices/devices_module.js",
287 resources_out_dir + "diff/diff_module.js",
288 resources_out_dir + "elements/elements_module.js",
289 resources_out_dir + "emulated_devices/emulated_devices_module.js",
290 resources_out_dir + "es_tree/es_tree_module.js",
291 resources_out_dir + "gonzales/gonzales_module.js",
292 resources_out_dir + "layers/layers_module.js",
293 resources_out_dir + "network/network_module.js",
294 resources_out_dir + "profiler/profiler_module.js",
295 resources_out_dir + "resources/resources_module.js",
296 resources_out_dir + "sass/sass_module.js",
297 resources_out_dir + "screencast/screencast_module.js",
298 resources_out_dir + "security/security_module.js",
299 resources_out_dir + "settings/settings_module.js",
300 resources_out_dir + "snippets/snippets_module.js",
301 resources_out_dir + "source_frame/source_frame_module.js",
302 resources_out_dir + "sources/sources_module.js",
303 resources_out_dir + "text_editor/text_editor_module.js",
304 resources_out_dir + "timeline_model/timeline_model_module.js",
305 resources_out_dir + "timeline/timeline_module.js",
306 resources_out_dir + "ui_lazy/ui_lazy_module.js",
307 ]
308
309 debug_mode = "0"
310 }
311 269
312 args = [ 270 args = [
313 "inspector", 271 "inspector",
314 "toolbox", 272 "toolbox",
315 "formatter_worker", 273 "formatter_worker",
316 "heap_snapshot_worker", 274 "heap_snapshot_worker",
317 "temp_storage_shared_worker", 275 "temp_storage_shared_worker",
318 "--input_path", 276 "--input_path",
319 rebase_path("front_end", root_build_dir), 277 rebase_path("front_end", root_build_dir),
320 "--output_path", 278 "--output_path",
321 rebase_path(resources_out_dir, root_build_dir), 279 rebase_path(resources_out_dir, root_build_dir),
322 "--debug", 280 "--debug",
323 debug_mode, 281 debug_mode,
324 ] 282 ]
325 } 283 }
326 284
327 if (debug_devtools) { 285 if (debug_devtools) {
328 # Debug: copy non-module directories and core into resources_out_dir as-is. 286 resources_out_debug_dir = "$root_out_dir/resources/inspector/debug/"
pfeldman 2016/08/29 20:57:22 I was hoping that we could minimize the diff via u
chenwilliam 2016/08/29 22:45:33 I had to add some boilerplate but I'm not sure how
329 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,
pfeldman 2016/08/30 21:07:40 It seems that this flag defines the root procedure
319 ]
320 }
321
322 group("copy_debug_files") {
330 public_deps = [ 323 public_deps = [
331 ":copy_acorn_js_files", 324 ":copy_acorn_js_files",
332 ":copy_codemirror_files", 325 ":copy_codemirror_files",
326 ":copy_emulated_devices_images_debug",
327 ":copy_generated_scripts",
328 ":copy_inspector_images_debug",
333 ":copy_runtime_core", 329 ":copy_runtime_core",
334 ] 330 ]
335 } 331 }
336 332
337 copy("copy_runtime_core") { 333 copy("copy_runtime_core") {
338 sources = gypi_values.devtools_core_base_files 334 sources = gypi_values.devtools_core_base_files
339 outputs = [ 335 outputs = [
340 resources_out_dir + "/{{source_file_part}}", 336 resources_out_debug_dir + "/{{source_file_part}}",
341 ] 337 ]
342 } 338 }
343 339
344 copy("copy_acorn_js_files") { 340 copy("copy_acorn_js_files") {
345 sources = gypi_values.devtools_acorn_files 341 sources = gypi_values.devtools_acorn_files
346 outputs = [ 342 outputs = [
347 resources_out_dir + "acorn/{{source_file_part}}", 343 resources_out_debug_dir + "acorn/{{source_file_part}}",
348 ] 344 ]
349 } 345 }
350 346
351 copy("copy_codemirror_files") { 347 copy("copy_codemirror_files") {
352 sources = 348 sources =
353 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
354 outputs = [ 350 outputs = [
355 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}}",
356 ] 376 ]
357 } 377 }
358 } 378 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698