mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:07:11 +00:00
138d587e3a
Some parts of the Dart build need to be customized when running the host steps for a build ultimately targeting a Fuchsia build. This was set by passing a special GN variable indicating that a configuration was a host configuration targeting a Fuchsia build, but the built-in GN variable 'target_os' has the same result as it is the same across all toolchains in a particular build. This replaces the test: is_fuchsia || is_fuchsia_host with the equivalent: target_os == "fuchsia" and the less common: is_fuchsia_host with: target_os != current_os && target_os == "fuchsia" Change-Id: Iabec1fb2879b234ca44c9e03b2f4a62ffbc6fa4a Reviewed-on: https://dart-review.googlesource.com/35542 Reviewed-by: Zach Anderson <zra@google.com> Commit-Queue: Zach Anderson <zra@google.com>
175 lines
3.4 KiB
Text
175 lines
3.4 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/dart_host_sdk_toolchain.gni")
|
|
|
|
targetting_fuchsia = target_os == "fuchsia"
|
|
|
|
# This target will be built if no target is specified when invoking ninja.
|
|
group("default") {
|
|
if (targetting_fuchsia) {
|
|
# Fuchsia has run_vm_tests marked testonly.
|
|
testonly = true
|
|
}
|
|
deps = [
|
|
":runtime",
|
|
]
|
|
}
|
|
|
|
group("most") {
|
|
if (targetting_fuchsia) {
|
|
# Fuchsia has run_vm_tests marked testonly.
|
|
testonly = true
|
|
}
|
|
deps = [
|
|
":analysis_server",
|
|
":create_sdk",
|
|
":dart2js",
|
|
":dartanalyzer",
|
|
":dartdevc",
|
|
":runtime",
|
|
":samples",
|
|
]
|
|
}
|
|
|
|
group("runtime") {
|
|
if (targetting_fuchsia) {
|
|
# Fuchsia has run_vm_tests marked testonly.
|
|
testonly = true
|
|
}
|
|
deps = [
|
|
"runtime/bin:dart",
|
|
"runtime/bin:dart_bootstrap($host_toolchain)",
|
|
"runtime/bin:process_test",
|
|
"runtime/bin:run_vm_tests",
|
|
"runtime/bin:sample_extension",
|
|
"runtime/bin:test_extension",
|
|
]
|
|
}
|
|
|
|
group("runtime_kernel") {
|
|
if (targetting_fuchsia) {
|
|
# Fuchsia has run_vm_tests marked testonly.
|
|
testonly = true
|
|
}
|
|
deps = [
|
|
":runtime",
|
|
"runtime/vm:kernel_platform_files($host_toolchain)",
|
|
|
|
# TODO(rmacnak): Link this into 'dart'.
|
|
"utils/kernel-service:copy_kernel_service_snapshot",
|
|
"utils/kernel-service:kernel-service",
|
|
]
|
|
}
|
|
|
|
group("runtime_precompiled") {
|
|
deps = [
|
|
"runtime/bin:dart_bootstrap($host_toolchain)",
|
|
"runtime/bin:dart_precompiled_runtime",
|
|
"runtime/bin:process_test",
|
|
]
|
|
}
|
|
|
|
group("create_sdk") {
|
|
deps = [
|
|
"sdk:create_sdk",
|
|
]
|
|
}
|
|
|
|
if (defined(dart_host_sdk_toolchain) &&
|
|
dart_host_sdk_toolchain != host_toolchain) {
|
|
group("create_host_sdk") {
|
|
deps = [
|
|
"sdk:create_sdk($dart_host_sdk_toolchain)",
|
|
]
|
|
}
|
|
}
|
|
|
|
group("dart2js") {
|
|
deps = [
|
|
"utils/compiler:dart2js",
|
|
]
|
|
}
|
|
|
|
group("dartanalyzer") {
|
|
deps = [
|
|
"utils/dartanalyzer",
|
|
]
|
|
}
|
|
|
|
group("dartdevc") {
|
|
deps = [
|
|
"utils/dartdevc",
|
|
]
|
|
}
|
|
|
|
group("dartfmt") {
|
|
deps = [
|
|
"utils/dartfmt",
|
|
]
|
|
}
|
|
|
|
group("analysis_server") {
|
|
deps = [
|
|
"utils/analysis_server",
|
|
]
|
|
}
|
|
|
|
# This is the target that is built on the dart2js build bots.
|
|
# It must depend on anything that is required by the dart2js
|
|
# test suites.
|
|
group("dart2js_bot") {
|
|
deps = [
|
|
":create_sdk",
|
|
]
|
|
}
|
|
|
|
group("samples") {
|
|
deps = [
|
|
"runtime/bin:sample_extension",
|
|
]
|
|
}
|
|
|
|
# The rules below build a Fuchsia OS image that includes the Dart tree
|
|
# under /system/test/dart. To get this into the `user.bootfs` generated
|
|
# by the Fuchsia build, add the GN build argument:
|
|
# extra_bootdata = [ "//third_party/dart:dart_test_bootfs" ]
|
|
if (is_fuchsia) {
|
|
import("//build/config/fuchsia/bootdata.gni")
|
|
|
|
action("generate_dart_test_manifest") {
|
|
testonly = true
|
|
|
|
output_prefix = "$target_gen_dir/dart_test_tree"
|
|
outputs = [
|
|
"$output_prefix.manifest",
|
|
]
|
|
|
|
mode = "release"
|
|
if (is_debug) {
|
|
mode = "debug"
|
|
}
|
|
|
|
script = "tools/gen_fuchsia_test_manifest.py"
|
|
args = [
|
|
"-m",
|
|
mode,
|
|
"-o",
|
|
rebase_path(output_prefix),
|
|
]
|
|
}
|
|
|
|
bootdata("dart_test_bootfs") {
|
|
testonly = true
|
|
deps = [
|
|
":generate_dart_test_manifest",
|
|
"runtime/bin:dart",
|
|
"runtime/bin:process_test",
|
|
"runtime/bin:run_vm_tests",
|
|
]
|
|
inputs = [
|
|
"$target_gen_dir/dart_test_tree.manifest",
|
|
]
|
|
}
|
|
}
|