| OLD | NEW |
| 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: |
| 11 # If you need to copy something into dart-sdk/lib/foo in addition to the stuff | 11 # If you need to copy something into dart-sdk/lib/foo in addition to the stuff |
| 12 # copied there by :copy_libraries, then you must depend on ":copy_libraries", | 12 # copied there by :copy_libraries, then you must depend on ":copy_libraries", |
| 13 # or ":copy_libraries" may delete/overwrite your addition, and the build will | 13 # or ":copy_libraries" may delete/overwrite your addition, and the build will |
| 14 # fail. | 14 # fail. |
| 15 | 15 |
| 16 import("../build/copy_tree.gni") | 16 import("../build/copy_tree.gni") |
| 17 | 17 |
| 18 declare_args() { | 18 declare_args() { |
| 19 # Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries. | 19 # Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries. |
| 20 dart_platform_sdk = false | 20 dart_platform_sdk = false |
| 21 } | 21 } |
| 22 | 22 |
| 23 if (is_fuchsia || is_fuchsia_host) { | 23 if (is_fuchsia || |
| 24 is_fuchsia_host || |
| 25 current_cpu == "arm64" || |
| 26 current_cpu == "arm") { |
| 24 dart_platform_sdk = true | 27 dart_platform_sdk = true |
| 25 } | 28 } |
| 26 | 29 |
| 27 # The directory layout of the SDK is as follows: | 30 # The directory layout of the SDK is as follows: |
| 28 # | 31 # |
| 29 # ..dart-sdk/ | 32 # ..dart-sdk/ |
| 30 # ....bin/ | 33 # ....bin/ |
| 31 # ......dart or dart.exe (executable) | 34 # ......dart or dart.exe (executable) |
| 32 # ......dart.lib (import library for VM native extensions on Windows) | 35 # ......dart.lib (import library for VM native extensions on Windows) |
| 33 # ......dartdoc | 36 # ......dartdoc |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 outputs = [ | 456 outputs = [ |
| 454 "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}", | 457 "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}", |
| 455 ] | 458 ] |
| 456 } | 459 } |
| 457 | 460 |
| 458 # This rule copies js needed by ddc to lib/dev_compiler | 461 # This rule copies js needed by ddc to lib/dev_compiler |
| 459 copy_tree("copy_dev_compiler_js") { | 462 copy_tree("copy_dev_compiler_js") { |
| 460 visibility = [ | 463 visibility = [ |
| 461 ":copy_dev_compiler_sdk", | 464 ":copy_dev_compiler_sdk", |
| 462 ":copy_dev_compiler_require_js", | 465 ":copy_dev_compiler_require_js", |
| 466 ":copy_dev_compiler_tools", |
| 463 ] | 467 ] |
| 464 source = "../pkg/dev_compiler/lib/js" | 468 source = "../pkg/dev_compiler/lib/js" |
| 465 dest = "$root_out_dir/dart-sdk/lib/dev_compiler" | 469 dest = "$root_out_dir/dart-sdk/lib/dev_compiler" |
| 466 } | 470 } |
| 467 | 471 |
| 468 # This rule copies require.js to lib/dev_compiler/amd | 472 # This rule copies require.js to lib/dev_compiler/amd |
| 469 copy("copy_dev_compiler_require_js") { | 473 copy("copy_dev_compiler_require_js") { |
| 470 visibility = [ ":copy_dev_compiler_sdk" ] | 474 visibility = [ ":copy_dev_compiler_sdk" ] |
| 471 deps = [ | 475 deps = [ |
| 472 ":copy_dev_compiler_js", | 476 ":copy_dev_compiler_js", |
| 473 ] | 477 ] |
| 474 sources = [ | 478 sources = [ |
| 475 "../third_party/requirejs/require.js", | 479 "../third_party/requirejs/require.js", |
| 476 ] | 480 ] |
| 477 outputs = [ | 481 outputs = [ |
| 478 "$root_out_dir/dart-sdk/lib/dev_compiler/amd/{{source_file_part}}", | 482 "$root_out_dir/dart-sdk/lib/dev_compiler/amd/{{source_file_part}}", |
| 479 ] | 483 ] |
| 480 } | 484 } |
| 481 | 485 |
| 486 # This rule copies tools to go along with ddc. |
| 487 copy("copy_dev_compiler_tools") { |
| 488 visibility = [ ":copy_dev_compiler_sdk" ] |
| 489 deps = [ |
| 490 ":copy_dev_compiler_js", |
| 491 "../utils/dartdevc:dartdevc_web", |
| 492 "../utils/dartdevc:stack_trace_mapper", |
| 493 ] |
| 494 dart_out = get_label_info("../utils/dartdevc:dartdevc_web", "root_out_dir") |
| 495 sources = [ |
| 496 "$dart_out/dev_compiler/build/web/dart_stack_trace_mapper.js", |
| 497 "$dart_out/dev_compiler/build/web/ddc_web_compiler.js", |
| 498 ] |
| 499 outputs = [ |
| 500 "$root_out_dir/dart-sdk/lib/dev_compiler/web/{{source_file_part}}", |
| 501 ] |
| 502 } |
| 503 |
| 482 # This is the main rule for copying ddc's dependencies to lib/ | 504 # This is the main rule for copying ddc's dependencies to lib/ |
| 483 group("copy_dev_compiler_sdk") { | 505 group("copy_dev_compiler_sdk") { |
| 484 visibility = [ ":create_full_sdk" ] | 506 visibility = [ ":create_full_sdk" ] |
| 485 deps = [ | 507 deps = [ |
| 486 ":copy_dev_compiler_js", | 508 ":copy_dev_compiler_js", |
| 487 ":copy_dev_compiler_require_js", | 509 ":copy_dev_compiler_require_js", |
| 488 ":copy_dev_compiler_summary", | 510 ":copy_dev_compiler_summary", |
| 511 ":copy_dev_compiler_tools", |
| 489 ] | 512 ] |
| 490 } | 513 } |
| 491 | 514 |
| 492 # This rule copies header files to include/ | 515 # This rule copies header files to include/ |
| 493 copy("copy_headers") { | 516 copy("copy_headers") { |
| 494 visibility = [ ":create_common_sdk" ] | 517 visibility = [ ":create_common_sdk" ] |
| 495 sources = [ | 518 sources = [ |
| 496 "../runtime/include/dart_api.h", | 519 "../runtime/include/dart_api.h", |
| 497 "../runtime/include/dart_mirrors_api.h", | 520 "../runtime/include/dart_mirrors_api.h", |
| 498 "../runtime/include/dart_native_api.h", | 521 "../runtime/include/dart_native_api.h", |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 deps = [ | 727 deps = [ |
| 705 ":copy_platform_sdk_libraries", | 728 ":copy_platform_sdk_libraries", |
| 706 ":copy_platform_sdk_scripts", | 729 ":copy_platform_sdk_scripts", |
| 707 ":copy_platform_sdk_snapshots", | 730 ":copy_platform_sdk_snapshots", |
| 708 ] | 731 ] |
| 709 } | 732 } |
| 710 | 733 |
| 711 # Parts specific to the full SDK. | 734 # Parts specific to the full SDK. |
| 712 group("create_full_sdk") { | 735 group("create_full_sdk") { |
| 713 visibility = [ | 736 visibility = [ |
| 714 ":copy_dev_compiler_tools", | |
| 715 ":create_sdk", | 737 ":create_sdk", |
| 716 ] | 738 ] |
| 739 |
| 717 deps = [ | 740 deps = [ |
| 718 ":copy_dev_compiler_sdk", | 741 ":copy_dev_compiler_sdk", |
| 719 ":copy_full_sdk_libraries", | 742 ":copy_full_sdk_libraries", |
| 720 ":copy_full_sdk_scripts", | 743 ":copy_full_sdk_scripts", |
| 721 ":copy_full_sdk_snapshots", | 744 ":copy_full_sdk_snapshots", |
| 722 ] | 745 ] |
| 723 } | 746 } |
| 724 | 747 |
| 725 # The main target to depend on from ../BUILD.gn | 748 # The main target to depend on from ../BUILD.gn |
| 726 group("create_sdk") { | 749 group("create_sdk") { |
| 727 deps = [ | 750 deps = [ |
| 728 ":create_common_sdk", | 751 ":create_common_sdk", |
| 729 ] | 752 ] |
| 730 if (dart_platform_sdk) { | 753 if (dart_platform_sdk) { |
| 731 deps += [ ":create_platform_sdk" ] | 754 deps += [ ":create_platform_sdk" ] |
| 732 } else { | 755 } else { |
| 733 deps += [ ":create_full_sdk" ] | 756 deps += [ ":create_full_sdk" ] |
| 734 } | 757 } |
| 735 } | 758 } |
| 736 | |
| 737 # This rule copies tools to go along with ddc. | |
| 738 copy("copy_dev_compiler_tools") { | |
| 739 deps = [ | |
| 740 ":create_full_sdk", | |
| 741 "../utils/dartdevc:dartdevc_web", | |
| 742 "../utils/dartdevc:stack_trace_mapper", | |
| 743 ] | |
| 744 dart_out = get_label_info("../utils/dartdevc:dartdevc_web", "root_out_dir") | |
| 745 sources = [ | |
| 746 "$dart_out/dev_compiler/build/web/dart_stack_trace_mapper.js", | |
| 747 "$dart_out/dev_compiler/build/web/ddc_web_compiler.js", | |
| 748 ] | |
| 749 outputs = [ | |
| 750 "$root_out_dir/dart-sdk/lib/dev_compiler/web/{{source_file_part}}", | |
| 751 ] | |
| 752 } | |
| OLD | NEW |