| # 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/toolchain/basic_toolchain.gni") |
| import("//build/toolchain/concurrent_jobs.gni") |
| |
| declare_args() { |
| # Maximum number of Dart processes to run in parallel. |
| # |
| # Dart analyzer uses a lot of memory which may cause issues when building |
| # with many parallel jobs e.g. when using goma. To avoid out-of-memory |
| # errors we explicitly reduce the number of jobs. |
| concurrent_dart_jobs = default_concurrent_jobs.dart |
| } |
| |
| group("disable_strict_deps_check_allowlist") { |
| # ________ _________ ________ ________ |
| # |\ ____\|\___ ___\\ __ \|\ __ \ |
| # \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ |
| # \ \_____ \ \ \ \ \ \ \\\ \ \ ____\ |
| # \|____|\ \ \ \ \ \ \ \\\ \ \ \___| |
| # ____\_\ \ \ \__\ \ \_______\ \__\ |
| # |\_________\ \|__| \|_______|\|__| |
| # \|_________| |
| # This is an allowlist of packages that do not pass the Dart strict deps |
| # check, i.e. they import packages but do not specify them as GN deps. |
| # This is only intended to be used as a temporary allowlist. Do not add to this list. |
| visibility = |
| [ "//topaz/tools/protobuf/protoc_gen_dart:protoc_gen_dart_dart_library" ] |
| } |
| |
| # Copies the patched SDK files for the dart runner |
| # NOTE: copies to an _nnbd directory to allow for soft transition |
| 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_nnbd/{{source_file_part}}" ] |
| } |
| |
| if (current_toolchain == dart_toolchain) { |
| pool("dart_pool") { |
| depth = concurrent_dart_jobs |
| } |
| } else { |
| # 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 |
| } |
| } |