mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:20:36 +00:00
compile_platform should work when there's no checked-in dart binary.
Change-Id: Ib3338e616b05b9b1a7462c9f484402faca0fc13b Reviewed-on: https://dart-review.googlesource.com/13983 Commit-Queue: Peter von der Ahé <ahe@google.com> Reviewed-by: Zach Anderson <zra@google.com>
This commit is contained in:
parent
b96ac4520a
commit
7e40ae990b
|
@ -16,6 +16,7 @@ import("../../sdk/lib/mirrors/mirrors_sources.gni")
|
|||
import("../../sdk/lib/profiler/profiler_sources.gni")
|
||||
import("../../sdk/lib/typed_data/typed_data_sources.gni")
|
||||
import("../../sdk/lib/vmservice/vmservice_sources.gni")
|
||||
import("../../utils/compile_platform.gni")
|
||||
import("../../utils/generate_patch_sdk.gni")
|
||||
import("../bin/io_sources.gni")
|
||||
import("../lib/async_sources.gni")
|
||||
|
@ -562,9 +563,7 @@ generate_vm_patched_sdk("patched_sdk") {
|
|||
]
|
||||
}
|
||||
|
||||
action("compile_platform") {
|
||||
script = "../../tools/compile_platform.py"
|
||||
|
||||
compile_platform("vm_legacy_platform") {
|
||||
sources = [
|
||||
"$root_out_dir/patched_sdk/lib/libraries.json",
|
||||
]
|
||||
|
@ -574,21 +573,14 @@ action("compile_platform") {
|
|||
"$root_out_dir/vm_outline.dill",
|
||||
]
|
||||
|
||||
inputs = []
|
||||
|
||||
deps = [
|
||||
":patched_sdk",
|
||||
]
|
||||
|
||||
depfile = "$root_out_dir/vm_platform.dill.d"
|
||||
|
||||
args = [ "dart:core" ] + rebase_path(sources, root_build_dir) +
|
||||
rebase_path(outputs, root_build_dir)
|
||||
args = [ "dart:core" ]
|
||||
}
|
||||
|
||||
action("compile_strong_platform") {
|
||||
script = "../../tools/compile_platform.py"
|
||||
|
||||
compile_platform("vm_platform") {
|
||||
sources = [
|
||||
"$root_out_dir/patched_sdk/lib/libraries.json",
|
||||
]
|
||||
|
@ -598,24 +590,17 @@ action("compile_strong_platform") {
|
|||
"$root_out_dir/vm_outline_strong.dill",
|
||||
]
|
||||
|
||||
inputs = []
|
||||
|
||||
deps = [
|
||||
":patched_sdk",
|
||||
]
|
||||
|
||||
depfile = "$root_out_dir/vm_platform_strong.dill.d"
|
||||
|
||||
args = [
|
||||
"--strong-mode",
|
||||
"dart:core",
|
||||
] + rebase_path(sources, root_build_dir) +
|
||||
rebase_path(outputs, root_build_dir)
|
||||
"--strong-mode",
|
||||
"dart:core",
|
||||
]
|
||||
}
|
||||
|
||||
action("compile_vmservice") {
|
||||
script = "../../tools/compile_platform.py"
|
||||
|
||||
compile_platform("vmservice_dill") {
|
||||
sources = [
|
||||
"../../sdk/lib/vmservice_libraries.json",
|
||||
]
|
||||
|
@ -630,23 +615,19 @@ action("compile_vmservice") {
|
|||
]
|
||||
|
||||
deps = [
|
||||
":compile_platform",
|
||||
":vm_legacy_platform",
|
||||
]
|
||||
|
||||
depfile = "$root_out_dir/vmservice_io.dill.d"
|
||||
|
||||
args = [
|
||||
"--platform=" +
|
||||
rebase_path("$root_out_dir/vm_platform.dill", root_build_dir),
|
||||
"dart:vmservice_io",
|
||||
] + rebase_path(sources, root_build_dir) +
|
||||
rebase_path(outputs, root_build_dir)
|
||||
"--platform=" + rebase_path(inputs[0], root_build_dir),
|
||||
"dart:vmservice_io",
|
||||
]
|
||||
}
|
||||
|
||||
group("kernel_platform_files") {
|
||||
public_deps = [
|
||||
":compile_platform",
|
||||
":compile_strong_platform",
|
||||
":compile_vmservice",
|
||||
":vm_legacy_platform",
|
||||
":vm_platform",
|
||||
":vmservice_dill",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ def main():
|
|||
print >> sys.stderr, "ERROR: Can't locate Dart VM executable."
|
||||
return -1
|
||||
|
||||
arguments[0] = os.path.relpath(dart_executable)
|
||||
arguments[0] = os.path.abspath(dart_executable)
|
||||
if verbose:
|
||||
print "Running:", " ".join(arguments)
|
||||
return subprocess.call(arguments)
|
||||
|
|
53
utils/compile_platform.gni
Normal file
53
utils/compile_platform.gni
Normal file
|
@ -0,0 +1,53 @@
|
|||
# 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.
|
||||
|
||||
import("../build/dart_host_toolchain.gni")
|
||||
import("../build/prebuilt_dart_sdk.gni")
|
||||
|
||||
_dart_root = get_path_info("..", "abspath")
|
||||
|
||||
template("compile_platform") {
|
||||
assert(defined(invoker.sources), "Need 'sources' in $target_name")
|
||||
assert(defined(invoker.outputs), "Need 'outputs' in $target_name")
|
||||
assert(defined(invoker.args), "Need 'args' in $target_name")
|
||||
assert(!defined(invoker.script), "Remove 'script' from $target_name")
|
||||
assert(!defined(invoker.depfile), "Remove 'depfile' from $target_name")
|
||||
|
||||
action(target_name) {
|
||||
script = "$_dart_root/tools/compile_platform.py"
|
||||
|
||||
sources = invoker.sources
|
||||
|
||||
outputs = invoker.outputs
|
||||
|
||||
inputs = []
|
||||
deps = []
|
||||
args = []
|
||||
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
}
|
||||
|
||||
if (defined(invoker.inputs)) {
|
||||
inputs += invoker.inputs
|
||||
}
|
||||
|
||||
depfile = outputs[0] + ".d"
|
||||
|
||||
if (!prebuilt_dart_exe_works) {
|
||||
deps += [ "$_dart_root/runtime/bin:dart_bootstrap($dart_host_toolchain)" ]
|
||||
dart_out_dir = get_label_info(
|
||||
"$_dart_root/runtime/bin:dart_bootstrap($dart_host_toolchain)",
|
||||
"root_out_dir")
|
||||
args += [
|
||||
"--dart-executable",
|
||||
rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix"),
|
||||
]
|
||||
}
|
||||
|
||||
args += invoker.args
|
||||
args += rebase_path(sources, root_build_dir)
|
||||
args += rebase_path(outputs, root_build_dir)
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
import("../../build/compiled_action.gni")
|
||||
import("../../build/prebuilt_dart_sdk.gni")
|
||||
import("../../utils/compile_platform.gni")
|
||||
import("../../utils/generate_patch_sdk.gni")
|
||||
import("../create_timestamp.gni")
|
||||
import("../application_snapshot.gni")
|
||||
|
@ -95,9 +96,7 @@ generate_patched_sdk("patched_dart2js_sdk") {
|
|||
]
|
||||
}
|
||||
|
||||
action("compile_dart2js_platform") {
|
||||
script = "../../tools/compile_platform.py"
|
||||
|
||||
compile_platform("compile_dart2js_platform") {
|
||||
sources = [
|
||||
"$root_out_dir/patched_dart2js_sdk/lib/libraries.json",
|
||||
]
|
||||
|
@ -107,17 +106,12 @@ action("compile_dart2js_platform") {
|
|||
"$root_out_dir/dart2js_outline.dill",
|
||||
]
|
||||
|
||||
inputs = []
|
||||
|
||||
deps = [
|
||||
":patched_dart2js_sdk",
|
||||
]
|
||||
|
||||
depfile = "$root_out_dir/dart2js_platform.dill.d"
|
||||
|
||||
args = [
|
||||
"--target=dart2js",
|
||||
"dart:core",
|
||||
] + rebase_path(sources, root_build_dir) +
|
||||
rebase_path(outputs, root_build_dir)
|
||||
"--target=dart2js",
|
||||
"dart:core",
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue