2018-02-27 19:59:19 +00:00
|
|
|
# Copyright (c) 2018, 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.
|
|
|
|
|
2018-05-03 21:07:13 +00:00
|
|
|
import("../build/dart/dart_action.gni")
|
2018-02-27 19:59:19 +00:00
|
|
|
|
|
|
|
_dart_root = get_path_info("..", "abspath")
|
|
|
|
|
|
|
|
# Template to generate entry points JSON file using dart_bootstrap tool.
|
|
|
|
# List of entry points is generated as a by-product while doing precompilation.
|
|
|
|
#
|
|
|
|
# This template expects the following arguments:
|
|
|
|
# - input: Name of the input dart script for precompilation.
|
|
|
|
# - output: Name of the output entry points JSON file.
|
|
|
|
# - extra_args: Extra arguments to pass to dart_bootstrap (optional).
|
|
|
|
#
|
|
|
|
template("generate_entry_points_json_with_dart_bootstrap") {
|
|
|
|
assert(defined(invoker.input), "Must define input dart script")
|
|
|
|
assert(defined(invoker.output), "Must define output json file")
|
|
|
|
extra_args = []
|
|
|
|
if (defined(invoker.extra_args)) {
|
|
|
|
extra_args += invoker.extra_args
|
|
|
|
}
|
2018-05-03 21:07:13 +00:00
|
|
|
dart_bootstrap_action(target_name) {
|
2018-02-27 19:59:19 +00:00
|
|
|
# Printing precompiler entry points is folded into precompilation, so dart_bootstrap is invoked
|
|
|
|
# with correct arguments to generate app-aot snapshot.
|
2018-05-03 21:07:13 +00:00
|
|
|
script = invoker.input
|
2018-02-27 19:59:19 +00:00
|
|
|
output = invoker.output
|
|
|
|
outputs = [
|
|
|
|
output,
|
|
|
|
]
|
2018-05-03 21:07:13 +00:00
|
|
|
vm_args = [
|
2018-06-18 22:31:32 +00:00
|
|
|
"--no-preview-dart-2",
|
2018-02-27 19:59:19 +00:00
|
|
|
"--print-precompiler-entry-points=" + rebase_path(output),
|
|
|
|
"--snapshot=" + rebase_path("$target_gen_dir/dummy.snapshot"),
|
|
|
|
"--snapshot-kind=app-aot",
|
|
|
|
"--use-blobs",
|
|
|
|
"--snapshot-kind=app-aot",
|
2018-05-03 21:07:13 +00:00
|
|
|
] + extra_args
|
|
|
|
args = []
|
2018-02-27 19:59:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Template to copy checked-in extra entry points JSON file.
|
|
|
|
#
|
|
|
|
# This template expects the following argument:
|
|
|
|
# - output: Target destination for the extra entry points JSON file.
|
|
|
|
#
|
|
|
|
template("copy_entry_points_extra_json") {
|
|
|
|
assert(defined(invoker.output), "Must define output json file")
|
|
|
|
copy(target_name) {
|
|
|
|
sources = [ "$_dart_root/pkg/vm/lib/transformations/type_flow/entry_points_extra.json" ]
|
|
|
|
outputs = [ invoker.output ]
|
|
|
|
}
|
|
|
|
}
|