2017-04-19 16:00:12 +00:00
|
|
|
# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
|
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# This GN file contains build rules for assembling the Dart SDK. There are
|
|
|
|
# two possible variants: the "Full" SDK, and the "Platform" SDK. If you want
|
|
|
|
# to make a new subset of the Full SDK, make it the same way we make
|
|
|
|
# the Platform SDK.
|
|
|
|
#
|
|
|
|
# Warning:
|
|
|
|
# If you need to copy something into dart-sdk/lib/foo in addition to the stuff
|
|
|
|
# copied there by :copy_libraries, then you must depend on ":copy_libraries",
|
|
|
|
# or ":copy_libraries" may delete/overwrite your addition, and the build will
|
|
|
|
# fail.
|
|
|
|
|
2018-07-10 19:08:47 +00:00
|
|
|
import("../build/dart/copy_tree.gni")
|
2020-06-17 16:12:26 +00:00
|
|
|
import("../build/executable_suffix.gni")
|
2018-08-21 20:28:06 +00:00
|
|
|
import("../runtime/runtime_args.gni")
|
2019-12-19 23:12:53 +00:00
|
|
|
import("../sdk_args.gni")
|
2017-05-21 06:30:06 +00:00
|
|
|
|
|
|
|
declare_args() {
|
|
|
|
# Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries.
|
|
|
|
dart_platform_sdk = true
|
2017-09-21 19:21:25 +00:00
|
|
|
|
2019-04-05 13:23:44 +00:00
|
|
|
# Path to stripped dart binaries relative to build output directory.
|
2017-08-08 21:42:07 +00:00
|
|
|
dart_stripped_binary = "dart"
|
2020-06-17 16:12:26 +00:00
|
|
|
dart_precompiled_runtime_stripped_binary = "dart_precompiled_runtime_product"
|
|
|
|
gen_snapshot_stripped_binary = "gen_snapshot_product"
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# The directory layout of the SDK is as follows:
|
|
|
|
#
|
|
|
|
# ..dart-sdk/
|
|
|
|
# ....bin/
|
|
|
|
# ......dart or dart.exe (executable)
|
|
|
|
# ......dart.lib (import library for VM native extensions on Windows)
|
2019-04-05 13:23:44 +00:00
|
|
|
# ......dartaotruntime or dartaotruntime.exe (executable)
|
2017-05-21 06:30:06 +00:00
|
|
|
# ......dartdoc
|
|
|
|
# ......dartfmt
|
2020-06-17 16:12:26 +00:00
|
|
|
# ......dart2native (if not on ia32)
|
2017-05-21 06:30:06 +00:00
|
|
|
# ......dart2js
|
|
|
|
# ......dartanalyzer
|
|
|
|
# ......dartdevc
|
2020-06-17 16:12:26 +00:00
|
|
|
# ......utils/gen_snapshot or utils/gen_snapshot.exe (if not on ia32)
|
2017-05-21 06:30:06 +00:00
|
|
|
# ......pub
|
|
|
|
# ......snapshots/
|
|
|
|
# ........analysis_server.dart.snapshot
|
|
|
|
# ........dart2js.dart.snapshot
|
|
|
|
# ........dartanalyzer.dart.snapshot
|
2020-07-21 16:23:18 +00:00
|
|
|
# ........dds.dart.snapshot
|
2020-02-25 07:16:10 +00:00
|
|
|
# ........dartdev.dart.snapshot
|
2017-05-21 06:30:06 +00:00
|
|
|
# ........dartdoc.dart.snapshot
|
|
|
|
# ........dartfmt.dart.snapshot
|
|
|
|
# ........dartdevc.dart.snapshot
|
2020-06-17 16:12:26 +00:00
|
|
|
# ........gen_kernel.dart.snapshot (if not on ia32)
|
|
|
|
# ........dart2native.dart.snapshot (if not on ia32)
|
2018-06-15 16:24:24 +00:00
|
|
|
# ........kernel_worker.dart.snapshot
|
2017-05-21 06:30:06 +00:00
|
|
|
# ........pub.dart.snapshot
|
2020-01-09 16:07:56 +00:00
|
|
|
# ........frontend_server.dart.snapshot
|
2019-10-09 19:26:34 +00:00
|
|
|
# ......resources/
|
|
|
|
# ........dartdoc/
|
|
|
|
# ...........packages
|
|
|
|
# ..........resources/
|
|
|
|
# ..........templates/
|
|
|
|
# ......model/
|
|
|
|
# ........lexeme/
|
|
|
|
# ..........idx2word.json
|
|
|
|
# ..........model.tflite
|
|
|
|
# ..........word2idx.json
|
2017-05-21 06:30:06 +00:00
|
|
|
# ....include/
|
|
|
|
# ......dart_api.h
|
|
|
|
# ......dart_native_api.h
|
|
|
|
# ......dart_tools_api.h
|
|
|
|
# ....lib/
|
2018-03-22 23:07:55 +00:00
|
|
|
# ......libraries.json
|
2017-05-21 06:30:06 +00:00
|
|
|
# ......_internal/
|
2019-10-09 19:26:34 +00:00
|
|
|
# ........strong.sum
|
|
|
|
# ........dart2js_platform.dill
|
|
|
|
# ........dart2js_server_platform.dill
|
|
|
|
# ........dart2js_platform_strong.dill
|
|
|
|
# ........dart2js_server_platform_strong.dill
|
|
|
|
# ........vm_platform_strong.dill
|
|
|
|
# ........dev_compiler/
|
2017-05-21 06:30:06 +00:00
|
|
|
# ......async/
|
|
|
|
# ......collection/
|
|
|
|
# ......convert/
|
|
|
|
# ......core/
|
|
|
|
# ......html/
|
2017-09-21 19:21:25 +00:00
|
|
|
# ......_http/
|
2017-05-21 06:30:06 +00:00
|
|
|
# ......internal/
|
|
|
|
# ......io/
|
|
|
|
# ......isolate/
|
|
|
|
# ......js/
|
|
|
|
# ......js_util/
|
|
|
|
# ......math/
|
|
|
|
# ......mirrors/
|
|
|
|
# ......typed_data/
|
2019-08-28 23:11:21 +00:00
|
|
|
# ......wasm/
|
2017-05-21 06:30:06 +00:00
|
|
|
# ......api_readme.md
|
|
|
|
|
|
|
|
# Scripts that go under bin/
|
|
|
|
_platform_sdk_scripts = [
|
|
|
|
"dartanalyzer",
|
|
|
|
"dartfmt",
|
|
|
|
"pub",
|
|
|
|
]
|
|
|
|
|
|
|
|
_full_sdk_scripts = [
|
|
|
|
"dart2js",
|
|
|
|
"dartanalyzer",
|
|
|
|
"dartdevc",
|
|
|
|
"dartfmt",
|
|
|
|
"pub",
|
|
|
|
]
|
|
|
|
|
|
|
|
# Scripts not ending in _sdk that go under bin/
|
|
|
|
_scripts = [ "dartdoc" ]
|
|
|
|
|
|
|
|
# Snapshots that go under bin/snapshots
|
|
|
|
_platform_sdk_snapshots = [
|
|
|
|
[
|
|
|
|
"dartanalyzer",
|
|
|
|
"../utils/dartanalyzer:generate_dartanalyzer_snapshot",
|
|
|
|
],
|
2020-02-25 07:16:10 +00:00
|
|
|
[
|
|
|
|
"dartdev",
|
2020-07-30 22:02:24 +00:00
|
|
|
"../utils/dartdev:dartdev",
|
2020-02-25 07:16:10 +00:00
|
|
|
],
|
2017-05-21 06:30:06 +00:00
|
|
|
[
|
|
|
|
"dartdoc",
|
|
|
|
"../utils/dartdoc",
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"dartfmt",
|
|
|
|
"../utils/dartfmt",
|
|
|
|
],
|
2020-07-21 16:23:18 +00:00
|
|
|
[
|
|
|
|
"dds",
|
2020-07-30 22:02:24 +00:00
|
|
|
"../utils/dds:dds",
|
2020-07-21 16:23:18 +00:00
|
|
|
],
|
2018-05-18 20:27:29 +00:00
|
|
|
[
|
2018-06-21 19:52:53 +00:00
|
|
|
"pub",
|
|
|
|
"../utils/pub",
|
2018-05-18 20:27:29 +00:00
|
|
|
],
|
2017-05-21 06:30:06 +00:00
|
|
|
]
|
2020-06-17 16:12:26 +00:00
|
|
|
if (dart_target_arch != "ia32") {
|
2019-11-04 12:01:56 +00:00
|
|
|
_platform_sdk_snapshots += [ [
|
|
|
|
"dart2native",
|
|
|
|
"../utils/dart2native:generate_dart2native_snapshot",
|
|
|
|
] ]
|
|
|
|
}
|
2018-08-21 20:28:06 +00:00
|
|
|
if (create_kernel_service_snapshot) {
|
2019-09-17 23:19:20 +00:00
|
|
|
_platform_sdk_snapshots += [ [
|
|
|
|
"kernel-service",
|
|
|
|
"../utils/kernel-service:kernel-service_snapshot",
|
|
|
|
] ]
|
2018-08-21 20:28:06 +00:00
|
|
|
}
|
2019-07-31 12:54:52 +00:00
|
|
|
if (dart_target_arch != "arm") {
|
2019-09-17 23:19:20 +00:00
|
|
|
_platform_sdk_snapshots += [ [
|
|
|
|
"analysis_server",
|
|
|
|
"../utils/analysis_server",
|
|
|
|
] ]
|
2019-07-31 12:54:52 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
|
|
|
|
_full_sdk_snapshots = [
|
|
|
|
[
|
|
|
|
"dart2js",
|
|
|
|
"../utils/compiler:dart2js",
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"dartanalyzer",
|
|
|
|
"../utils/dartanalyzer:generate_dartanalyzer_snapshot",
|
|
|
|
],
|
2020-02-25 07:16:10 +00:00
|
|
|
[
|
|
|
|
"dartdev",
|
2020-07-30 22:02:24 +00:00
|
|
|
"../utils/dartdev:dartdev",
|
2020-02-25 07:16:10 +00:00
|
|
|
],
|
2017-05-21 06:30:06 +00:00
|
|
|
[
|
|
|
|
"dartdevc",
|
|
|
|
"../utils/dartdevc",
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"dartdoc",
|
|
|
|
"../utils/dartdoc",
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"dartfmt",
|
|
|
|
"../utils/dartfmt",
|
|
|
|
],
|
2020-07-21 16:23:18 +00:00
|
|
|
[
|
|
|
|
"dds",
|
2020-07-30 22:02:24 +00:00
|
|
|
"../utils/dds:dds",
|
2020-07-21 16:23:18 +00:00
|
|
|
],
|
2017-11-29 23:40:35 +00:00
|
|
|
[
|
2018-06-15 16:24:24 +00:00
|
|
|
"kernel_worker",
|
|
|
|
"../utils/bazel:kernel_worker",
|
2017-11-29 23:40:35 +00:00
|
|
|
],
|
2018-06-27 20:55:02 +00:00
|
|
|
[
|
|
|
|
"pub",
|
|
|
|
"../utils/pub",
|
|
|
|
],
|
2020-01-09 16:07:56 +00:00
|
|
|
[
|
|
|
|
"frontend_server",
|
|
|
|
"../utils/kernel-service:frontend_server",
|
|
|
|
],
|
2017-05-21 06:30:06 +00:00
|
|
|
]
|
2020-06-17 16:12:26 +00:00
|
|
|
if (dart_target_arch != "ia32") {
|
2019-11-04 12:01:56 +00:00
|
|
|
_full_sdk_snapshots += [ [
|
|
|
|
"dart2native",
|
|
|
|
"../utils/dart2native:generate_dart2native_snapshot",
|
|
|
|
] ]
|
|
|
|
}
|
2018-08-21 20:28:06 +00:00
|
|
|
if (create_kernel_service_snapshot) {
|
2019-09-17 23:19:20 +00:00
|
|
|
_full_sdk_snapshots += [ [
|
|
|
|
"kernel-service",
|
|
|
|
"../utils/kernel-service:kernel-service_snapshot",
|
|
|
|
] ]
|
2018-08-21 20:28:06 +00:00
|
|
|
}
|
2019-07-31 12:54:52 +00:00
|
|
|
if (dart_target_arch != "arm") {
|
2019-09-17 23:19:20 +00:00
|
|
|
_full_sdk_snapshots += [ [
|
|
|
|
"analysis_server",
|
|
|
|
"../utils/analysis_server",
|
|
|
|
] ]
|
2019-07-31 12:54:52 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
|
|
|
|
# Libraries that go under lib/
|
|
|
|
_full_sdk_libraries = [
|
|
|
|
"_internal",
|
|
|
|
"async",
|
2018-01-18 17:46:39 +00:00
|
|
|
"cli",
|
2017-05-21 06:30:06 +00:00
|
|
|
"collection",
|
|
|
|
"convert",
|
|
|
|
"core",
|
|
|
|
"developer",
|
2019-02-13 12:42:47 +00:00
|
|
|
"ffi",
|
2017-08-31 03:46:58 +00:00
|
|
|
"html",
|
2017-09-21 19:21:25 +00:00
|
|
|
"_http",
|
2017-08-31 03:46:58 +00:00
|
|
|
"indexed_db",
|
2017-05-21 06:30:06 +00:00
|
|
|
"internal",
|
|
|
|
"io",
|
|
|
|
"isolate",
|
2017-08-31 03:46:58 +00:00
|
|
|
"js",
|
|
|
|
"js_util",
|
2017-05-21 06:30:06 +00:00
|
|
|
"math",
|
|
|
|
"mirrors",
|
2017-08-31 03:46:58 +00:00
|
|
|
"svg",
|
2017-05-21 06:30:06 +00:00
|
|
|
"typed_data",
|
2019-08-28 23:11:21 +00:00
|
|
|
"wasm",
|
2017-08-31 03:46:58 +00:00
|
|
|
"web_audio",
|
|
|
|
"web_gl",
|
|
|
|
"web_sql",
|
2017-05-21 06:30:06 +00:00
|
|
|
]
|
|
|
|
|
2018-07-26 22:26:58 +00:00
|
|
|
# Apps running on the platform SDK shouldn't be using Dart4Web libraries, but
|
|
|
|
# the analyzer and dartdoc expect all the library sources to be present.
|
|
|
|
#
|
|
|
|
# _platform_sdk_libraries = [
|
|
|
|
# "_internal",
|
|
|
|
# "async",
|
|
|
|
# "cli",
|
|
|
|
# "collection",
|
|
|
|
# "convert",
|
|
|
|
# "core",
|
|
|
|
# "developer",
|
|
|
|
# "html",
|
|
|
|
# "_http",
|
|
|
|
# "internal",
|
|
|
|
# "io",
|
|
|
|
# "isolate",
|
|
|
|
# "math",
|
|
|
|
# "mirrors",
|
|
|
|
# "typed_data",
|
|
|
|
# ]
|
|
|
|
_platform_sdk_libraries = _full_sdk_libraries
|
|
|
|
|
2017-08-09 18:13:59 +00:00
|
|
|
# From here down to the copy_trees() invocation, we collect all the information
|
|
|
|
# about trees that need to be copied in the list of scopes, copy_tree_specs.
|
|
|
|
copy_tree_specs = []
|
|
|
|
|
|
|
|
# This rule copies dartdoc templates to
|
2019-08-30 02:50:10 +00:00
|
|
|
# bin/resources/dartdoc/templates
|
2019-09-17 23:19:20 +00:00
|
|
|
copy_tree_specs += [
|
|
|
|
{
|
|
|
|
target = "copy_dartdoc_templates"
|
|
|
|
visibility = [ ":copy_dartdoc_files" ]
|
|
|
|
source = "../third_party/pkg/dartdoc/lib/templates"
|
|
|
|
dest = "$root_out_dir/dart-sdk/bin/resources/dartdoc/templates"
|
|
|
|
ignore_patterns = "{}"
|
|
|
|
},
|
|
|
|
]
|
2017-08-09 18:13:59 +00:00
|
|
|
|
|
|
|
# This rule copies dartdoc resources to
|
2019-08-30 02:50:10 +00:00
|
|
|
# bin/resources/dartdoc/resources
|
2019-09-17 23:19:20 +00:00
|
|
|
copy_tree_specs += [
|
|
|
|
{
|
|
|
|
target = "copy_dartdoc_resources"
|
|
|
|
visibility = [ ":copy_dartdoc_files" ]
|
|
|
|
source = "../third_party/pkg/dartdoc/lib/resources"
|
|
|
|
dest = "$root_out_dir/dart-sdk/bin/resources/dartdoc/resources"
|
|
|
|
ignore_patterns = "{}"
|
|
|
|
},
|
|
|
|
]
|
2017-08-09 18:13:59 +00:00
|
|
|
|
|
|
|
# This loop generates rules to copy libraries to lib/
|
|
|
|
foreach(library, _full_sdk_libraries) {
|
2019-09-17 23:19:20 +00:00
|
|
|
copy_tree_specs += [
|
|
|
|
{
|
|
|
|
target = "copy_${library}_library"
|
|
|
|
visibility = [
|
|
|
|
":copy_platform_sdk_libraries",
|
|
|
|
":copy_full_sdk_libraries",
|
|
|
|
]
|
|
|
|
source = "lib/$library"
|
|
|
|
dest = "$root_out_dir/dart-sdk/lib/$library"
|
|
|
|
ignore_patterns = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore"
|
|
|
|
},
|
|
|
|
]
|
2017-08-09 18:13:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (is_win) {
|
2019-09-17 23:19:20 +00:00
|
|
|
copy_tree_specs += [
|
|
|
|
{
|
|
|
|
target = "copy_7zip"
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ ":copy_libraries" ]
|
2019-09-17 23:19:20 +00:00
|
|
|
source = "../third_party/7zip"
|
|
|
|
dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset/7zip"
|
|
|
|
ignore_patterns = ".svn"
|
|
|
|
},
|
|
|
|
]
|
2017-08-09 18:13:59 +00:00
|
|
|
}
|
|
|
|
|
2019-07-31 13:56:39 +00:00
|
|
|
if (target_cpu == "x64") {
|
2019-08-01 23:05:45 +00:00
|
|
|
copy_tree_specs += [
|
2019-09-17 23:19:20 +00:00
|
|
|
{
|
|
|
|
target = "copy_language_model"
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ ":copy_libraries" ]
|
2019-09-17 23:19:20 +00:00
|
|
|
source = "../pkg/analysis_server/language_model"
|
2019-10-09 19:26:34 +00:00
|
|
|
dest = "$root_out_dir/dart-sdk/bin/model"
|
2019-09-17 23:19:20 +00:00
|
|
|
ignore_patterns = "{}"
|
|
|
|
},
|
|
|
|
]
|
2020-06-18 00:24:31 +00:00
|
|
|
if (is_linux || is_android || is_fuchsia) {
|
2019-11-06 19:17:15 +00:00
|
|
|
copy_tree_specs += [
|
|
|
|
{
|
|
|
|
target = "copy_libtensorflowlite_c"
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ ":copy_libraries" ]
|
2019-11-06 19:17:15 +00:00
|
|
|
source = "../third_party/pkg/tflite_native/lib/src/blobs"
|
|
|
|
dest = "$root_out_dir/dart-sdk/bin/snapshots"
|
|
|
|
ignore_patterns = "*.dll,*mac64.so"
|
|
|
|
},
|
|
|
|
]
|
|
|
|
}
|
|
|
|
if (is_mac) {
|
|
|
|
copy_tree_specs += [
|
|
|
|
{
|
|
|
|
target = "copy_libtensorflowlite_c"
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ ":copy_libraries" ]
|
2019-11-06 19:17:15 +00:00
|
|
|
source = "../third_party/pkg/tflite_native/lib/src/blobs"
|
|
|
|
dest = "$root_out_dir/dart-sdk/bin/snapshots"
|
|
|
|
ignore_patterns = "*.dll,*linux64.so"
|
|
|
|
},
|
|
|
|
]
|
|
|
|
}
|
|
|
|
if (is_win) {
|
|
|
|
copy_tree_specs += [
|
|
|
|
{
|
|
|
|
target = "copy_libtensorflowlite_c"
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ ":copy_libraries" ]
|
2019-11-06 19:17:15 +00:00
|
|
|
source = "../third_party/pkg/tflite_native/lib/src/blobs"
|
|
|
|
dest = "$root_out_dir/dart-sdk/bin/snapshots"
|
|
|
|
ignore_patterns = "*.so"
|
|
|
|
},
|
|
|
|
]
|
|
|
|
}
|
2019-07-31 13:56:39 +00:00
|
|
|
}
|
|
|
|
|
2017-08-09 18:13:59 +00:00
|
|
|
# This generates targets for everything in copy_tree_specs. The targets have the
|
|
|
|
# same name as the "target" fields in the scopes of copy_tree_specs.
|
|
|
|
copy_trees("copy_trees") {
|
|
|
|
sources = copy_tree_specs
|
|
|
|
}
|
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# Copies the Dart VM binary into bin/
|
2018-01-18 06:05:56 +00:00
|
|
|
if (target_os != current_os && target_os == "fuchsia") {
|
2017-12-20 23:57:25 +00:00
|
|
|
# In the Fuchsia build, this has to use a symlink for two reasons.
|
|
|
|
# First, it makes the lookup of shared libraries relative to $ORIGIN
|
|
|
|
# (Linux) or @loader_path (macOS) find the libraries where they are,
|
|
|
|
# since those lookups use the directory of the symlink target rather
|
|
|
|
# than of the link itself (as they would for a copy or hard link).
|
|
|
|
# Second, when the dart binary is built as a "variant" (e.g. with a
|
|
|
|
# sanitizer), then $root_out_dir/dart is itself a symlink to the real
|
|
|
|
# binary in the selected variant toolchain's $root_out_dir and since
|
|
|
|
# the "copy" tool is actually a hard link rather than a copy, it will
|
|
|
|
# make a link to the symlink rather than the symlink's target, and the
|
|
|
|
# relative symlink interpreted from a different containing directory
|
|
|
|
# will not find the actual binary.
|
|
|
|
action("copy_dart") {
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
|
|
|
dart_label = "../runtime/bin:dart"
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ dart_label ]
|
2017-12-20 23:57:25 +00:00
|
|
|
dart_out = get_label_info(dart_label, "root_out_dir")
|
2020-02-25 07:16:10 +00:00
|
|
|
sources = [ "$dart_out/$dart_stripped_binary" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/bin/$dart_stripped_binary" ]
|
2017-12-20 23:57:25 +00:00
|
|
|
script = "/bin/ln"
|
|
|
|
args = [
|
|
|
|
"-snf",
|
|
|
|
rebase_path(sources[0], get_path_info(outputs[0], "dir")),
|
|
|
|
rebase_path(outputs[0]),
|
|
|
|
]
|
2017-04-19 16:00:12 +00:00
|
|
|
}
|
2017-12-20 23:57:25 +00:00
|
|
|
} else {
|
|
|
|
copy("copy_dart") {
|
2017-05-21 06:30:06 +00:00
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ "../runtime/bin:dart" ]
|
2017-12-20 23:57:25 +00:00
|
|
|
dart_out = get_label_info("../runtime/bin:dart", "root_out_dir")
|
2020-06-17 16:12:26 +00:00
|
|
|
sources = [ "$dart_out/${dart_stripped_binary}${executable_suffix}" ]
|
2020-06-18 02:07:19 +00:00
|
|
|
if (is_win && dart_lib_export_symbols) {
|
2017-12-20 23:57:25 +00:00
|
|
|
sources += [ "$dart_out/dart.lib" ]
|
|
|
|
}
|
2020-02-25 07:16:10 +00:00
|
|
|
outputs = [ "$root_out_dir/dart-sdk/bin/{{source_file_part}}" ]
|
2017-05-11 16:46:13 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
|
2019-04-05 13:23:44 +00:00
|
|
|
copy("copy_dartaotruntime") {
|
2020-06-17 16:12:26 +00:00
|
|
|
visibility = [ ":copy_dart2native" ]
|
|
|
|
deps = [ "../runtime/bin:dart_precompiled_runtime_product" ]
|
|
|
|
src_dir = get_label_info("../runtime/bin:dart_precompiled_runtime_product",
|
|
|
|
"root_out_dir")
|
|
|
|
sources = [
|
|
|
|
"$src_dir/${dart_precompiled_runtime_stripped_binary}${executable_suffix}",
|
|
|
|
]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/bin/dartaotruntime${executable_suffix}" ]
|
2019-04-05 13:23:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
copy("copy_gen_snapshot") {
|
2020-06-17 16:12:26 +00:00
|
|
|
visibility = [ ":copy_dart2native" ]
|
|
|
|
deps = [ "../runtime/bin:gen_snapshot_product" ]
|
|
|
|
src_dir =
|
|
|
|
get_label_info("../runtime/bin:gen_snapshot_product", "root_out_dir")
|
|
|
|
sources = [ "$src_dir/${gen_snapshot_stripped_binary}${executable_suffix}" ]
|
|
|
|
outputs =
|
|
|
|
[ "$root_out_dir/dart-sdk/bin/utils/gen_snapshot${executable_suffix}" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
copy("copy_vm_platform_strong_product") {
|
|
|
|
visibility = [ ":copy_dart2native" ]
|
|
|
|
deps = [ "../runtime/vm:vm_platform_product" ]
|
|
|
|
src_dir = get_label_info("../runtime/vm:vm_platform_product", "root_out_dir")
|
|
|
|
sources = [ "$src_dir/vm_platform_strong_product.dill" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
|
2019-04-05 13:23:44 +00:00
|
|
|
}
|
|
|
|
|
2019-09-05 14:46:43 +00:00
|
|
|
copy("copy_dart2native") {
|
|
|
|
deps = [
|
2019-11-04 12:01:56 +00:00
|
|
|
":copy_dartaotruntime",
|
2019-09-05 14:46:43 +00:00
|
|
|
":copy_gen_kernel_snapshot",
|
|
|
|
":copy_gen_snapshot",
|
2020-06-17 16:12:26 +00:00
|
|
|
":copy_vm_platform_strong_product",
|
2019-09-05 14:46:43 +00:00
|
|
|
]
|
|
|
|
ext = ""
|
|
|
|
if (is_win) {
|
|
|
|
ext = ".bat"
|
|
|
|
}
|
2020-02-25 07:16:10 +00:00
|
|
|
sources = [ "bin/dart2native$ext" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/bin/{{source_file_part}}" ]
|
2019-09-05 14:46:43 +00:00
|
|
|
}
|
|
|
|
|
2019-04-05 13:23:44 +00:00
|
|
|
copy("copy_gen_kernel_snapshot") {
|
2020-06-17 16:12:26 +00:00
|
|
|
visibility = [ ":copy_dart2native" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ "../utils/gen_kernel" ]
|
|
|
|
sources = [ "$root_gen_dir/gen_kernel.dart.snapshot" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/bin/snapshots/{{source_file_part}}" ]
|
2019-04-05 13:23:44 +00:00
|
|
|
}
|
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# A template for copying the things in _platform_sdk_scripts and
|
|
|
|
# _full_sdk_scripts into bin/
|
|
|
|
template("copy_sdk_script") {
|
|
|
|
assert(defined(invoker.name), "copy_sdk_script must define 'name'")
|
|
|
|
name = invoker.name
|
|
|
|
ext = ""
|
|
|
|
if (is_win) {
|
|
|
|
ext = ".bat"
|
2017-05-11 16:46:13 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
copy(target_name) {
|
|
|
|
visibility = [
|
|
|
|
":copy_platform_sdk_scripts",
|
|
|
|
":copy_full_sdk_scripts",
|
|
|
|
]
|
2020-02-25 07:16:10 +00:00
|
|
|
sources = [ "bin/${name}_sdk$ext" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/bin/$name$ext" ]
|
2017-04-19 16:00:12 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
foreach(sdk_script, _full_sdk_scripts) {
|
|
|
|
copy_sdk_script("copy_${sdk_script}_script") {
|
|
|
|
name = sdk_script
|
2017-05-11 16:46:13 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
foreach(script, _scripts) {
|
|
|
|
copy("copy_${script}_script") {
|
|
|
|
visibility = [
|
|
|
|
":copy_platform_sdk_scripts",
|
|
|
|
":copy_full_sdk_scripts",
|
2017-05-11 16:46:13 +00:00
|
|
|
]
|
2017-05-21 06:30:06 +00:00
|
|
|
ext = ""
|
|
|
|
if (is_win) {
|
|
|
|
ext = ".bat"
|
|
|
|
}
|
2020-02-25 07:16:10 +00:00
|
|
|
sources = [ "bin/$script$ext" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/bin/{{source_file_part}}" ]
|
2017-05-11 16:46:13 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# This is the main target for copying scripts in _platform_sdk_scripts to bin/
|
|
|
|
group("copy_platform_sdk_scripts") {
|
2020-05-12 23:37:19 +00:00
|
|
|
visibility = [ ":_create_platform_sdk" ]
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps = []
|
2017-05-21 06:30:06 +00:00
|
|
|
foreach(sdk_script, _platform_sdk_scripts) {
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps += [ ":copy_${sdk_script}_script" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
|
|
|
foreach(script, _scripts) {
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps += [ ":copy_${script}_script" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# This is the main target for copying scripts in _full_sdk_scripts to bin/
|
|
|
|
group("copy_full_sdk_scripts") {
|
|
|
|
visibility = [ ":create_full_sdk" ]
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps = []
|
2017-05-21 06:30:06 +00:00
|
|
|
foreach(sdk_script, _full_sdk_scripts) {
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps += [ ":copy_${sdk_script}_script" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
|
|
|
foreach(script, _scripts) {
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps += [ ":copy_${script}_script" ]
|
2017-04-19 16:00:12 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# This loop generates "copy" targets that put snapshots into bin/snapshots
|
|
|
|
foreach(snapshot, _full_sdk_snapshots) {
|
2020-01-09 16:07:56 +00:00
|
|
|
root = root_gen_dir
|
|
|
|
|
|
|
|
# The frontend_server is output to root_out_dir so that it doesn't conflict
|
|
|
|
# with the flutter snapshot by the same name under root_gen_dir.
|
|
|
|
if (snapshot[0] == "frontend_server") {
|
|
|
|
root = root_out_dir
|
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
copy("copy_${snapshot[0]}_snapshot") {
|
|
|
|
visibility = [
|
|
|
|
":copy_platform_sdk_snapshots",
|
|
|
|
":copy_full_sdk_snapshots",
|
|
|
|
]
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ snapshot[1] ]
|
|
|
|
sources = [ "$root/${snapshot[0]}.dart.snapshot" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/bin/snapshots/{{source_file_part}}" ]
|
2017-05-11 16:46:13 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# This is the main rule for copying snapshots from _platform_sdk_snapshots to
|
|
|
|
# bin/snapshots
|
|
|
|
group("copy_platform_sdk_snapshots") {
|
2020-05-12 23:37:19 +00:00
|
|
|
visibility = [ ":_create_platform_sdk" ]
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps = []
|
2017-05-21 06:30:06 +00:00
|
|
|
foreach(snapshot, _platform_sdk_snapshots) {
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps += [ ":copy_${snapshot[0]}_snapshot" ]
|
2017-05-11 16:46:13 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# This is the main rule for copying snapshots from _full_sdk_snapshots to
|
|
|
|
# bin/snapshots
|
|
|
|
group("copy_full_sdk_snapshots") {
|
|
|
|
visibility = [ ":create_full_sdk" ]
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps = []
|
2017-05-21 06:30:06 +00:00
|
|
|
foreach(snapshot, _full_sdk_snapshots) {
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps += [ ":copy_${snapshot[0]}_snapshot" ]
|
2017-05-11 16:46:13 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# This rule writes the .packages file for dartdoc resources.
|
2019-08-30 02:50:10 +00:00
|
|
|
write_file("$root_out_dir/dart-sdk/bin/resources/dartdoc/.packages",
|
2017-05-21 06:30:06 +00:00
|
|
|
"dartdoc:.")
|
|
|
|
|
|
|
|
# This is the main rule for copying the files that dartdoc needs.
|
|
|
|
group("copy_dartdoc_files") {
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps = [
|
2017-05-21 06:30:06 +00:00
|
|
|
":copy_dartdoc_resources",
|
|
|
|
":copy_dartdoc_templates",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
# This rule copies analyzer summaries to lib/_internal
|
|
|
|
copy("copy_analysis_summaries") {
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
|
|
|
deps = [
|
|
|
|
":copy_libraries",
|
|
|
|
"../utils/dartanalyzer:generate_summary_strong",
|
|
|
|
]
|
2020-02-25 07:16:10 +00:00
|
|
|
sources = [ "$root_gen_dir/strong.sum" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
|
|
|
|
2017-10-06 15:34:37 +00:00
|
|
|
# This rule copies dill files to lib/_internal.
|
2017-11-21 18:34:30 +00:00
|
|
|
copy("copy_vm_dill_files") {
|
2017-07-26 21:50:44 +00:00
|
|
|
visibility = [ ":create_common_sdk" ]
|
|
|
|
deps = [
|
|
|
|
":copy_libraries",
|
2017-10-06 15:34:37 +00:00
|
|
|
"../runtime/vm:kernel_platform_files",
|
2017-07-26 21:50:44 +00:00
|
|
|
]
|
2020-02-25 07:16:10 +00:00
|
|
|
sources = [ "$root_out_dir/vm_platform_strong.dill" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
|
2017-07-26 21:50:44 +00:00
|
|
|
}
|
|
|
|
|
2019-03-13 21:03:01 +00:00
|
|
|
copy("copy_abi_dill_files") {
|
2019-05-02 22:30:49 +00:00
|
|
|
visibility = [ ":create_sdk_with_abi_versions" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
sources = [ "../tools/abiversions" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/lib/_internal/abiversions" ]
|
2019-03-13 21:03:01 +00:00
|
|
|
}
|
|
|
|
|
2017-11-21 18:34:30 +00:00
|
|
|
copy("copy_dart2js_dill_files") {
|
|
|
|
visibility = [ ":create_full_sdk" ]
|
|
|
|
deps = [
|
|
|
|
":copy_libraries",
|
2020-06-16 23:37:36 +00:00
|
|
|
"../utils/compiler:compile_dart2js_nnbd_strong_platform",
|
2017-11-21 18:34:30 +00:00
|
|
|
"../utils/compiler:compile_dart2js_platform",
|
2020-06-16 23:37:36 +00:00
|
|
|
"../utils/compiler:compile_dart2js_server_nnbd_strong_platform",
|
2018-03-23 00:40:55 +00:00
|
|
|
"../utils/compiler:compile_dart2js_server_platform",
|
2017-11-21 18:34:30 +00:00
|
|
|
]
|
|
|
|
sources = [
|
2020-06-16 23:37:36 +00:00
|
|
|
"$root_out_dir/dart2js_nnbd_strong_platform.dill",
|
2017-11-21 18:34:30 +00:00
|
|
|
"$root_out_dir/dart2js_platform.dill",
|
2020-06-16 23:37:36 +00:00
|
|
|
"$root_out_dir/dart2js_server_nnbd_strong_platform.dill",
|
2018-03-23 00:40:55 +00:00
|
|
|
"$root_out_dir/dart2js_server_platform.dill",
|
2017-11-21 18:34:30 +00:00
|
|
|
]
|
2020-02-25 07:16:10 +00:00
|
|
|
outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
|
2017-11-21 18:34:30 +00:00
|
|
|
}
|
|
|
|
|
2020-07-14 00:09:29 +00:00
|
|
|
# Copies DDC's SDK weak outline .dill to lib/_internal
|
|
|
|
# TODO(nshahan) Fix the outline to be consistent and merge with below as a
|
|
|
|
# breaking change.
|
|
|
|
copy("copy_dev_compiler_weak_outline") {
|
2017-05-21 06:30:06 +00:00
|
|
|
visibility = [ ":copy_dev_compiler_sdk" ]
|
|
|
|
deps = [
|
|
|
|
":copy_libraries",
|
2019-11-19 00:24:48 +00:00
|
|
|
"../utils/dartdevc:dartdevc_platform",
|
2017-05-21 06:30:06 +00:00
|
|
|
]
|
2020-05-29 19:05:44 +00:00
|
|
|
sources = [ "$root_out_dir/ddc_outline.dill" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/lib/_internal/ddc_sdk.dill" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
|
|
|
|
2020-07-14 00:09:29 +00:00
|
|
|
# Copies DDC's SDK full and outline .dill files to lib/_internal.
|
|
|
|
copy("copy_dev_compiler_dills") {
|
|
|
|
visibility = [ ":copy_dev_compiler_sdk" ]
|
2020-06-16 23:37:36 +00:00
|
|
|
deps = [
|
|
|
|
":copy_libraries",
|
2020-07-14 00:09:29 +00:00
|
|
|
"../utils/dartdevc:dartdevc_platform",
|
2020-06-16 23:37:36 +00:00
|
|
|
"../utils/dartdevc:dartdevc_platform_sound",
|
|
|
|
]
|
2020-07-14 00:09:29 +00:00
|
|
|
sources = [
|
|
|
|
"$root_out_dir/ddc_outline_sound.dill",
|
|
|
|
"$root_out_dir/ddc_platform.dill",
|
|
|
|
"$root_out_dir/ddc_platform_sound.dill",
|
|
|
|
]
|
2020-06-16 23:37:36 +00:00
|
|
|
outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
|
|
|
|
}
|
|
|
|
|
2018-01-10 17:56:14 +00:00
|
|
|
# This rule copies DDK's JS SDK and require.js to lib/dev_compiler/kernel/amd.
|
|
|
|
copy("copy_dev_compiler_js_amd_kernel") {
|
|
|
|
visibility = [ ":copy_dev_compiler_js" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ "../utils/dartdevc:dartdevc_kernel_sdk" ]
|
2019-09-17 23:19:20 +00:00
|
|
|
gen_dir =
|
|
|
|
get_label_info("../utils/dartdevc:dartdevc_kernel_sdk", "target_gen_dir")
|
2018-01-10 17:56:14 +00:00
|
|
|
sources = [
|
|
|
|
"$gen_dir/kernel/amd/dart_sdk.js",
|
|
|
|
"$gen_dir/kernel/amd/dart_sdk.js.map",
|
|
|
|
"../third_party/requirejs/require.js",
|
|
|
|
]
|
|
|
|
outputs = [
|
|
|
|
"$root_out_dir/dart-sdk/lib/dev_compiler/kernel/amd/{{source_file_part}}",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
# This rule copies DDK's JS SDK to lib/dev_compiler/kernel/common.
|
|
|
|
copy("copy_dev_compiler_js_common_kernel") {
|
|
|
|
visibility = [ ":copy_dev_compiler_js" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ "../utils/dartdevc:dartdevc_kernel_sdk" ]
|
2019-09-17 23:19:20 +00:00
|
|
|
gen_dir =
|
|
|
|
get_label_info("../utils/dartdevc:dartdevc_kernel_sdk", "target_gen_dir")
|
2018-01-10 17:56:14 +00:00
|
|
|
sources = [
|
|
|
|
"$gen_dir/kernel/common/dart_sdk.js",
|
|
|
|
"$gen_dir/kernel/common/dart_sdk.js.map",
|
|
|
|
"../pkg/dev_compiler/lib/js/common/run.js",
|
|
|
|
]
|
2020-02-25 07:16:10 +00:00
|
|
|
outputs = [ "$root_out_dir/dart-sdk/lib/dev_compiler/kernel/common/{{source_file_part}}" ]
|
2018-01-10 17:56:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# This rule copies DDK's JS SDK to lib/dev_compiler/kernel/es6.
|
|
|
|
copy("copy_dev_compiler_js_es6_kernel") {
|
|
|
|
visibility = [ ":copy_dev_compiler_js" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ "../utils/dartdevc:dartdevc_kernel_sdk" ]
|
2019-09-17 23:19:20 +00:00
|
|
|
gen_dir =
|
|
|
|
get_label_info("../utils/dartdevc:dartdevc_kernel_sdk", "target_gen_dir")
|
2018-01-10 17:56:14 +00:00
|
|
|
sources = [
|
|
|
|
"$gen_dir/kernel/es6/dart_sdk.js",
|
|
|
|
"$gen_dir/kernel/es6/dart_sdk.js.map",
|
|
|
|
]
|
|
|
|
outputs = [
|
|
|
|
"$root_out_dir/dart-sdk/lib/dev_compiler/kernel/es6/{{source_file_part}}",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2017-11-20 23:24:07 +00:00
|
|
|
# Copies all of the JS artifacts needed by DDC.
|
|
|
|
group("copy_dev_compiler_js") {
|
2019-10-04 10:11:30 +00:00
|
|
|
visibility = [
|
|
|
|
":copy_dev_compiler_sdk",
|
|
|
|
":copy_dev_compiler_tools",
|
|
|
|
]
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps = [
|
2018-01-10 17:56:14 +00:00
|
|
|
":copy_dev_compiler_js_amd_kernel",
|
|
|
|
":copy_dev_compiler_js_common_kernel",
|
|
|
|
":copy_dev_compiler_js_es6_kernel",
|
2017-11-20 23:24:07 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-10-04 10:11:30 +00:00
|
|
|
# This rule copies tools to go along with ddc.
|
|
|
|
copy("copy_dev_compiler_tools") {
|
|
|
|
visibility = [ ":copy_dev_compiler_sdk" ]
|
|
|
|
deps = [
|
|
|
|
":copy_dev_compiler_js",
|
|
|
|
"../utils/dartdevc:stack_trace_mapper",
|
|
|
|
]
|
2019-10-05 00:27:22 +00:00
|
|
|
dart_out =
|
|
|
|
get_label_info("../utils/dartdevc:stack_trace_mapper", "root_out_dir")
|
2020-02-25 07:16:10 +00:00
|
|
|
sources = [ "$dart_out/dev_compiler/build/web/dart_stack_trace_mapper.js" ]
|
|
|
|
outputs =
|
|
|
|
[ "$root_out_dir/dart-sdk/lib/dev_compiler/web/{{source_file_part}}" ]
|
2019-10-04 10:11:30 +00:00
|
|
|
}
|
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# This is the main rule for copying ddc's dependencies to lib/
|
|
|
|
group("copy_dev_compiler_sdk") {
|
|
|
|
visibility = [ ":create_full_sdk" ]
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps = [
|
2020-07-14 00:09:29 +00:00
|
|
|
":copy_dev_compiler_dills",
|
2017-05-21 06:30:06 +00:00
|
|
|
":copy_dev_compiler_js",
|
2019-10-04 10:11:30 +00:00
|
|
|
":copy_dev_compiler_tools",
|
2020-07-14 00:09:29 +00:00
|
|
|
":copy_dev_compiler_weak_outline",
|
2017-05-21 06:30:06 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
# This rule copies header files to include/
|
|
|
|
copy("copy_headers") {
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
|
|
|
sources = [
|
|
|
|
"../runtime/include/dart_api.h",
|
[vm/ffi] Expose a subset of dart_(native_)api.h for dynamic linking.
This CL introduces dart_api_dl.h which exposes a subset of dart_api.h
and dart_native_api.h for dynamic linking at runtime through the FFI.
Dynamic linking is done through including dart_api_dl.cc in a shared
library and passing NativeApi.initializeApiDLData to the init function.
This CL also includes Native API versioning to deal with possible
version skew between native api version against which native libraries
are compiled and the version in the DartVM the code is run on.
The subset of symbols in the CL includes handle related symbols, error
related symbols, handle scope symbols, and native port sumbols.
Design: http://go/dart-ffi-expose-dart-api
Closes: https://github.com/dart-lang/sdk/issues/40607
Closes: https://github.com/dart-lang/sdk/issues/36858
Closes: https://github.com/dart-lang/sdk/issues/41319
Closes: https://github.com/flutter/flutter/issues/46887
Closes: https://github.com/flutter/flutter/issues/47061
Misc:
Closes: https://github.com/dart-lang/sdk/issues/42260
Change-Id: I9e557808dbc99b341f23964cbddbb05f26d7a6c5
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145592
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-18 07:30:43 +00:00
|
|
|
"../runtime/include/dart_api_dl.h",
|
2017-05-21 06:30:06 +00:00
|
|
|
"../runtime/include/dart_native_api.h",
|
|
|
|
"../runtime/include/dart_tools_api.h",
|
[vm/ffi] Expose a subset of dart_(native_)api.h for dynamic linking.
This CL introduces dart_api_dl.h which exposes a subset of dart_api.h
and dart_native_api.h for dynamic linking at runtime through the FFI.
Dynamic linking is done through including dart_api_dl.cc in a shared
library and passing NativeApi.initializeApiDLData to the init function.
This CL also includes Native API versioning to deal with possible
version skew between native api version against which native libraries
are compiled and the version in the DartVM the code is run on.
The subset of symbols in the CL includes handle related symbols, error
related symbols, handle scope symbols, and native port sumbols.
Design: http://go/dart-ffi-expose-dart-api
Closes: https://github.com/dart-lang/sdk/issues/40607
Closes: https://github.com/dart-lang/sdk/issues/36858
Closes: https://github.com/dart-lang/sdk/issues/41319
Closes: https://github.com/flutter/flutter/issues/46887
Closes: https://github.com/flutter/flutter/issues/47061
Misc:
Closes: https://github.com/dart-lang/sdk/issues/42260
Change-Id: I9e557808dbc99b341f23964cbddbb05f26d7a6c5
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145592
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-18 07:30:43 +00:00
|
|
|
"../runtime/include/dart_version.h",
|
|
|
|
"../runtime/include/internal/dart_api_dl_impl.h",
|
2017-05-21 06:30:06 +00:00
|
|
|
]
|
2020-02-25 07:16:10 +00:00
|
|
|
outputs = [ "$root_out_dir/dart-sdk/include/{{source_file_part}}" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
|
|
|
|
2018-03-22 23:07:55 +00:00
|
|
|
# This rule copies libraries.json files to lib/
|
|
|
|
copy("copy_libraries_specification") {
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
sources = [ "lib/libraries.json" ]
|
|
|
|
deps = [ ":copy_libraries" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/lib/{{source_file_part}}" ]
|
2018-03-22 23:07:55 +00:00
|
|
|
}
|
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# This is the main rule to copy libraries in _platform_sdk_libraries to lib/
|
|
|
|
group("copy_platform_sdk_libraries") {
|
|
|
|
visibility = [
|
2020-05-12 23:37:19 +00:00
|
|
|
":_create_platform_sdk",
|
2017-05-21 06:30:06 +00:00
|
|
|
":copy_libraries",
|
|
|
|
]
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps = []
|
2017-05-21 06:30:06 +00:00
|
|
|
foreach(library, _platform_sdk_libraries) {
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps += [ ":copy_${library}_library" ]
|
2017-05-11 16:46:13 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# This is the main rule to copy libraries in _full_sdk_libraries to lib/
|
|
|
|
group("copy_full_sdk_libraries") {
|
|
|
|
visibility = [
|
|
|
|
":create_full_sdk",
|
|
|
|
":copy_libraries",
|
|
|
|
]
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps = []
|
2017-05-21 06:30:06 +00:00
|
|
|
foreach(library, _full_sdk_libraries) {
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps += [ ":copy_${library}_library" ]
|
2017-05-11 16:46:13 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
group("copy_libraries") {
|
|
|
|
if (dart_platform_sdk) {
|
2020-02-25 07:16:10 +00:00
|
|
|
public_deps = [ ":copy_platform_sdk_libraries" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
} else {
|
2020-02-25 07:16:10 +00:00
|
|
|
public_deps = [ ":copy_full_sdk_libraries" ]
|
2017-04-19 16:00:12 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# This rule writes the version file.
|
|
|
|
action("write_version_file") {
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2017-11-20 23:24:07 +00:00
|
|
|
inputs = [
|
|
|
|
"../tools/VERSION",
|
2019-12-19 23:12:53 +00:00
|
|
|
"$default_git_folder/logs/HEAD",
|
2017-11-20 23:24:07 +00:00
|
|
|
]
|
2017-05-21 06:30:06 +00:00
|
|
|
output = "$root_out_dir/dart-sdk/version"
|
2020-02-25 07:16:10 +00:00
|
|
|
outputs = [ output ]
|
2017-05-21 06:30:06 +00:00
|
|
|
script = "../tools/write_version_file.py"
|
|
|
|
args = [
|
|
|
|
"--output",
|
|
|
|
rebase_path(output),
|
|
|
|
]
|
|
|
|
}
|
2017-05-11 16:46:13 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# This rule writes the revision file.
|
|
|
|
action("write_revision_file") {
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
inputs = [ "$default_git_folder/logs/HEAD" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
output = "$root_out_dir/dart-sdk/revision"
|
2020-02-25 07:16:10 +00:00
|
|
|
outputs = [ output ]
|
2017-05-21 06:30:06 +00:00
|
|
|
script = "../tools/write_revision_file.py"
|
|
|
|
args = [
|
|
|
|
"--output",
|
|
|
|
rebase_path(output),
|
|
|
|
]
|
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# Copy libraries.dart to lib/_internal/libraries.dart for backwards
|
|
|
|
# compatibility.
|
|
|
|
#
|
|
|
|
# TODO(sigmund): stop copying libraries.dart. Old versions (<=0.25.1-alpha.4)
|
|
|
|
# of the analyzer package do not support the new location of this file. We
|
|
|
|
# should be able to remove the old file once we release a newer version of
|
|
|
|
# analyzer and popular frameworks have migrated to use it.
|
|
|
|
copy("copy_libraries_dart") {
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
deps = [ ":copy_libraries" ]
|
|
|
|
sources = [ "lib/_internal/sdk_library_metadata/lib/libraries.dart" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# This rule copies the README file.
|
|
|
|
copy("copy_readme") {
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
sources = [ "../README.dart-sdk" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/README" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# This rule copies the LICENSE file.
|
|
|
|
copy("copy_license") {
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
sources = [ "../LICENSE" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/LICENSE" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
|
|
|
|
2019-02-07 18:46:31 +00:00
|
|
|
# This rule generates a custom dartdoc_options.yaml file.
|
|
|
|
action("write_dartdoc_options") {
|
2018-03-27 16:19:34 +00:00
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
inputs = [ "$default_git_folder/logs/HEAD" ]
|
2019-02-07 18:46:31 +00:00
|
|
|
output = "$root_out_dir/dart-sdk/dartdoc_options.yaml"
|
2020-02-25 07:16:10 +00:00
|
|
|
outputs = [ output ]
|
2019-02-07 18:46:31 +00:00
|
|
|
script = "../tools/write_dartdoc_options_file.py"
|
|
|
|
args = [
|
|
|
|
"--output",
|
|
|
|
rebase_path(output),
|
2018-03-27 16:19:34 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# This rule copies the API readme file to lib/
|
|
|
|
copy("copy_api_readme") {
|
|
|
|
visibility = [ ":create_common_sdk" ]
|
2020-02-25 07:16:10 +00:00
|
|
|
sources = [ "api_readme.md" ]
|
|
|
|
outputs = [ "$root_out_dir/dart-sdk/lib/api_readme.md" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Parts common to both platform and full SDKs.
|
|
|
|
group("create_common_sdk") {
|
2020-05-12 23:37:19 +00:00
|
|
|
visibility = [
|
|
|
|
":create_sdk",
|
|
|
|
":create_platform_sdk",
|
|
|
|
]
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps = [
|
2017-05-21 06:30:06 +00:00
|
|
|
":copy_analysis_summaries",
|
|
|
|
":copy_api_readme",
|
|
|
|
":copy_dart",
|
|
|
|
":copy_dartdoc_files",
|
|
|
|
":copy_headers",
|
|
|
|
":copy_libraries_dart",
|
2018-03-22 23:07:55 +00:00
|
|
|
":copy_libraries_specification",
|
2019-09-17 23:19:20 +00:00
|
|
|
":copy_license",
|
2017-05-21 06:30:06 +00:00
|
|
|
":copy_readme",
|
2017-12-20 23:57:25 +00:00
|
|
|
":copy_vm_dill_files",
|
2019-02-07 18:46:31 +00:00
|
|
|
":write_dartdoc_options",
|
2017-05-21 06:30:06 +00:00
|
|
|
":write_revision_file",
|
|
|
|
":write_version_file",
|
|
|
|
]
|
2019-11-04 12:01:56 +00:00
|
|
|
|
|
|
|
# We do not support AOT on ia32 and should therefore not add the
|
|
|
|
# dart2native script (since there is no AOT compiler/runtime available)
|
2020-06-17 16:12:26 +00:00
|
|
|
if (dart_target_arch != "ia32") {
|
2019-11-04 12:01:56 +00:00
|
|
|
public_deps += [ ":copy_dart2native" ]
|
|
|
|
}
|
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
if (is_win) {
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps += [ ":copy_7zip" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
2019-07-31 13:56:39 +00:00
|
|
|
if (target_cpu == "x64") {
|
2019-08-01 23:05:45 +00:00
|
|
|
public_deps += [
|
|
|
|
":copy_language_model",
|
|
|
|
":copy_libtensorflowlite_c",
|
|
|
|
]
|
2019-07-31 13:56:39 +00:00
|
|
|
}
|
2017-05-21 06:30:06 +00:00
|
|
|
}
|
2017-05-19 20:21:49 +00:00
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# Parts specific to the platform SDK.
|
2020-05-12 23:37:19 +00:00
|
|
|
group("_create_platform_sdk") {
|
|
|
|
visibility = [
|
|
|
|
":create_sdk",
|
|
|
|
":create_platform_sdk",
|
|
|
|
]
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps = [
|
2017-05-21 06:30:06 +00:00
|
|
|
":copy_platform_sdk_libraries",
|
|
|
|
":copy_platform_sdk_scripts",
|
|
|
|
":copy_platform_sdk_snapshots",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Parts specific to the full SDK.
|
|
|
|
group("create_full_sdk") {
|
2017-09-21 19:21:25 +00:00
|
|
|
visibility = [ ":create_sdk" ]
|
2017-05-24 16:59:57 +00:00
|
|
|
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps = [
|
2017-11-21 18:34:30 +00:00
|
|
|
":copy_dart2js_dill_files",
|
2017-05-21 06:30:06 +00:00
|
|
|
":copy_dev_compiler_sdk",
|
|
|
|
":copy_full_sdk_libraries",
|
|
|
|
":copy_full_sdk_scripts",
|
|
|
|
":copy_full_sdk_snapshots",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2020-05-12 23:37:19 +00:00
|
|
|
# Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries.
|
|
|
|
group("create_platform_sdk") {
|
|
|
|
public_deps = [
|
|
|
|
":_create_platform_sdk",
|
|
|
|
":create_common_sdk",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2017-05-21 06:30:06 +00:00
|
|
|
# The main target to depend on from ../BUILD.gn
|
|
|
|
group("create_sdk") {
|
2020-02-25 07:16:10 +00:00
|
|
|
public_deps = [ ":create_common_sdk" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
if (dart_platform_sdk) {
|
2020-05-12 23:37:19 +00:00
|
|
|
public_deps += [ ":_create_platform_sdk" ]
|
2017-05-21 06:30:06 +00:00
|
|
|
} else {
|
2018-04-24 16:03:45 +00:00
|
|
|
public_deps += [ ":create_full_sdk" ]
|
2017-05-19 20:21:49 +00:00
|
|
|
}
|
2017-04-19 16:00:12 +00:00
|
|
|
}
|
2019-05-02 22:30:49 +00:00
|
|
|
|
|
|
|
# Same as create_sdk, but with abi version files.
|
|
|
|
group("create_sdk_with_abi_versions") {
|
|
|
|
public_deps = [
|
|
|
|
":copy_abi_dill_files",
|
|
|
|
":create_sdk",
|
|
|
|
]
|
|
|
|
}
|