mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
90d3962ca3
Also replace invoke_dart() with compiled_action(), and some other cleanups. fixes #27781 R=johnmccutchan@google.com Review URL: https://codereview.chromium.org/2493833002 .
51 lines
1.5 KiB
Text
51 lines
1.5 KiB
Text
# Copyright (c) 2016, 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.
|
|
|
|
import("//build/compiled_action.gni")
|
|
|
|
_dart_root = rebase_path("..")
|
|
|
|
template("application_snapshot") {
|
|
assert(defined(invoker.main_dart), "Must specify 'main_dart'")
|
|
assert(defined(invoker.training_args), "Must specify 'training_args'")
|
|
main_dart = invoker.main_dart
|
|
training_args = invoker.training_args
|
|
name = target_name
|
|
if (defined(invoker.name)) {
|
|
name = invoker.name
|
|
}
|
|
extra_deps = []
|
|
if (defined(invoker.deps)) {
|
|
extra_deps += invoker.deps
|
|
}
|
|
extra_inputs = []
|
|
if (defined(invoker.inputs)) {
|
|
extra_inputs += invoker.inputs
|
|
}
|
|
compiled_action(target_name) {
|
|
tool = get_path_info("$_dart_root/runtime/bin:dart", "abspath")
|
|
deps = extra_deps + [ "$_dart_root/pkg:pkg_files_stamp" ]
|
|
|
|
inputs = extra_inputs + [
|
|
"$_dart_root/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart",
|
|
"$root_gen_dir/pkg_files.stamp",
|
|
]
|
|
|
|
output = "$root_gen_dir/$name.dart.snapshot"
|
|
outputs = [
|
|
output,
|
|
]
|
|
|
|
dot_packages = rebase_path("$_dart_root/.packages")
|
|
abs_output = rebase_path(output)
|
|
main_file = rebase_path(main_dart)
|
|
|
|
args = [
|
|
"--packages=$dot_packages",
|
|
"--snapshot=$abs_output",
|
|
"--snapshot-kind=app-jit",
|
|
main_file,
|
|
] + training_args
|
|
}
|
|
}
|