blob: c5511d3c9f3aba8e2e9a2fc08c9f1d044c6b2c24 [file] [log] [blame]
# Copyright 2017 The Fuchsia Authors. 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/toolchain.gni")
import("//build/python/python_binary.gni")
import("//build/python/python_host_test.gni")
import("//build/toolchain/basic_toolchain.gni")
import("//build/toolchain/concurrent_jobs.gni")
python_binary("gen_dart_package_config") {
main_source = "gen_dart_package_config.py"
deps = [ "//third_party/pyyaml:yaml" ]
}
python_binary("run_analysis") {
main_source = "run_analysis.py"
deps = [ "//third_party/pyyaml:yaml" ]
}
python_binary("gen_meta_file") {
main_source = "sdk/gen_meta_file.py"
deps = [ "//third_party/pyyaml:yaml" ]
}
# TODO(fxb/58062): Delete after all packages are migrated away from dart_app
# and flutter_app.
group("deprecated_dart_app_allowlist") {
# ________ _________ ________ ________
# |\ ____\|\___ ___\\ __ \|\ __ \
# \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \
# \ \_____ \ \ \ \ \ \ \\\ \ \ ____\
# \|____|\ \ \ \ \ \ \ \\\ \ \ \___|
# ____\_\ \ \ \__\ \ \_______\ \__\
# |\_________\ \|__| \|_______|\|__|
# \|_________|
# This is an allowlist of packages that have not migrated to use dart_component.
# This is only intended to be used as a temporary allowlist. Do not add to this list.
allowlist = [
"//examples/diagnostics/inspect/codelab/dart/client:bin",
"//examples/diagnostics/inspect/codelab/dart/fizzbuzz:bin",
"//examples/diagnostics/inspect/codelab/dart/part_1:bin",
"//examples/diagnostics/inspect/codelab/dart/part_2:bin",
"//examples/diagnostics/inspect/codelab/dart/part_3:bin",
"//examples/diagnostics/inspect/codelab/dart/part_4:bin",
"//examples/diagnostics/inspect/codelab/dart/part_5:bin",
"//examples/fidl/dart/client:echo-dart-client",
"//examples/fidl/dart/request_pipelining/client:echo-launcher-dart-client",
"//examples/fidl/dart/request_pipelining/server:echo-launcher-dart-server",
"//examples/fidl/dart/server:echo-dart-server",
"//sdk/dart/fuchsia_inspect/test/integration:dart-inspect-vmo-test-writer",
"//sdk/dart/fuchsia_inspect/test/validator_puppet:dart-inspect-validator-puppet",
"//sdk/dart/fuchsia_services/test_support:fuchsia-services-foo-test-server",
"//src/diagnostics/validator/logs/encoding/puppet/dart:log-validator-dart-puppet",
"//src/lib/diagnostics/inspect/dart/bench:dart-inspect-benchmarks",
"//src/tests/intl/timestamp-server-dart:timestamp-server-dart",
]
visibility = []
foreach(target, allowlist) {
visibility += [
target,
target + ".pm",
target + "_manifest_dist",
target + "_manifest_dist_generate",
target + "_manifest_dist__hermetic_inputs",
target + "_component_manifests",
]
}
}
# Copies the patched SDK files for the dart runner
copy("platform_files") {
sources = [
"//prebuilt/third_party/flutter/$target_cpu/release/aot/dart_runner_patched_sdk/platform_strong.dill",
"//prebuilt/third_party/flutter/$target_cpu/release/aot/dart_runner_patched_sdk/platform_strong.dill.d",
"//prebuilt/third_party/flutter/$target_cpu/release/aot/dart_runner_patched_sdk/vm_outline_strong.dill",
]
outputs = [ "$root_out_dir/dart_runner_patched_sdk/{{source_file_part}}" ]
}
# A toolchain dedicated to processing and analyzing Dart packages.
# The only targets in this toolchain are action() targets, so it
# has no real tools. But every toolchain needs stamp and copy.
basic_toolchain("dartlang") {
expected_label = dart_toolchain
}
if (is_host) {
python_host_test("gen_reference_docs_test") {
main_source = "gen_reference_docs_test.py"
sources = [
"gen_reference_docs.py",
"generate_dart_toc.py",
]
libraries = [ "//third_party/pyyaml:yaml" ]
}
python_host_test("generate_dart_toc_test") {
main_source = "generate_dart_toc_test.py"
sources = [ "generate_dart_toc.py" ]
libraries = [
"//third_party/pyyaml:yaml",
"//third_party/parameterized",
]
}
}
group("tests") {
testonly = true
deps = [
":gen_reference_docs_test($host_toolchain)",
":generate_dart_toc_test($host_toolchain)",
"tests",
]
}
group("custom_analysis_options") {
# ________ _________ ________ ________
# |\ ____\|\___ ___\\ __ \|\ __ \
# \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \
# \ \_____ \ \ \ \ \ \ \\\ \ \ ____\
# \|____|\ \ \ \ \ \ \ \\\ \ \ \___|
# ____\_\ \ \ \__\ \ \_______\ \__\
# |\_________\ \|__| \|_______|\|__|
# \|_________|
# This is an allowlist of dart_libraries with custom analysis options, which
# are dart_libraries that set `options_file`.
#
# Introducing new dart_libraries with custom analysis options is not allowed.
# See more details in https://fxbug.dev/84787.
visibility = [
"//build/flutter/internal/build_test_bootstrap/*",
"//src/tests/benchmarks/fidl/dart/*",
]
}