blob: 83b8a3bb90aca7af528ce631fcb9851e75ad2ccb [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")
group("dart_allowlist") {
# ________ _________ ________ ________
# |\ ____\|\___ ___\\ __ \|\ __ \
# \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \
# \ \_____ \ \ \ \ \ \ \\\ \ \ ____\
# \|____|\ \ \ \ \ \ \ \\\ \ \ \___|
# ____\_\ \ \ \__\ \ \_______\ \__\
# |\_________\ \|__| \|_______|\|__|
# \|_________|
#
# This allowlist is set up as part of RFC-0176: Disallow New Dart
# programs in the Fuchsia Source Tree.
# https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0176_disallow_new_dart_programs
#
# This contains the full list of dart_libraries in the build.
# If you add a new dart program, you must add it to this list.
#
# To add targets to this allowlist, please send a change to one of the OWNERS
# of this file.
#
# We will ignore variance in targets added/deleted from //third_part/dart-pkg, //sdk/fidl, and //src/tests/end_to_end/perf*.
# To regenerate:
# fx gn refs $(fx get-build-dir) :*(//build/dart:dartlang) | sed -e 's|\([^:]*\):.*|"\1:*",|' -e '/^["//]/!d' -e '/third_party\/dart-pkg*/d' -e '/src\/tests\/end_to_end\/perf*/d' | sort | uniq
visibility = [
"//build/dart/kernel/tests:*",
"//build/dart/sdk/detect_api_changes:*",
"//build/flutter/internal/build_test_bootstrap:*",
"//examples/components/realm_builder:*",
"//examples/components/routing/fidl:*",
"//examples/diagnostics/inspect/codelab/dart:*",
"//examples/diagnostics/inspect/codelab/dart/client:*",
"//examples/diagnostics/inspect/codelab/dart/fizzbuzz:*",
"//examples/diagnostics/inspect/codelab/dart/part_1:*",
"//examples/diagnostics/inspect/codelab/dart/part_2:*",
"//examples/diagnostics/inspect/codelab/dart/part_3:*",
"//examples/diagnostics/inspect/codelab/dart/part_4:*",
"//examples/diagnostics/inspect/codelab/dart/part_5:*",
"//examples/diagnostics/inspect/codelab/dart/testing:*",
"//examples/diagnostics/inspect/codelab/fidl:*",
"//examples/fidl/dart/client:*",
"//examples/fidl/dart/fidl_packages:*",
"//examples/fidl/dart/request_pipelining/client:*",
"//examples/fidl/dart/request_pipelining/server:*",
"//examples/fidl/dart/server:*",
"//examples/fidl/fuchsia.examples:*",
"//scripts/fxtest:*",
"//scripts/fxutils:*",
"//scripts/status:*",
"//sdk/dart/fidl:*",
"//sdk/dart/fuchsia:*",
"//sdk/dart/fuchsia_component_test:*",
"//sdk/dart/fuchsia_inspect:*",
"//sdk/dart/fuchsia_inspect/test/integration:*",
"//sdk/dart/fuchsia_inspect/test/validator_puppet:*",
"//sdk/dart/fuchsia_internationalization_flutter:*",
"//sdk/dart/fuchsia_logger:*",
"//sdk/dart/fuchsia_logger/test/integration:*",
"//sdk/dart/fuchsia_scenic:*",
"//sdk/dart/fuchsia_scenic_flutter:*",
"//sdk/dart/fuchsia_services:*",
"//sdk/dart/fuchsia_services/test_support:*",
"//sdk/dart/fuchsia_vfs:*",
"//sdk/dart/fuchsia_view:*",
"//sdk/dart/zircon:*",
"//sdk/testing/fidl/protocols_tests:*",
"//sdk/testing/sl4f/client:*",
"//sdk/testing/sl4f/flutter_driver_sl4f:*",
"//src/diagnostics/lib/streams/dart:*",
"//src/diagnostics/validator/inspect/fidl:*",
"//src/diagnostics/validator/logs/encoding/fidl:*",
"//src/diagnostics/validator/logs/encoding/puppet/dart:*",
"//src/experiences/bin/ermine_testserver:*",
"//src/experiences/bin/feedback:*",
"//src/experiences/bin/settings/license:*",
"//src/experiences/bin/settings/shell:*",
"//src/experiences/examples/hello_experiences:*",
"//src/experiences/examples/localized_flutter/localized_flutter_app:*",
"//src/experiences/examples/localized_flutter/localized_flutter_localization:*",
"//src/experiences/lib/ermine_localhost:*",
"//src/experiences/lib/ermine_ui:*",
"//src/experiences/session_shells/ermine/fidl:*",
"//src/experiences/session_shells/ermine/internationalization:*",
"//src/experiences/session_shells/ermine/keyboard_shortcuts:*",
"//src/experiences/session_shells/ermine/login:*",
"//src/experiences/session_shells/ermine/session:*",
"//src/experiences/session_shells/ermine/shell:*",
"//src/experiences/session_shells/ermine/utils:*",
"//src/experiences/tests:*",
"//src/experiences/tests/chrome:*",
"//src/experiences/tests/e2e:*",
"//src/experiences/tests/performance:*",
"//src/flutter/lib/fuchsia_test_helper:*",
"//src/flutter/sky_engine:*",
"//src/lib/diagnostics/inspect/dart/bench:*",
"//src/lib/fidl/dart/gidl:*",
"//src/testing/fidl:*",
"//src/tests/benchmarks/fidl/benchmark_suite:*",
"//src/tests/benchmarks/fidl/dart:*",
"//src/tests/end_to_end/copy_files:*",
"//src/tests/end_to_end/diagnostics:*",
"//src/tests/end_to_end/fidlcat:*",
"//src/tests/end_to_end/package_manager:*",
"//src/tests/end_to_end/package_manager/util/net:*",
"//src/tests/end_to_end/package_manager/util/pkg:*",
"//src/tests/end_to_end/package_manager/util/pm:*",
"//src/tests/end_to_end/screen_is_not_black:*",
"//src/tests/end_to_end/sl4f:*",
"//src/tests/end_to_end/snapshot:*",
"//src/tests/end_to_end/time_sync:*",
"//src/tests/fidl/client_suite/dart:*",
"//src/tests/fidl/client_suite/fidl:*",
"//src/tests/fidl/compatibility/dart:*",
"//src/tests/fidl/compatibility/fidl:*",
"//src/tests/fidl/conformance_suite:*",
"//src/tests/fidl/dangerous_identifiers:*",
"//src/tests/fidl/dart_bindings_test:*",
"//src/tests/fidl/dart_bindings_test/fidl:*",
"//src/tests/fidl/server_suite/dart:*",
"//src/tests/fidl/server_suite/fidl:*",
"//src/tests/fidl/source_compatibility/bits-flexible-strict:*",
"//src/tests/fidl/source_compatibility/bits-member-add:*",
"//src/tests/fidl/source_compatibility/bits-member-remove:*",
"//src/tests/fidl/source_compatibility/bits-strict-flexible:*",
"//src/tests/fidl/source_compatibility/enum-flexible-strict:*",
"//src/tests/fidl/source_compatibility/enum-member-add:*",
"//src/tests/fidl/source_compatibility/enum-member-remove:*",
"//src/tests/fidl/source_compatibility/enum-strict-flexible:*",
"//src/tests/fidl/source_compatibility/protocol-event-add:*",
"//src/tests/fidl/source_compatibility/protocol-event-remove:*",
"//src/tests/fidl/source_compatibility/protocol-method-add:*",
"//src/tests/fidl/source_compatibility/protocol-method-remove:*",
"//src/tests/fidl/source_compatibility/table-member-add:*",
"//src/tests/fidl/source_compatibility/table-member-remove:*",
"//src/tests/fidl/source_compatibility/union-flexible-strict:*",
"//src/tests/fidl/source_compatibility/union-member-add:*",
"//src/tests/fidl/source_compatibility/union-member-remove:*",
"//src/tests/fidl/source_compatibility/union-strict-flexible:*",
"//src/tests/intl/timestamp-server-dart:*",
"//tools/blobstats:*",
"//tools/dart-strict-deps:*",
"//tools/dart-strict-deps/library:*",
"//tools/doc_checker:*",
"//tools/protobuf/protoc_gen_dart:*",
"//tools/zedmon/client:*",
"//zircon/vdso/zx:*",
]
# TODO(fxb/108758): Figure out how to make this appear in list of regenerated targets using above command.
# Update guidance above as necessary.
visibility += [ "//sdk/testing/gcloud_lib:gcloud_lib" ]
# We will allow everything under //sdk/fidl for now so that we don't mess with the
# fidl team's workflow too much. When the time comes, we will get rid of the dart
# deps here all at once.
visibility += [
"//sdk/fidl/*",
"//src/tests/fidl/source_compatibility/*",
"//tools/fidl/fidlc/testdata/*",
]
# In line with the incrementality design principle we will include a wild-card entry
# in the allowlist for performance testing; this wild-card entry will allow addition of
# new performance tests inside of "//src/tests/end_to_end/perf".
visibility += [ "//src/tests/end_to_end/perf:*" ]
# Third_party dart programs/libraries must continue to be built as dart libraries.
visibility += [
"//third_party/dart-pkg/git/flutter/*",
"//third_party/dart-pkg/pub/*",
]
# Catch-all for //vendor/google.
visibility += [ "//vendor/google/*" ]
}
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" ]
}
# 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)",
]
}
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/*",
]
}