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

Side by Side Diff: sdk/BUILD.gn

Issue 2992353002: Invoke copy_tree.py only once to collect all input file lists. (Closed)
Patch Set: Cleanup Created 3 years, 4 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
« no previous file with comments | « build/copy_tree.gni ('k') | tools/copy_tree.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 # This GN file contains build rules for assembling the Dart SDK. There are 5 # This GN file contains build rules for assembling the Dart SDK. There are
6 # two possible variants: the "Full" SDK, and the "Platform" SDK. If you want 6 # two possible variants: the "Full" SDK, and the "Platform" SDK. If you want
7 # to make a new subset of the Full SDK, make it the same way we make 7 # to make a new subset of the Full SDK, make it the same way we make
8 # the Platform SDK. 8 # the Platform SDK.
9 # 9 #
10 # Warning: 10 # Warning:
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 ] 203 ]
204 204
205 # Package sources copied to lib/ 205 # Package sources copied to lib/
206 _analyzer_source_dirs = [ 206 _analyzer_source_dirs = [
207 "analyzer", 207 "analyzer",
208 "analysis_server", 208 "analysis_server",
209 "front_end", 209 "front_end",
210 "kernel", 210 "kernel",
211 ] 211 ]
212 212
213 # From here down to the copy_trees() invocation, we collect all the information
214 # about trees that need to be copied in the list of scopes, copy_tree_specs.
215 copy_tree_specs = []
216
217 # This loop generates rules for copying analyzer sources into lib/
218 foreach(analyzer_source_dir, _analyzer_source_dirs) {
219 copy_tree_specs += [{
220 target = "copy_${analyzer_source_dir}_source_dir"
221 visibility = [ ":copy_analyzer_sources" ]
222 source = "../pkg/$analyzer_source_dir"
223 dest = "$root_out_dir/dart-sdk/lib/$analyzer_source_dir"
224 ignore_patterns = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore,packages,test,testc ases"
225 }]
226 }
227
228 # This rule copies dartdoc templates to
229 # bin/snapshots/resources/dartdoc/templates
230 copy_tree_specs += [{
231 target = "copy_dartdoc_templates"
232 visibility = [ ":copy_dartdoc_files" ]
233 source = "../third_party/pkg/dartdoc/lib/templates"
234 dest = "$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/templates"
235 ignore_patterns = "{}"
236 }]
237
238 # This rule copies dartdoc resources to
239 # bin/snapshots/resources/dartdoc/resources
240 copy_tree_specs += [{
241 target = "copy_dartdoc_resources"
242 visibility = [ ":copy_dartdoc_files" ]
243 source = "../third_party/pkg/dartdoc/lib/resources"
244 dest = "$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/resources"
245 ignore_patterns = "{}"
246 }]
247
248 # This rule copies js needed by ddc to lib/dev_compiler
249 copy_tree_specs += [{
250 target = "copy_dev_compiler_js"
251 visibility = [
252 ":copy_dev_compiler_sdk",
253 ":copy_dev_compiler_require_js",
254 ":copy_dev_compiler_tools",
255 ]
256 source = "../pkg/dev_compiler/lib/js"
257 dest = "$root_out_dir/dart-sdk/lib/dev_compiler"
258 ignore_patterns = "{}"
259 }]
260
261 # This rule copies pub assets to lib/_internal/pub/asset
262 copy_tree_specs += [{
263 target = "copy_pub_assets"
264 visibility = [
265 ":create_common_sdk",
266 ":copy_7zip",
267 ]
268 deps = [
269 ":copy_libraries",
270 ]
271 source = "../third_party/pkg/pub/lib/src/asset"
272 dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset"
273 ignore_patterns = "{}"
274 }]
275
276 # This loop generates rules to copy libraries to lib/
277 foreach(library, _full_sdk_libraries) {
278 copy_tree_specs += [{
279 target = "copy_${library}_library"
280 visibility = [
281 ":copy_platform_sdk_libraries",
282 ":copy_full_sdk_libraries",
283 ]
284 source = "lib/$library"
285 dest = "$root_out_dir/dart-sdk/lib/$library"
286 ignore_patterns = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore"
287 }]
288 }
289
290 if (is_win) {
291 copy_tree_specs += [{
292 target = "copy_7zip"
293 visibility = [ ":create_common_sdk" ]
294 deps = [
295 ":copy_libraries",
296 ":copy_pub_assets",
297 ]
298 source = "../third_party/7zip"
299 dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset/7zip"
300 ignore_patterns = ".svn"
301 }]
302 }
303
304 # This generates targets for everything in copy_tree_specs. The targets have the
305 # same name as the "target" fields in the scopes of copy_tree_specs.
306 copy_trees("copy_trees") {
307 sources = copy_tree_specs
308 }
309
213 # Copies the Dart VM binary into bin/ 310 # Copies the Dart VM binary into bin/
214 copy("copy_dart") { 311 copy("copy_dart") {
215 visibility = [ ":create_common_sdk" ] 312 visibility = [ ":create_common_sdk" ]
216 deps = [ 313 deps = [
217 "../runtime/bin:dart", 314 "../runtime/bin:dart",
218 ] 315 ]
219 dart_out = get_label_info("../runtime/bin:dart", "root_out_dir") 316 dart_out = get_label_info("../runtime/bin:dart", "root_out_dir")
220 if (is_win) { 317 if (is_win) {
221 sources = [ 318 sources = [
222 "$dart_out/dart.exe", 319 "$dart_out/dart.exe",
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 # This is the main rule for copying snapshots from _full_sdk_snapshots to 462 # This is the main rule for copying snapshots from _full_sdk_snapshots to
366 # bin/snapshots 463 # bin/snapshots
367 group("copy_full_sdk_snapshots") { 464 group("copy_full_sdk_snapshots") {
368 visibility = [ ":create_full_sdk" ] 465 visibility = [ ":create_full_sdk" ]
369 deps = [] 466 deps = []
370 foreach(snapshot, _full_sdk_snapshots) { 467 foreach(snapshot, _full_sdk_snapshots) {
371 deps += [ ":copy_${snapshot[0]}_snapshot" ] 468 deps += [ ":copy_${snapshot[0]}_snapshot" ]
372 } 469 }
373 } 470 }
374 471
375 # This loop generates rules for copying analyzer sources into lib/
376 foreach(analyzer_source_dir, _analyzer_source_dirs) {
377 copy_tree("copy_${analyzer_source_dir}_source_dir") {
378 visibility = [ ":copy_analyzer_sources" ]
379 source = "../pkg/$analyzer_source_dir"
380 dest = "$root_out_dir/dart-sdk/lib/$analyzer_source_dir"
381 exclude = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore,packages,test,testcases"
382 }
383 }
384
385 # This is the main rule for copying analyzer sources to lib/ 472 # This is the main rule for copying analyzer sources to lib/
386 group("copy_analyzer_sources") { 473 group("copy_analyzer_sources") {
387 visibility = [ ":create_common_sdk" ] 474 visibility = [ ":create_common_sdk" ]
388 deps = [] 475 deps = []
389 foreach(analyzer_source_dir, _analyzer_source_dirs) { 476 foreach(analyzer_source_dir, _analyzer_source_dirs) {
390 deps += [ ":copy_${analyzer_source_dir}_source_dir" ] 477 deps += [ ":copy_${analyzer_source_dir}_source_dir" ]
391 } 478 }
392 } 479 }
393 480
394 # This rule copies dartdoc templates to
395 # bin/snapshots/resources/dartdoc/templates
396 copy_tree("copy_dartdoc_templates") {
397 visibility = [ ":copy_dartdoc_files" ]
398 source = "../third_party/pkg/dartdoc/lib/templates"
399 dest = "$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/templates"
400 }
401
402 # This rule copies dartdoc resources to
403 # bin/snapshots/resources/dartdoc/resources
404 copy_tree("copy_dartdoc_resources") {
405 visibility = [ ":copy_dartdoc_files" ]
406 source = "../third_party/pkg/dartdoc/lib/resources"
407 dest = "$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/resources"
408 }
409
410 # This rule writes the .packages file for dartdoc resources. 481 # This rule writes the .packages file for dartdoc resources.
411 write_file("$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/.packages", 482 write_file("$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/.packages",
412 "dartdoc:.") 483 "dartdoc:.")
413 484
414 # This is the main rule for copying the files that dartdoc needs. 485 # This is the main rule for copying the files that dartdoc needs.
415 group("copy_dartdoc_files") { 486 group("copy_dartdoc_files") {
416 visibility = [ ":create_common_sdk" ] 487 visibility = [ ":create_common_sdk" ]
417 deps = [ 488 deps = [
418 ":copy_dartdoc_resources", 489 ":copy_dartdoc_resources",
419 ":copy_dartdoc_templates", 490 ":copy_dartdoc_templates",
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 ":copy_libraries", 545 ":copy_libraries",
475 ] 546 ]
476 sources = [ 547 sources = [
477 "../pkg/dev_compiler/lib/sdk/ddc_sdk.sum", 548 "../pkg/dev_compiler/lib/sdk/ddc_sdk.sum",
478 ] 549 ]
479 outputs = [ 550 outputs = [
480 "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}", 551 "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}",
481 ] 552 ]
482 } 553 }
483 554
484 # This rule copies js needed by ddc to lib/dev_compiler
485 copy_tree("copy_dev_compiler_js") {
486 visibility = [
487 ":copy_dev_compiler_sdk",
488 ":copy_dev_compiler_require_js",
489 ":copy_dev_compiler_tools",
490 ]
491 source = "../pkg/dev_compiler/lib/js"
492 dest = "$root_out_dir/dart-sdk/lib/dev_compiler"
493 }
494
495 # This rule copies require.js to lib/dev_compiler/amd 555 # This rule copies require.js to lib/dev_compiler/amd
496 copy("copy_dev_compiler_require_js") { 556 copy("copy_dev_compiler_require_js") {
497 visibility = [ ":copy_dev_compiler_sdk" ] 557 visibility = [ ":copy_dev_compiler_sdk" ]
498 deps = [ 558 deps = [
499 ":copy_dev_compiler_js", 559 ":copy_dev_compiler_js",
500 ] 560 ]
501 sources = [ 561 sources = [
502 "../third_party/requirejs/require.js", 562 "../third_party/requirejs/require.js",
503 ] 563 ]
504 outputs = [ 564 outputs = [
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 sources = [ 615 sources = [
556 "lib/dart_client.platform", 616 "lib/dart_client.platform",
557 "lib/dart_server.platform", 617 "lib/dart_server.platform",
558 "lib/dart_shared.platform", 618 "lib/dart_shared.platform",
559 ] 619 ]
560 outputs = [ 620 outputs = [
561 "$root_out_dir/dart-sdk/lib/{{source_file_part}}", 621 "$root_out_dir/dart-sdk/lib/{{source_file_part}}",
562 ] 622 ]
563 } 623 }
564 624
565 # This rule copies pub assets to lib/_internal/pub/asset
566 copy_tree("copy_pub_assets") {
567 visibility = [
568 ":create_common_sdk",
569 ":copy_7zip",
570 ]
571 deps = [
572 ":copy_libraries",
573 ]
574 source = "../third_party/pkg/pub/lib/src/asset"
575 dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset"
576 }
577
578 # This loop generates rules to copy libraries to lib/
579 foreach(library, _full_sdk_libraries) {
580 copy_tree("copy_${library}_library") {
581 visibility = [
582 ":copy_platform_sdk_libraries",
583 ":copy_full_sdk_libraries",
584 ]
585 source = "lib/$library"
586 dest = "$root_out_dir/dart-sdk/lib/$library"
587 exclude = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore"
588 }
589 }
590
591 # This is the main rule to copy libraries in _platform_sdk_libraries to lib/ 625 # This is the main rule to copy libraries in _platform_sdk_libraries to lib/
592 group("copy_platform_sdk_libraries") { 626 group("copy_platform_sdk_libraries") {
593 visibility = [ 627 visibility = [
594 ":create_platform_sdk", 628 ":create_platform_sdk",
595 ":copy_libraries", 629 ":copy_libraries",
596 ] 630 ]
597 deps = [] 631 deps = []
598 foreach(library, _platform_sdk_libraries) { 632 foreach(library, _platform_sdk_libraries) {
599 deps += [ ":copy_${library}_library" ] 633 deps += [ ":copy_${library}_library" ]
600 } 634 }
(...skipping 16 matching lines...) Expand all
617 deps = [ 651 deps = [
618 ":copy_platform_sdk_libraries", 652 ":copy_platform_sdk_libraries",
619 ] 653 ]
620 } else { 654 } else {
621 deps = [ 655 deps = [
622 ":copy_full_sdk_libraries", 656 ":copy_full_sdk_libraries",
623 ] 657 ]
624 } 658 }
625 } 659 }
626 660
627 if (is_win) {
628 copy_tree("copy_7zip") {
629 visibility = [ ":create_common_sdk" ]
630 deps = [
631 ":copy_libraries",
632 ":copy_pub_assets",
633 ]
634 source = "../third_party/7zip"
635 dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset/7zip"
636 exclude = ".svn"
637 }
638 }
639
640 # This rule writes the version file. 661 # This rule writes the version file.
641 action("write_version_file") { 662 action("write_version_file") {
642 visibility = [ ":create_common_sdk" ] 663 visibility = [ ":create_common_sdk" ]
643 output = "$root_out_dir/dart-sdk/version" 664 output = "$root_out_dir/dart-sdk/version"
644 outputs = [ 665 outputs = [
645 output, 666 output,
646 ] 667 ]
647 script = "../tools/write_version_file.py" 668 script = "../tools/write_version_file.py"
648 args = [ 669 args = [
649 "--output", 670 "--output",
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 group("create_sdk") { 795 group("create_sdk") {
775 deps = [ 796 deps = [
776 ":create_common_sdk", 797 ":create_common_sdk",
777 ] 798 ]
778 if (dart_platform_sdk) { 799 if (dart_platform_sdk) {
779 deps += [ ":create_platform_sdk" ] 800 deps += [ ":create_platform_sdk" ]
780 } else { 801 } else {
781 deps += [ ":create_full_sdk" ] 802 deps += [ ":create_full_sdk" ]
782 } 803 }
783 } 804 }
OLDNEW
« no previous file with comments | « build/copy_tree.gni ('k') | tools/copy_tree.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698