From fb4d1819e717f4e236879271b5d91749e9969a89 Mon Sep 17 00:00:00 2001 From: "zijiehe@" <68449066+zijiehe-google-com@users.noreply.github.com> Date: Thu, 14 Mar 2024 19:52:21 -0700 Subject: [PATCH] [Fuchsia] Remove the use of //build/ in fuchsia (flutter/engine#51072) ### Motivation of the change: Both dart and flutter are using fairly outdated gn-sdk without properly maintained. Currently @hjfreyer is working on version'ed IDK / SDK libs which requires changes in gn-sdk to use the right version of the libs in fuchsia/sdk/obj/{arch}-api-{level} rather than the one in the fuchsia/sdk/arch. But current implementation does not support choosing the right version. ### Blocking issue: The new gn-sdk (in flutter/tools/fuchsia/gn-sdk) generates multiple BUILD.gn files rather than a large BUILD.gn the previous version created. So most of the build rules need to switch from the old `fidl:{api}` build rule to `fidl/{api}` rule. The same change will happen in the dart/sdk, i.e. http://go/dart-reviews/356924. But since the two repos cannot have one single atomic change, changing either side first will cause flutter to break. E.g. the linkage error caused by duplicated symbols will happen if we change the dart/sdk first, since in flutter, it will still refer to the old build rules in the middle. ### Solutions: Ideally we can create redirect rules in the current `build/fuchsia` buildroot tree to redirect the old rules into the new one, so we can make the change in the flutter first then dart/sdk. But creating the rules is not trivial and will only be used once. So an alternative solution is - pause the dart/sdk -> flutter roll - submit dart/sdk change (http://go/dart-reviews/356924) - update this change to manually bring the dart/sdk change, namely the `dart_revision` in the DEPS file and signatures in the ci/licences. - resume the dart/sdk -> flutter roll. But it requires this change itself to be reviewed first, and I'd like to know your opinion before moving forward. See corresponding dart/sdk change at http://go/dart-reviews/356924. ### //build/fuchsia/ from buildroot should be removed after this change. Bug: [b/40935282](https://issues.chromium.org/issues/40935282?pli=1&authuser=0) FYI: @hjfreyer [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- DEPS | 37 +++-- .../build/config/fuchsia/gn_configs.gni | 66 ++++---- .../flutter/third_party/googletest/BUILD.gn | 6 +- .../flutter/ci/licenses_golden/excluded_files | 1 - .../flutter/ci/licenses_golden/licenses_dart | 4 +- engine/src/flutter/display_list/BUILD.gn | 11 +- engine/src/flutter/flow/BUILD.gn | 5 +- engine/src/flutter/fml/BUILD.gn | 32 ++-- engine/src/flutter/lib/snapshot/BUILD.gn | 5 +- engine/src/flutter/lib/ui/BUILD.gn | 5 +- engine/src/flutter/shell/common/BUILD.gn | 13 +- engine/src/flutter/shell/platform/BUILD.gn | 2 +- .../flutter/shell/platform/fuchsia/BUILD.gn | 2 +- .../fuchsia/dart-pkg/fuchsia/BUILD.gn | 6 +- .../platform/fuchsia/dart-pkg/zircon/BUILD.gn | 14 +- .../fuchsia/dart-pkg/zircon_ffi/BUILD.gn | 4 +- .../platform/fuchsia/dart_runner/BUILD.gn | 44 ++--- .../fuchsia/dart_runner/fidl/BUILD.gn | 8 +- .../fuchsia/dart_runner/fidl/meta.json | 9 -- .../fuchsia/dart_runner/kernel/BUILD.gn | 2 +- .../tests/startup_integration_test/BUILD.gn | 2 +- .../dart_aot_runner/BUILD.gn | 20 ++- .../dart_echo_server/BUILD.gn | 2 +- .../dart_jit_runner/BUILD.gn | 20 ++- .../fuchsia/dart_runner/vmservice/BUILD.gn | 2 +- .../shell/platform/fuchsia/flutter/BUILD.gn | 81 +++++----- .../platform/fuchsia/flutter/kernel/BUILD.gn | 2 +- .../fuchsia/flutter/tests/fakes/BUILD.gn | 6 +- .../flutter/tests/fakes/scenic/BUILD.gn | 16 +- .../flutter/tests/integration/BUILD.gn | 2 +- .../tests/integration/embedder/BUILD.gn | 32 ++-- .../integration/embedder/child-view/BUILD.gn | 2 +- .../integration/embedder/parent-view/BUILD.gn | 2 +- .../tests/integration/mouse-input/BUILD.gn | 48 +++--- .../mouse-input/mouse-input-view/BUILD.gn | 2 +- .../tests/integration/text-input/BUILD.gn | 38 ++--- .../text-input/text-input-view/BUILD.gn | 2 +- .../tests/integration/touch-input/BUILD.gn | 48 +++--- .../embedding-flutter-view/BUILD.gn | 2 +- .../touch-input/touch-input-view/BUILD.gn | 2 +- .../flutter/tests/integration/utils/BUILD.gn | 33 ++-- .../fuchsia/runtime/dart/utils/BUILD.gn | 30 ++-- engine/src/flutter/shell/testing/BUILD.gn | 5 +- engine/src/flutter/skia/BUILD.gn | 12 +- .../flutter/sky/packages/sky_engine/BUILD.gn | 5 +- .../flutter/sky/packages/sky_engine/LICENSE | 2 +- .../third_party/libjpeg-turbo/BUILD.gn | 4 +- engine/src/flutter/third_party/txt/BUILD.gn | 9 +- .../src/flutter/tools/fuchsia/dart/BUILD.gn | 2 +- .../src/flutter/tools/fuchsia/fidl/BUILD.gn | 24 --- .../src/flutter/tools/fuchsia/fidl/fidl.gni | 48 ------ .../tools/fuchsia/fidl/fidl_library.gni | 151 ------------------ .../tools/fuchsia/fidl/gen_response_file.py | 52 ------ .../flutter/tools/fuchsia/fidl/toolchain.gni | 5 - .../flutter/tools/fuchsia/fuchsia_archive.gni | 1 - .../flutter/tools/fuchsia/sdk/sdk_targets.gni | 28 +--- engine/src/flutter/tools/fuchsia/with_envs.py | 3 + engine/src/flutter/vulkan/BUILD.gn | 4 +- 58 files changed, 377 insertions(+), 648 deletions(-) delete mode 100644 engine/src/flutter/shell/platform/fuchsia/dart_runner/fidl/meta.json delete mode 100644 engine/src/flutter/tools/fuchsia/fidl/BUILD.gn delete mode 100644 engine/src/flutter/tools/fuchsia/fidl/fidl.gni delete mode 100644 engine/src/flutter/tools/fuchsia/fidl/fidl_library.gni delete mode 100755 engine/src/flutter/tools/fuchsia/fidl/gen_response_file.py delete mode 100644 engine/src/flutter/tools/fuchsia/fidl/toolchain.gni diff --git a/DEPS b/DEPS index c41386b6f6..68c6dcbf12 100644 --- a/DEPS +++ b/DEPS @@ -62,7 +62,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '70ca2323a702b1326c9c55943186e4e2fc58c3c8', + 'dart_revision': '406955fe69503eb11fb16a8405534a979f5eef60', # WARNING: DO NOT EDIT MANUALLY # The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py @@ -107,6 +107,12 @@ vars = { # //flutter/tools/gn. 'mac_sdk_min': '10.14', + # Checkout Fuchsia dependencies only on Linux. This is the umbrella flag which + # controls the behavior of all fuchsia related flags. I.e. any fuchsia related + # logic or condition may not work if this flag is False. + # TODO(zijiehe): Make this condition more strict to only download fuchsia + # dependencies when necessary: b/40935282 + 'download_fuchsia_deps': 'host_os == "linux"', # Downloads the fuchsia SDK as listed in fuchsia_sdk_path var. This variable # is currently only used for the Fuchsia LSC process and is not intended for # local development. @@ -261,7 +267,7 @@ vars = { # The version / instance id of the cipd:chromium/fuchsia/gn-sdk which will be # used altogether with fuchsia-sdk to generate gn based build rules. - 'fuchsia_gn_sdk_version': 'l8zShEOXGGjtLYRulEX5CjT2RemKvUPOT6L-uXy41tMC', + 'fuchsia_gn_sdk_version': 'RgErspyYHapUO2SpcW-vo2p8yaRUMUrq0eWjRVPfQjoC', } gclient_gn_args_file = 'src/third_party/dart/build/config/gclient_args.gni' @@ -359,7 +365,7 @@ deps = { Var('dart_git') + '/args.git@7dc7fe0430709229ccc87c3eaae729aeffe10c56', 'src/third_party/dart/third_party/pkg/async': - Var('dart_git') + '/async.git@1556660ca5159d84bf28239825a25dca58f1fde3', + Var('dart_git') + '/async.git@6cdbc41631054870318ae28baea2c62cf2a91945', 'src/third_party/dart/third_party/pkg/bazel_worker': Var('dart_git') + '/bazel_worker.git@8619b92baa9959e55b9fc49d2afcd6dda2ec1c10', @@ -407,7 +413,7 @@ deps = { Var('dart_git') + '/html.git@327e37a6a4dd46599737ee982f280d73a8f646f7', 'src/third_party/dart/third_party/pkg/http': - Var('dart_git') + '/http.git@8da6e0ea5d67a08f98a14137e0d2bdcb113ae4ba', + Var('dart_git') + '/http.git@8d3c64747f9a6d99b29558b6e612dee83db7cdbb', 'src/third_party/dart/third_party/pkg/http_multi_server': Var('dart_git') + '/http_multi_server.git@ba9d07f3596b24718ddf45c9e071d40879cca565', @@ -428,7 +434,7 @@ deps = { Var('dart_git') + '/logging.git@7a7bd5e31ddfe23e34d37ded82d6d0cd5706862c', 'src/third_party/dart/third_party/pkg/markdown': - Var('dart_git') + '/markdown.git@9c6b1afc3721571af37eaaefe043a6ae7637bd09', + Var('dart_git') + '/markdown.git@1ca51664e7b1b7fe789f6be2668c909ce3aea342', 'src/third_party/dart/third_party/pkg/matcher': Var('dart_git') + '/matcher.git@d954c8d979579b4b46427b0ea1d9c721117c191e', @@ -491,7 +497,7 @@ deps = { Var('dart_git') + '/term_glyph.git@85a4aa6bf25cd6ecaa5c56a1b259b2d95264a439', 'src/third_party/dart/third_party/pkg/test': - Var('dart_git') + '/test.git@ba64bbbaa26f09e139c26f9ad6409995806aac6e', + Var('dart_git') + '/test.git@7724aabe8cd40b376573330f5227a6ec0a47f28e', 'src/third_party/dart/third_party/pkg/test_reflective_loader': Var('dart_git') + '/test_reflective_loader.git@9862703a3d14848376c8efde271c88022fba91eb', @@ -1013,7 +1019,7 @@ deps = { 'version': 'da-siZ7wPDA0Z0wXJOEBxKat7HqQz9B3rXqV8wblgz8C' } ], - 'condition': 'host_os == "linux" and not download_fuchsia_sdk', + 'condition': 'download_fuchsia_deps and not download_fuchsia_sdk', 'dep_type': 'cipd', }, @@ -1024,7 +1030,7 @@ deps = { 'version': Var('fuchsia_test_scripts_version'), } ], - 'condition': 'run_fuchsia_emu', + 'condition': 'download_fuchsia_deps', 'dep_type': 'cipd', }, @@ -1035,6 +1041,7 @@ deps = { 'version': Var('fuchsia_gn_sdk_version'), } ], + 'condition': 'download_fuchsia_deps', 'dep_type': 'cipd', }, @@ -1128,7 +1135,7 @@ hooks = [ { 'name': 'Download Fuchsia SDK', 'pattern': '.', - 'condition': 'download_fuchsia_sdk', + 'condition': 'download_fuchsia_deps and download_fuchsia_sdk', 'action': [ 'python3', 'src/flutter/tools/download_fuchsia_sdk.py', @@ -1239,5 +1246,15 @@ hooks = [ '--as-gclient-hook', Var('mac_sdk_min') ] - } + }, + { + 'name': 'Generate Fuchsia GN build rules', + 'pattern': '.', + 'condition': 'download_fuchsia_deps', + 'action': [ + 'python3', + 'src/flutter/tools/fuchsia/with_envs.py', + 'src/flutter/tools/fuchsia/test_scripts/gen_build_defs.py', + ], + }, ] diff --git a/engine/src/flutter/build/config/fuchsia/gn_configs.gni b/engine/src/flutter/build/config/fuchsia/gn_configs.gni index f6d1d493db..e5a4da6414 100644 --- a/engine/src/flutter/build/config/fuchsia/gn_configs.gni +++ b/engine/src/flutter/build/config/fuchsia/gn_configs.gni @@ -2,49 +2,40 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# TODO(richkadel): added this import and modified the fuchsia_sdk assignment. -# See below. -import("//build/fuchsia/sdk.gni") +# This file is copied from +# https://crsrc.org/c/build/config/fuchsia/gn_configs.gni?q=gn_configs.gni +# with some local modifications to match the flutter setup. + declare_args() { - # Path to the fuchsia SDK. This is intended for use in other templates & rules - # to reference the contents of the fuchsia SDK. - fuchsia_sdk = "$fuchsia_sdk_path" + # Path to the fuchsia SDK. This is intended for use in other templates & + # rules to reference the contents of the fuchsia SDK. + fuchsia_sdk = "//fuchsia/sdk/$host_os" - # TODO(richkadel): Since flutter needs build rules from the GN SDK, but also - # requires the Fuchsia _Core_ SDK (for dart libraries, in the core SDK, but - # excluded from the GN SDK), the Fuchsia SDK assumption that the build files - # are in the same SDK directory path as the APIs does not hold true. (And - # there are a couple of other minor tweaks that appear to be needed, at - # this time.) This use case will be discussed with the SDK team, to see if we - # can come up with a cleaner solution. - - # Build ID uniquely identifying the Fuchsia IDK. This is exposed as a property so - # it can be used to locate images and packages on GCS and as a marker to indicate the - # "version" of the IDK. If it is empty, then it is most likely that something is fatally wrong. + # ID uniquely identifying the Fuchsia IDK build. This is exposed as a + # property so it can be used to locate images and packages on GCS and + # as a marker to indicate the "version" of the IDK. + # Defaults to the id found in the manifest.json file of the SDK. fuchsia_sdk_id = "" } -declare_args() { - # The SDK manifest file. This is useful to include as a dependency - # for some targets in order to cause a rebuild when the version of the - # SDK is changed. - fuchsia_sdk_manifest_file = "$fuchsia_sdk/meta/manifest.json" +# TODO(zijiehe): Remove the override and move it into declare_args once the one +# in //build/config/sdk.gni being removed. - b/40935282 - # fuchsia_tool_dir is use to specify the directory in the SDK to locate tools for the - # host cpu architecture. If the host_cpu is not recognized, then tool dir - # defaults to x64. - fuchsia_tool_dir = "$fuchsia_sdk/tools/x64" - if (host_cpu == "x64" || host_cpu == "arm64") { - fuchsia_tool_dir = "${fuchsia_sdk}/tools/${host_cpu}" - } +# The target API level for this repository. Embedders should override this +# value to specify the API level the packages produced from this repository +# should be targeting, e.g. in their top-level //.gn file. A value of -1 +# means that no API level will be passed to the tools that consumes it. +fuchsia_target_api_level = 16 - # fuchsia_auto_index_symbols when true adds the ids.txt file generated from a `fuchsia_package` - # to the Fuchsia symbol index used to symbolize logs and to find source when using zxdb. - # The default value is false, in order to be backwards compatibility with existing builds, and - # only makes sense to set to true when building as a developer that will need to symbolize logs - # or use the debugger with locally build code. - fuchsia_auto_index_symbols = false -} +# The SDK manifest file. This is useful to include as a dependency +# for some targets in order to cause a rebuild when the version of the +# SDK is changed. +fuchsia_sdk_manifest_file = "${fuchsia_sdk}/meta/manifest.json" + +# fuchsia_tool_dir is used to specify the directory in the SDK to locate +# tools for the host cpu architecture. If the host_cpu is not recognized, +# then tool dir defaults to x64. +fuchsia_tool_dir = "${fuchsia_sdk}/tools/${host_cpu}" if (fuchsia_sdk_id == "") { # Note: If we need to expose more than just the id in the future, @@ -64,3 +55,6 @@ declare_args() { fuchsia_sdk_readelf_exec = "" } } + +# third_party/googletest is still using this condition. +using_fuchsia_sdk = true diff --git a/engine/src/flutter/build/secondary/flutter/third_party/googletest/BUILD.gn b/engine/src/flutter/build/secondary/flutter/third_party/googletest/BUILD.gn index a19578d7be..8f866e72b7 100644 --- a/engine/src/flutter/build/secondary/flutter/third_party/googletest/BUILD.gn +++ b/engine/src/flutter/build/secondary/flutter/third_party/googletest/BUILD.gn @@ -3,7 +3,7 @@ # found in the LICENSE file. if (is_fuchsia) { - import("//build/fuchsia/sdk.gni") + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") } config("gtest_private_config") { @@ -34,8 +34,8 @@ static_library("gtest") { if (is_fuchsia) { if (using_fuchsia_sdk) { deps = [ - "$fuchsia_sdk_root/pkg:fdio", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/pkg/fdio", + "${fuchsia_sdk}/pkg/zx", ] } else { deps = [ diff --git a/engine/src/flutter/ci/licenses_golden/excluded_files b/engine/src/flutter/ci/licenses_golden/excluded_files index 5635e1fd82..f5f78c1b83 100644 --- a/engine/src/flutter/ci/licenses_golden/excluded_files +++ b/engine/src/flutter/ci/licenses_golden/excluded_files @@ -330,7 +330,6 @@ ../../../flutter/shell/platform/fuchsia/dart_runner/.gitignore ../../../flutter/shell/platform/fuchsia/dart_runner/README.md ../../../flutter/shell/platform/fuchsia/dart_runner/embedder/pubspec.yaml -../../../flutter/shell/platform/fuchsia/dart_runner/fidl/meta.json ../../../flutter/shell/platform/fuchsia/dart_runner/kernel/libraries.json ../../../flutter/shell/platform/fuchsia/dart_runner/kernel/libraries.yaml ../../../flutter/shell/platform/fuchsia/dart_runner/tests diff --git a/engine/src/flutter/ci/licenses_golden/licenses_dart b/engine/src/flutter/ci/licenses_golden/licenses_dart index d987ffd392..d404104eec 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_dart +++ b/engine/src/flutter/ci/licenses_golden/licenses_dart @@ -1,4 +1,4 @@ -Signature: c01d057033e277986624c640f663a410 +Signature: 6dada66d64680541f83bc84b71ddf2bb ==================================================================================================== LIBRARY: dart @@ -4751,7 +4751,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. -You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/d006b668dcb252171d743526e2a2f3ba34f0c48e +You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/406955fe69503eb11fb16a8405534a979f5eef60 /third_party/fallback_root_certificates/ ==================================================================================================== diff --git a/engine/src/flutter/display_list/BUILD.gn b/engine/src/flutter/display_list/BUILD.gn index 30860d7c99..2bbb1e545e 100644 --- a/engine/src/flutter/display_list/BUILD.gn +++ b/engine/src/flutter/display_list/BUILD.gn @@ -2,11 +2,14 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/impeller/tools/impeller.gni") import("//flutter/testing/testing.gni") +if (is_fuchsia) { + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") +} + config("display_list_config") { defines = [] @@ -142,8 +145,7 @@ if (enable_unittests) { # This is needed for //flutter/third_party/googletest for linking zircon # symbols. if (is_fuchsia) { - libs = - [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] } } @@ -174,8 +176,7 @@ if (enable_unittests) { # This is needed for //flutter/third_party/googletest for linking zircon # symbols. if (is_fuchsia) { - libs = - [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] } } diff --git a/engine/src/flutter/flow/BUILD.gn b/engine/src/flutter/flow/BUILD.gn index bcbb6541be..4a1aade9b5 100644 --- a/engine/src/flutter/flow/BUILD.gn +++ b/engine/src/flutter/flow/BUILD.gn @@ -2,12 +2,15 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/impeller/tools/impeller.gni") import("//flutter/shell/config.gni") import("//flutter/testing/testing.gni") +if (is_fuchsia) { + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") +} + source_set("flow") { sources = [ "compositor_context.cc", diff --git a/engine/src/flutter/fml/BUILD.gn b/engine/src/flutter/fml/BUILD.gn index 2ca165612b..9e60ba9f8d 100644 --- a/engine/src/flutter/fml/BUILD.gn +++ b/engine/src/flutter/fml/BUILD.gn @@ -2,10 +2,13 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/testing/testing.gni") +if (is_fuchsia) { + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") +} + source_set("fml") { sources = [ "ascii_trie.cc", @@ -227,16 +230,16 @@ source_set("fml") { ] public_deps += [ - "$fuchsia_sdk_root/fidl:fuchsia.diagnostics", - "$fuchsia_sdk_root/fidl:fuchsia.logger", - "$fuchsia_sdk_root/pkg:async-cpp", - "$fuchsia_sdk_root/pkg:async-loop-cpp", - "$fuchsia_sdk_root/pkg:async-loop-default", - "$fuchsia_sdk_root/pkg:component_incoming_cpp", - "$fuchsia_sdk_root/pkg:syslog_structured_backend", - "$fuchsia_sdk_root/pkg:trace", - "$fuchsia_sdk_root/pkg:trace-engine", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/fidl/fuchsia.diagnostics:fuchsia.diagnostics_cpp", + "${fuchsia_sdk}/fidl/fuchsia.logger:fuchsia.logger_cpp", + "${fuchsia_sdk}/pkg/async-cpp", + "${fuchsia_sdk}/pkg/async-loop-cpp", + "${fuchsia_sdk}/pkg/async-loop-default", + "${fuchsia_sdk}/pkg/component_incoming_cpp", + "${fuchsia_sdk}/pkg/syslog_structured_backend", + "${fuchsia_sdk}/pkg/trace", + "${fuchsia_sdk}/pkg/trace-engine", + "${fuchsia_sdk}/pkg/zx", ] } @@ -407,14 +410,13 @@ if (enable_unittests) { if (is_fuchsia) { deps += [ - "$fuchsia_sdk_root/pkg:async-loop-testing", - "$fuchsia_sdk_root/pkg:sys_component_cpp_testing", + "${fuchsia_sdk}/pkg/async-loop-testing", + "${fuchsia_sdk}/pkg/sys_component_cpp_testing", ] # This is needed for //flutter/third_party/googletest for linking zircon # symbols. - libs = - [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] } } diff --git a/engine/src/flutter/lib/snapshot/BUILD.gn b/engine/src/flutter/lib/snapshot/BUILD.gn index 9b8f9ac3ce..270dc680f6 100644 --- a/engine/src/flutter/lib/snapshot/BUILD.gn +++ b/engine/src/flutter/lib/snapshot/BUILD.gn @@ -3,13 +3,16 @@ # found in the LICENSE file. import("//build/compiled_action.gni") -import("//build/fuchsia/sdk.gni") import("//flutter/build/bin_to_obj.gni") import("//flutter/common/config.gni") import("//flutter/impeller/tools/impeller.gni") import("//flutter/lib/ui/dart_ui.gni") import("$dart_src/utils/compile_platform.gni") +if (is_fuchsia) { + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") +} + # Generates the Dart/Flutter core platform files and tools. # # This target generates the platform-specific snapshots and snapshot-related diff --git a/engine/src/flutter/lib/ui/BUILD.gn b/engine/src/flutter/lib/ui/BUILD.gn index 353de535af..1d00f1dfeb 100644 --- a/engine/src/flutter/lib/ui/BUILD.gn +++ b/engine/src/flutter/lib/ui/BUILD.gn @@ -2,12 +2,15 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/impeller/tools/impeller.gni") import("//flutter/shell/config.gni") import("//flutter/testing/testing.gni") +if (is_fuchsia) { + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") +} + source_set("ui") { cflags = [ # Dart gives us doubles. Skia and Impeller work in floats. diff --git a/engine/src/flutter/shell/common/BUILD.gn b/engine/src/flutter/shell/common/BUILD.gn index 01d55f40e9..8e2d9f2174 100644 --- a/engine/src/flutter/shell/common/BUILD.gn +++ b/engine/src/flutter/shell/common/BUILD.gn @@ -2,12 +2,15 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/impeller/tools/impeller.gni") import("//flutter/shell/gpu/gpu.gni") import("//flutter/testing/testing.gni") +if (is_fuchsia) { + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") +} + # Template to generate a dart embedder resource.cc file. # Required invoker inputs: # String output (name of output file) @@ -340,10 +343,10 @@ if (enable_unittests) { sources += [ "shell_fuchsia_unittests.cc" ] deps += [ - "$fuchsia_sdk_root/fidl:fuchsia.intl", - "$fuchsia_sdk_root/fidl:fuchsia.settings", - "$fuchsia_sdk_root/pkg:fidl_cpp", - "$fuchsia_sdk_root/pkg:sys_cpp", + "${fuchsia_sdk}/fidl/fuchsia.intl", + "${fuchsia_sdk}/fidl/fuchsia.settings", + "${fuchsia_sdk}/pkg/fidl_cpp", + "${fuchsia_sdk}/pkg/sys_cpp", ] } else if (shell_enable_gl) { # TODO(63837): This test is hard-coded to use a TestGLSurface so it cannot diff --git a/engine/src/flutter/shell/platform/BUILD.gn b/engine/src/flutter/shell/platform/BUILD.gn index 66baf0e887..63e9901643 100644 --- a/engine/src/flutter/shell/platform/BUILD.gn +++ b/engine/src/flutter/shell/platform/BUILD.gn @@ -2,7 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/shell/platform/config.gni") group("platform") { @@ -21,6 +20,7 @@ group("platform") { deps += [ "windows" ] } } else if (is_fuchsia) { + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") deps = [ "fuchsia" ] } else { assert(false, "Unknown/Unsupported platform.") diff --git a/engine/src/flutter/shell/platform/fuchsia/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/BUILD.gn index b231c31d20..4de6e16a88 100644 --- a/engine/src/flutter/shell/platform/fuchsia/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/BUILD.gn @@ -4,11 +4,11 @@ assert(is_fuchsia) -import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/testing/testing.gni") import("//flutter/tools/fuchsia/dart.gni") import("//flutter/tools/fuchsia/fuchsia_host_bundle.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") product_suffix = "" diff --git a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/BUILD.gn index 1ee3396a7c..c04a41690e 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/BUILD.gn @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") config("sdk_ext_config") { include_dirs = [ "../.." ] @@ -19,13 +19,13 @@ source_set("sdk_ext") { ] deps = [ - "$fuchsia_sdk_root/pkg:async-cpp", + "${fuchsia_sdk}/pkg/async-cpp", "../zircon", "//flutter/fml", "//flutter/third_party/tonic", ] - public_deps = [ "$fuchsia_sdk_root/pkg:zx" ] + public_deps = [ "${fuchsia_sdk}/pkg/zx" ] public_configs = [ ":sdk_ext_config" ] } diff --git a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/zircon/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/zircon/BUILD.gn index a354ae5c5d..ae17ef02af 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/zircon/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/zircon/BUILD.gn @@ -2,10 +2,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/testing/testing.gni") import("//flutter/tools/fuchsia/dart/dart_library.gni") import("//flutter/tools/fuchsia/flutter/flutter_component.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("//flutter/tools/fuchsia/gn-sdk/src/package.gni") config("zircon_config") { @@ -29,12 +29,12 @@ source_set("zircon") { ] deps = [ - "$fuchsia_sdk_root/fidl:fuchsia.io", - "$fuchsia_sdk_root/pkg:async-cpp", - "$fuchsia_sdk_root/pkg:async-default", - "$fuchsia_sdk_root/pkg:async-loop-cpp", - "$fuchsia_sdk_root/pkg:fdio", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/fidl/fuchsia.io", + "${fuchsia_sdk}/pkg/async-cpp", + "${fuchsia_sdk}/pkg/async-default", + "${fuchsia_sdk}/pkg/async-loop-cpp", + "${fuchsia_sdk}/pkg/fdio", + "${fuchsia_sdk}/pkg/zx", "//flutter/fml", "//flutter/third_party/tonic", ] diff --git a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/zircon_ffi/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/zircon_ffi/BUILD.gn index 5c5e179182..b98973a1d0 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/zircon_ffi/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/zircon_ffi/BUILD.gn @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") config("zircon_ffi_config") { include_dirs = [ "." ] @@ -27,7 +27,7 @@ shared_library("zircon_ffi") { deps = [ "$dart_src/runtime:dart_api", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/pkg/zx", "//flutter/fml", ] } diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/BUILD.gn index e7596e8331..4dac8a9d8b 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/BUILD.gn @@ -4,12 +4,12 @@ assert(is_fuchsia) -import("//build/fuchsia/sdk.gni") import("//flutter/common/fuchsia_config.gni") import("//flutter/testing/testing.gni") import("//flutter/tools/fuchsia/dart.gni") import("//flutter/tools/fuchsia/fuchsia_archive.gni") import("//flutter/tools/fuchsia/fuchsia_libs.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") template("runner_sources") { assert(defined(invoker.product), "runner_sources must define product") @@ -43,28 +43,28 @@ template("runner_sources") { } public_deps = [ - "$fuchsia_sdk_root/pkg:sys_cpp", + "${fuchsia_sdk}/fidl/fuchsia.component.runner", + "${fuchsia_sdk}/fidl/fuchsia.test", + "${fuchsia_sdk}/pkg/sys_cpp", "//flutter/fml", ] + dart_public_deps deps = [ - "$fuchsia_sdk_root/fidl:fuchsia.component.runner", - "$fuchsia_sdk_root/fidl:fuchsia.logger", - "$fuchsia_sdk_root/fidl:fuchsia.test", - "$fuchsia_sdk_root/pkg:async", - "$fuchsia_sdk_root/pkg:async-cpp", - "$fuchsia_sdk_root/pkg:async-default", - "$fuchsia_sdk_root/pkg:async-loop", - "$fuchsia_sdk_root/pkg:async-loop-cpp", - "$fuchsia_sdk_root/pkg:async-loop-default", - "$fuchsia_sdk_root/pkg:fidl_cpp", - "$fuchsia_sdk_root/pkg:inspect", - "$fuchsia_sdk_root/pkg:inspect_component_cpp", - "$fuchsia_sdk_root/pkg:sys_cpp", - "$fuchsia_sdk_root/pkg:sys_cpp_testing", - "$fuchsia_sdk_root/pkg:trace", - "$fuchsia_sdk_root/pkg:vfs_cpp", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/fidl/fuchsia.logger", + "${fuchsia_sdk}/pkg/async", + "${fuchsia_sdk}/pkg/async-cpp", + "${fuchsia_sdk}/pkg/async-default", + "${fuchsia_sdk}/pkg/async-loop", + "${fuchsia_sdk}/pkg/async-loop-cpp", + "${fuchsia_sdk}/pkg/async-loop-default", + "${fuchsia_sdk}/pkg/fidl_cpp", + "${fuchsia_sdk}/pkg/inspect", + "${fuchsia_sdk}/pkg/inspect_component_cpp", + "${fuchsia_sdk}/pkg/sys_cpp", + "${fuchsia_sdk}/pkg/sys_cpp_testing", + "${fuchsia_sdk}/pkg/trace", + "${fuchsia_sdk}/pkg/vfs_cpp", + "${fuchsia_sdk}/pkg/zx", "fidl:dart_test", "//flutter/common", "//flutter/shell/platform/fuchsia/dart-pkg/fuchsia", @@ -100,8 +100,8 @@ template("runner") { deps = [ ":" + target_name + "_runner_sources", - "$fuchsia_sdk_root/pkg:inspect_component_cpp", - "$fuchsia_sdk_root/pkg:trace-provider-so", + "${fuchsia_sdk}/pkg/inspect_component_cpp", + "${fuchsia_sdk}/pkg/trace-provider-so", ] + extra_deps } } @@ -317,7 +317,7 @@ if (enable_unittests) { # This is needed for //flutter/third_party/googletest for linking zircon # symbols. - libs = [ "$fuchsia_sdk_path/arch/$target_cpu/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] deps = [ ":jit_runner_sources_for_test", diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/fidl/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/fidl/BUILD.gn index ba9f6be2c7..3923e52716 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/fidl/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/fidl/BUILD.gn @@ -2,11 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") -import("//flutter/tools/fuchsia/fidl/fidl.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/fidl_library.gni") -fidl("dart_test") { - name = "dart.test" - meta = "meta.json" +fidl_library("dart_test") { + library_name = "dart.test" sources = [ "echo.fidl" ] } diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/fidl/meta.json b/engine/src/flutter/shell/platform/fuchsia/dart_runner/fidl/meta.json deleted file mode 100644 index 34fa696420..0000000000 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/fidl/meta.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "deps": [], - "name": "dart.test", - "root": "dart.test", - "sources": [ - "../../../flutter/shell/platform/fuchsia/dart_runner/fidl/echo.fidl" - ], - "type": "fidl_library" -} \ No newline at end of file diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn index 5dcbc1e9df..f0319dee65 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn @@ -3,9 +3,9 @@ # found in the LICENSE file. import("//build/compiled_action.gni") -import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/tools/fuchsia/dart.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("$dart_src/utils/compile_platform.gni") compile_platform("kernel_platform_files") { diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/BUILD.gn index efb1d7ac29..4580775e91 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/BUILD.gn @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") group("startup_integration_test") { testonly = true diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/BUILD.gn index 875b516596..482378574a 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/BUILD.gn @@ -2,11 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") - import("//flutter/tools/fuchsia/dart/dart_component.gni") -import("//flutter/tools/fuchsia/fidl/fidl.gni") import("//flutter/tools/fuchsia/fuchsia_archive.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/fidl_library.gni") group("tests") { testonly = true @@ -22,16 +20,16 @@ executable("dart-aot-runner-integration-test-bin") { # This is needed for //flutter/third_party/googletest for linking zircon # symbols. - libs = [ "$fuchsia_sdk_path/arch/$target_cpu/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] deps = [ - "$fuchsia_sdk_root/fidl:fuchsia.logger", - "$fuchsia_sdk_root/fidl:fuchsia.tracing.provider", - "$fuchsia_sdk_root/pkg:async", - "$fuchsia_sdk_root/pkg:async-loop-testing", - "$fuchsia_sdk_root/pkg:fidl_cpp", - "$fuchsia_sdk_root/pkg:sys_component_cpp_testing", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/fidl/fuchsia.logger", + "${fuchsia_sdk}/fidl/fuchsia.tracing.provider", + "${fuchsia_sdk}/pkg/async", + "${fuchsia_sdk}/pkg/async-loop-testing", + "${fuchsia_sdk}/pkg/fidl_cpp", + "${fuchsia_sdk}/pkg/sys_component_cpp_testing", + "${fuchsia_sdk}/pkg/zx", "../dart_echo_server:aot_echo_package", "//flutter/fml", "//flutter/shell/platform/fuchsia/dart_runner/fidl:dart_test", diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_echo_server/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_echo_server/BUILD.gn index 87db0a6fcb..245bdb7ae9 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_echo_server/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_echo_server/BUILD.gn @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("//flutter/tools/fuchsia/dart/dart_component.gni") import("//flutter/tools/fuchsia/dart/dart_library.gni") diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/BUILD.gn index f14b70096f..83e5a25451 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/BUILD.gn @@ -2,11 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") - import("//flutter/tools/fuchsia/dart/dart_component.gni") -import("//flutter/tools/fuchsia/fidl/fidl.gni") import("//flutter/tools/fuchsia/fuchsia_archive.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") group("tests") { testonly = true @@ -22,16 +20,16 @@ executable("dart-jit-runner-integration-test-bin") { # This is needed for //flutter/third_party/googletest for linking zircon # symbols. - libs = [ "$fuchsia_sdk_path/arch/$target_cpu/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] deps = [ - "$fuchsia_sdk_root/fidl:fuchsia.logger", - "$fuchsia_sdk_root/fidl:fuchsia.tracing.provider", - "$fuchsia_sdk_root/pkg:async", - "$fuchsia_sdk_root/pkg:async-loop-testing", - "$fuchsia_sdk_root/pkg:fidl_cpp", - "$fuchsia_sdk_root/pkg:sys_component_cpp_testing", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/fidl/fuchsia.logger", + "${fuchsia_sdk}/fidl/fuchsia.tracing.provider", + "${fuchsia_sdk}/pkg/async", + "${fuchsia_sdk}/pkg/async-loop-testing", + "${fuchsia_sdk}/pkg/fidl_cpp", + "${fuchsia_sdk}/pkg/sys_component_cpp_testing", + "${fuchsia_sdk}/pkg/zx", "../dart_echo_server:jit_echo_package", "//flutter/fml", "//flutter/shell/platform/fuchsia/dart_runner/fidl:dart_test", diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn index 12810557c3..0c87cc9c27 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn @@ -3,10 +3,10 @@ # found in the LICENSE file. import("//build/compiled_action.gni") -import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/tools/fuchsia/dart.gni") import("//flutter/tools/fuchsia/dart_kernel.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("$dart_src/utils/compile_platform.gni") dart_kernel("vmservice_product_aot_kernel") { diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn index 45d5e1242c..ad4e3426a1 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn @@ -4,7 +4,6 @@ assert(is_fuchsia) -import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/shell/config.gni") import("//flutter/shell/gpu/gpu.gni") @@ -12,6 +11,7 @@ import("//flutter/testing/testing.gni") import("//flutter/tools/fuchsia/dart.gni") import("//flutter/tools/fuchsia/fuchsia_archive.gni") import("//flutter/tools/fuchsia/fuchsia_libs.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("//flutter/vulkan/config.gni") # Fuchsia uses its own custom Surface implementation. @@ -138,41 +138,44 @@ template("runner_sources") { "//flutter/vulkan/procs", ] + # TODO(zijiehe): Considering which deps should belong to the public_deps, + # multiple dependencies of this target use the following deps without + # explicitly claiming the dependencies. public_deps = [ - "$fuchsia_sdk_root/pkg:inspect", - "$fuchsia_sdk_root/pkg:inspect_component_cpp", - "$fuchsia_sdk_root/pkg:sys_cpp", + "${fuchsia_sdk}/fidl/fuchsia.accessibility.semantics", + "${fuchsia_sdk}/fidl/fuchsia.component.runner", + "${fuchsia_sdk}/fidl/fuchsia.fonts", + "${fuchsia_sdk}/fidl/fuchsia.images", + "${fuchsia_sdk}/fidl/fuchsia.intl", + "${fuchsia_sdk}/fidl/fuchsia.io", + "${fuchsia_sdk}/fidl/fuchsia.media", + "${fuchsia_sdk}/fidl/fuchsia.memorypressure", + "${fuchsia_sdk}/fidl/fuchsia.ui.app", + "${fuchsia_sdk}/fidl/fuchsia.ui.composition", + "${fuchsia_sdk}/fidl/fuchsia.ui.input", + "${fuchsia_sdk}/fidl/fuchsia.ui.input3", + "${fuchsia_sdk}/fidl/fuchsia.ui.pointer", + "${fuchsia_sdk}/fidl/fuchsia.ui.pointerinjector", + "${fuchsia_sdk}/fidl/fuchsia.ui.test.input", + "${fuchsia_sdk}/fidl/fuchsia.ui.views", + "${fuchsia_sdk}/pkg/inspect", + "${fuchsia_sdk}/pkg/inspect_component_cpp", + "${fuchsia_sdk}/pkg/sys_cpp", "//flutter/shell/platform/fuchsia/runtime/dart/utils", ] + flutter_public_deps deps = [ - "$fuchsia_sdk_root/fidl:fuchsia.accessibility.semantics", - "$fuchsia_sdk_root/fidl:fuchsia.component.runner", - "$fuchsia_sdk_root/fidl:fuchsia.fonts", - "$fuchsia_sdk_root/fidl:fuchsia.images", - "$fuchsia_sdk_root/fidl:fuchsia.intl", - "$fuchsia_sdk_root/fidl:fuchsia.io", - "$fuchsia_sdk_root/fidl:fuchsia.media", - "$fuchsia_sdk_root/fidl:fuchsia.memorypressure", - "$fuchsia_sdk_root/fidl:fuchsia.ui.app", - "$fuchsia_sdk_root/fidl:fuchsia.ui.composition", - "$fuchsia_sdk_root/fidl:fuchsia.ui.input", - "$fuchsia_sdk_root/fidl:fuchsia.ui.input3", - "$fuchsia_sdk_root/fidl:fuchsia.ui.pointer", - "$fuchsia_sdk_root/fidl:fuchsia.ui.pointerinjector", - "$fuchsia_sdk_root/fidl:fuchsia.ui.test.input", - "$fuchsia_sdk_root/fidl:fuchsia.ui.views", - "$fuchsia_sdk_root/pkg:async-cpp", - "$fuchsia_sdk_root/pkg:async-default", - "$fuchsia_sdk_root/pkg:async-loop", - "$fuchsia_sdk_root/pkg:async-loop-cpp", - "$fuchsia_sdk_root/pkg:fdio", - "$fuchsia_sdk_root/pkg:fidl_cpp", - "$fuchsia_sdk_root/pkg:trace", - "$fuchsia_sdk_root/pkg:trace-engine", - "$fuchsia_sdk_root/pkg:trace-provider-so", - "$fuchsia_sdk_root/pkg:vfs_cpp", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/pkg/async-cpp", + "${fuchsia_sdk}/pkg/async-default", + "${fuchsia_sdk}/pkg/async-loop", + "${fuchsia_sdk}/pkg/async-loop-cpp", + "${fuchsia_sdk}/pkg/fdio", + "${fuchsia_sdk}/pkg/fidl_cpp", + "${fuchsia_sdk}/pkg/trace", + "${fuchsia_sdk}/pkg/trace-engine", + "${fuchsia_sdk}/pkg/trace-provider-so", + "${fuchsia_sdk}/pkg/vfs_cpp", + "${fuchsia_sdk}/pkg/zx", "//flutter/shell/platform/fuchsia/dart-pkg/fuchsia", "//flutter/shell/platform/fuchsia/dart-pkg/zircon", ] + flutter_deps @@ -226,9 +229,9 @@ template("flutter_runner") { deps = [ ":flutter_runner_sources${product_suffix}", - "$fuchsia_sdk_root/pkg:async-loop-cpp", - "$fuchsia_sdk_root/pkg:trace", - "$fuchsia_sdk_root/pkg:trace-provider-so", + "${fuchsia_sdk}/pkg/async-loop-cpp", + "${fuchsia_sdk}/pkg/trace", + "${fuchsia_sdk}/pkg/trace-provider-so", ] + extra_deps # The flags below are needed so that Dart's CPU profiler can walk the @@ -506,7 +509,7 @@ if (enable_unittests) { # This is needed for //flutter/third_party/googletest for linking zircon # symbols. - libs = [ "$fuchsia_sdk_path/arch/$target_cpu/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] # The use of these dependencies is temporary and will be moved behind the # embedder API. @@ -524,8 +527,8 @@ if (enable_unittests) { "tests/fakes", ":flutter_runner_fixtures", ":flutter_runner_sources", - "//build/fuchsia/pkg:async-testing", - "//build/fuchsia/pkg:sys_cpp_testing", + "${fuchsia_sdk}/pkg/async-testing", + "${fuchsia_sdk}/pkg/sys_cpp_testing", "//flutter/shell/platform/common/client_wrapper:client_wrapper_library_stubs", "//flutter/testing", ] + flutter_deps @@ -540,7 +543,7 @@ if (enable_unittests) { # This is needed for //flutter/third_party/googletest for linking zircon # symbols. - libs = [ "$fuchsia_sdk_path/arch/$target_cpu/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] # The use of these dependencies is temporary and will be moved behind the # embedder API. @@ -567,7 +570,7 @@ if (enable_unittests) { # This is needed for //flutter/third_party/googletest for linking zircon # symbols. - libs = [ "$fuchsia_sdk_path/arch/$target_cpu/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] # The use of these dependencies is temporary and will be moved behind the # embedder API. diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/kernel/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/kernel/BUILD.gn index b6b254581f..0e4cdb25f8 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/kernel/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/kernel/BUILD.gn @@ -3,9 +3,9 @@ # found in the LICENSE file. import("//build/compiled_action.gni") -import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/tools/fuchsia/dart.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("$dart_src/utils/compile_platform.gni") compile_platform("kernel_platform_files") { diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/fakes/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/fakes/BUILD.gn index 4b23cd9632..e47a8d3cbc 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/fakes/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/fakes/BUILD.gn @@ -4,6 +4,8 @@ assert(is_fuchsia) +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") + group("fakes") { testonly = true @@ -25,7 +27,7 @@ source_set("focus") { ] deps = [ - "//build/fuchsia/pkg:sys_cpp_testing", + "${fuchsia_sdk}/pkg/sys_cpp_testing", "//flutter/lib/ui", "//flutter/testing", "//flutter/third_party/rapidjson", @@ -38,7 +40,7 @@ source_set("pointer") { sources = [ "mock_injector_registry.h" ] deps = [ - "//build/fuchsia/pkg:sys_cpp_testing", + "${fuchsia_sdk}/pkg/sys_cpp_testing", "//flutter/lib/ui", "//flutter/testing", "//flutter/third_party/rapidjson", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/fakes/scenic/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/fakes/scenic/BUILD.gn index 4ca6cf0290..d8ac33b6b0 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/fakes/scenic/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/fakes/scenic/BUILD.gn @@ -4,6 +4,8 @@ assert(is_fuchsia) +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") + source_set("scenic") { testonly = true @@ -15,13 +17,13 @@ source_set("scenic") { ] public_deps = [ - "//build/fuchsia/fidl:fuchsia.images", - "//build/fuchsia/fidl:fuchsia.scenic.scheduling", - "//build/fuchsia/fidl:fuchsia.ui.composition", - "//build/fuchsia/fidl:fuchsia.ui.views", - "//build/fuchsia/pkg:async-cpp", - "//build/fuchsia/pkg:async-testing", - "//build/fuchsia/pkg:fidl_cpp", + "${fuchsia_sdk}/fidl/fuchsia.images", + "${fuchsia_sdk}/fidl/fuchsia.scenic.scheduling", + "${fuchsia_sdk}/fidl/fuchsia.ui.composition", + "${fuchsia_sdk}/fidl/fuchsia.ui.views", + "${fuchsia_sdk}/pkg/async-cpp", + "${fuchsia_sdk}/pkg/async-testing", + "${fuchsia_sdk}/pkg/fidl_cpp", "//flutter/fml", ] } diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/BUILD.gn index 30ba3b7690..2117b86aa4 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/BUILD.gn @@ -4,7 +4,7 @@ assert(is_fuchsia) -import("//build/fuchsia/sdk.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") group("integration") { testonly = true diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn index 4c16bb93e7..4af5ae5df9 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn @@ -4,8 +4,8 @@ assert(is_fuchsia) -import("//build/fuchsia/sdk.gni") import("//flutter/tools/fuchsia/fuchsia_archive.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") group("tests") { testonly = true @@ -21,23 +21,23 @@ executable("flutter-embedder-test-bin") { # This is needed for //flutter/third_party/googletest for linking zircon # symbols. - libs = [ "$fuchsia_sdk_path/arch/$target_cpu/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] deps = [ - "$fuchsia_sdk_root/fidl:fuchsia.inspect", - "$fuchsia_sdk_root/fidl:fuchsia.logger", - "$fuchsia_sdk_root/fidl:fuchsia.tracing.provider", - "$fuchsia_sdk_root/fidl:fuchsia.ui.app", - "$fuchsia_sdk_root/fidl:fuchsia.ui.composition", - "$fuchsia_sdk_root/fidl:fuchsia.ui.display.singleton", - "$fuchsia_sdk_root/fidl:fuchsia.ui.observation.geometry", - "$fuchsia_sdk_root/fidl:fuchsia.ui.test.input", - "$fuchsia_sdk_root/fidl:fuchsia.ui.test.scene", - "$fuchsia_sdk_root/pkg:async", - "$fuchsia_sdk_root/pkg:async-loop-testing", - "$fuchsia_sdk_root/pkg:fidl_cpp", - "$fuchsia_sdk_root/pkg:sys_component_cpp_testing", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/fidl/fuchsia.inspect", + "${fuchsia_sdk}/fidl/fuchsia.logger", + "${fuchsia_sdk}/fidl/fuchsia.tracing.provider", + "${fuchsia_sdk}/fidl/fuchsia.ui.app", + "${fuchsia_sdk}/fidl/fuchsia.ui.composition", + "${fuchsia_sdk}/fidl/fuchsia.ui.display.singleton", + "${fuchsia_sdk}/fidl/fuchsia.ui.observation.geometry", + "${fuchsia_sdk}/fidl/fuchsia.ui.test.input", + "${fuchsia_sdk}/fidl/fuchsia.ui.test.scene", + "${fuchsia_sdk}/pkg/async", + "${fuchsia_sdk}/pkg/async-loop-testing", + "${fuchsia_sdk}/pkg/fidl_cpp", + "${fuchsia_sdk}/pkg/sys_component_cpp_testing", + "${fuchsia_sdk}/pkg/zx", "//flutter/fml", "//flutter/shell/platform/fuchsia/flutter/tests/integration/utils:check_view", "//flutter/shell/platform/fuchsia/flutter/tests/integration/utils:screenshot", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/child-view/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/child-view/BUILD.gn index 22534d2566..08cb1bd958 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/child-view/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/child-view/BUILD.gn @@ -2,9 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/tools/fuchsia/dart/dart_library.gni") import("//flutter/tools/fuchsia/flutter/flutter_component.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("//flutter/tools/fuchsia/gn-sdk/src/package.gni") dart_library("lib") { diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/parent-view/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/parent-view/BUILD.gn index 1e0def98cb..0407e790c7 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/parent-view/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/parent-view/BUILD.gn @@ -2,9 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/tools/fuchsia/dart/dart_library.gni") import("//flutter/tools/fuchsia/flutter/flutter_component.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("//flutter/tools/fuchsia/gn-sdk/src/package.gni") dart_library("lib") { diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/BUILD.gn index 8268934a7e..d976e940ff 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/BUILD.gn @@ -4,8 +4,8 @@ assert(is_fuchsia) -import("//build/fuchsia/sdk.gni") import("//flutter/tools/fuchsia/fuchsia_archive.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("//flutter/tools/fuchsia/gn-sdk/src/package.gni") group("tests") { @@ -20,31 +20,31 @@ executable("mouse-input-test-bin") { # This is needed for //flutter/third_party/googletest for linking zircon # symbols. - libs = [ "$fuchsia_sdk_path/arch/$target_cpu/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] deps = [ - "$fuchsia_sdk_root/fidl:fuchsia.accessibility.semantics", - "$fuchsia_sdk_root/fidl:fuchsia.buildinfo", - "$fuchsia_sdk_root/fidl:fuchsia.component", - "$fuchsia_sdk_root/fidl:fuchsia.fonts", - "$fuchsia_sdk_root/fidl:fuchsia.intl", - "$fuchsia_sdk_root/fidl:fuchsia.kernel", - "$fuchsia_sdk_root/fidl:fuchsia.memorypressure", - "$fuchsia_sdk_root/fidl:fuchsia.metrics", - "$fuchsia_sdk_root/fidl:fuchsia.net.interfaces", - "$fuchsia_sdk_root/fidl:fuchsia.tracing.provider", - "$fuchsia_sdk_root/fidl:fuchsia.ui.app", - "$fuchsia_sdk_root/fidl:fuchsia.ui.display.singleton", - "$fuchsia_sdk_root/fidl:fuchsia.ui.input", - "$fuchsia_sdk_root/fidl:fuchsia.ui.pointerinjector", - "$fuchsia_sdk_root/fidl:fuchsia.ui.test.input", - "$fuchsia_sdk_root/fidl:fuchsia.ui.test.scene", - "$fuchsia_sdk_root/fidl:fuchsia.web", - "$fuchsia_sdk_root/pkg:async", - "$fuchsia_sdk_root/pkg:async-loop-testing", - "$fuchsia_sdk_root/pkg:fidl_cpp", - "$fuchsia_sdk_root/pkg:sys_component_cpp_testing", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/fidl/fuchsia.accessibility.semantics", + "${fuchsia_sdk}/fidl/fuchsia.buildinfo", + "${fuchsia_sdk}/fidl/fuchsia.component", + "${fuchsia_sdk}/fidl/fuchsia.fonts", + "${fuchsia_sdk}/fidl/fuchsia.intl", + "${fuchsia_sdk}/fidl/fuchsia.kernel", + "${fuchsia_sdk}/fidl/fuchsia.memorypressure", + "${fuchsia_sdk}/fidl/fuchsia.metrics", + "${fuchsia_sdk}/fidl/fuchsia.net.interfaces", + "${fuchsia_sdk}/fidl/fuchsia.tracing.provider", + "${fuchsia_sdk}/fidl/fuchsia.ui.app", + "${fuchsia_sdk}/fidl/fuchsia.ui.display.singleton", + "${fuchsia_sdk}/fidl/fuchsia.ui.input", + "${fuchsia_sdk}/fidl/fuchsia.ui.pointerinjector", + "${fuchsia_sdk}/fidl/fuchsia.ui.test.input", + "${fuchsia_sdk}/fidl/fuchsia.ui.test.scene", + "${fuchsia_sdk}/fidl/fuchsia.web", + "${fuchsia_sdk}/pkg/async", + "${fuchsia_sdk}/pkg/async-loop-testing", + "${fuchsia_sdk}/pkg/fidl_cpp", + "${fuchsia_sdk}/pkg/sys_component_cpp_testing", + "${fuchsia_sdk}/pkg/zx", "mouse-input-view:package", "//flutter/fml", "//flutter/shell/platform/fuchsia/flutter/tests/integration/utils:portable_ui_test", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-view/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-view/BUILD.gn index 0126dc2353..1e59eeafe4 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-view/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-view/BUILD.gn @@ -2,10 +2,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/tools/fuchsia/dart/dart_library.gni") import("//flutter/tools/fuchsia/flutter/flutter_component.gni") import("//flutter/tools/fuchsia/gn-sdk/src/component.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("//flutter/tools/fuchsia/gn-sdk/src/package.gni") dart_library("lib") { diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/BUILD.gn index f59583cff4..41346b9104 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/BUILD.gn @@ -4,8 +4,8 @@ assert(is_fuchsia) -import("//build/fuchsia/sdk.gni") import("//flutter/tools/fuchsia/fuchsia_archive.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("//flutter/tools/fuchsia/gn-sdk/src/package.gni") group("tests") { @@ -20,25 +20,27 @@ executable("text-input-test-bin") { # This is needed for //flutter/third_party/googletest for linking zircon # symbols. - libs = [ "$fuchsia_sdk_path/arch/$target_cpu/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] deps = [ - "$fuchsia_sdk_root/fidl:fuchsia.accessibility.semantics", - "$fuchsia_sdk_root/fidl:fuchsia.component", - "$fuchsia_sdk_root/fidl:fuchsia.intl", - "$fuchsia_sdk_root/fidl:fuchsia.kernel", - "$fuchsia_sdk_root/fidl:fuchsia.tracing.provider", - "$fuchsia_sdk_root/fidl:fuchsia.ui.app", - "$fuchsia_sdk_root/fidl:fuchsia.ui.display.singleton", - "$fuchsia_sdk_root/fidl:fuchsia.ui.input", - "$fuchsia_sdk_root/fidl:fuchsia.ui.pointerinjector", - "$fuchsia_sdk_root/fidl:fuchsia.ui.test.input", - "$fuchsia_sdk_root/fidl:fuchsia.ui.test.scene", - "$fuchsia_sdk_root/pkg:async", - "$fuchsia_sdk_root/pkg:async-loop-testing", - "$fuchsia_sdk_root/pkg:fidl_cpp", - "$fuchsia_sdk_root/pkg:sys_component_cpp_testing", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/fidl/fuchsia.accessibility.semantics", + "${fuchsia_sdk}/fidl/fuchsia.component", + "${fuchsia_sdk}/fidl/fuchsia.feedback", + "${fuchsia_sdk}/fidl/fuchsia.intl", + "${fuchsia_sdk}/fidl/fuchsia.kernel", + "${fuchsia_sdk}/fidl/fuchsia.logger", + "${fuchsia_sdk}/fidl/fuchsia.tracing.provider", + "${fuchsia_sdk}/fidl/fuchsia.ui.app", + "${fuchsia_sdk}/fidl/fuchsia.ui.display.singleton", + "${fuchsia_sdk}/fidl/fuchsia.ui.input", + "${fuchsia_sdk}/fidl/fuchsia.ui.pointerinjector", + "${fuchsia_sdk}/fidl/fuchsia.ui.test.input", + "${fuchsia_sdk}/fidl/fuchsia.ui.test.scene", + "${fuchsia_sdk}/pkg/async", + "${fuchsia_sdk}/pkg/async-loop-testing", + "${fuchsia_sdk}/pkg/fidl_cpp", + "${fuchsia_sdk}/pkg/sys_component_cpp_testing", + "${fuchsia_sdk}/pkg/zx", "text-input-view:package", "//flutter/fml", "//flutter/shell/platform/fuchsia/flutter/tests/integration/utils:check_view", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/BUILD.gn index c2c289ce22..5ec7ed603c 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/BUILD.gn @@ -2,10 +2,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/tools/fuchsia/dart/dart_library.gni") import("//flutter/tools/fuchsia/flutter/flutter_component.gni") import("//flutter/tools/fuchsia/gn-sdk/src/component.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("//flutter/tools/fuchsia/gn-sdk/src/package.gni") dart_library("lib") { diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/BUILD.gn index bb171df81f..984456cbbb 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/BUILD.gn @@ -4,8 +4,8 @@ assert(is_fuchsia) -import("//build/fuchsia/sdk.gni") import("//flutter/tools/fuchsia/fuchsia_archive.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("//flutter/tools/fuchsia/gn-sdk/src/package.gni") group("tests") { @@ -20,31 +20,31 @@ executable("touch-input-test-bin") { # This is needed for //flutter/third_party/googletest for linking zircon # symbols. - libs = [ "$fuchsia_sdk_path/arch/$target_cpu/sysroot/lib/libzircon.so" ] + libs = [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] deps = [ - "$fuchsia_sdk_root/fidl:fuchsia.accessibility.semantics", - "$fuchsia_sdk_root/fidl:fuchsia.buildinfo", - "$fuchsia_sdk_root/fidl:fuchsia.component", - "$fuchsia_sdk_root/fidl:fuchsia.fonts", - "$fuchsia_sdk_root/fidl:fuchsia.intl", - "$fuchsia_sdk_root/fidl:fuchsia.kernel", - "$fuchsia_sdk_root/fidl:fuchsia.memorypressure", - "$fuchsia_sdk_root/fidl:fuchsia.metrics", - "$fuchsia_sdk_root/fidl:fuchsia.net.interfaces", - "$fuchsia_sdk_root/fidl:fuchsia.tracing.provider", - "$fuchsia_sdk_root/fidl:fuchsia.ui.app", - "$fuchsia_sdk_root/fidl:fuchsia.ui.display.singleton", - "$fuchsia_sdk_root/fidl:fuchsia.ui.input", - "$fuchsia_sdk_root/fidl:fuchsia.ui.pointerinjector", - "$fuchsia_sdk_root/fidl:fuchsia.ui.test.input", - "$fuchsia_sdk_root/fidl:fuchsia.ui.test.scene", - "$fuchsia_sdk_root/fidl:fuchsia.web", - "$fuchsia_sdk_root/pkg:async", - "$fuchsia_sdk_root/pkg:async-loop-testing", - "$fuchsia_sdk_root/pkg:fidl_cpp", - "$fuchsia_sdk_root/pkg:sys_component_cpp_testing", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/fidl/fuchsia.accessibility.semantics", + "${fuchsia_sdk}/fidl/fuchsia.buildinfo", + "${fuchsia_sdk}/fidl/fuchsia.component", + "${fuchsia_sdk}/fidl/fuchsia.fonts", + "${fuchsia_sdk}/fidl/fuchsia.intl", + "${fuchsia_sdk}/fidl/fuchsia.kernel", + "${fuchsia_sdk}/fidl/fuchsia.memorypressure", + "${fuchsia_sdk}/fidl/fuchsia.metrics", + "${fuchsia_sdk}/fidl/fuchsia.net.interfaces", + "${fuchsia_sdk}/fidl/fuchsia.tracing.provider", + "${fuchsia_sdk}/fidl/fuchsia.ui.app", + "${fuchsia_sdk}/fidl/fuchsia.ui.display.singleton", + "${fuchsia_sdk}/fidl/fuchsia.ui.input", + "${fuchsia_sdk}/fidl/fuchsia.ui.pointerinjector", + "${fuchsia_sdk}/fidl/fuchsia.ui.test.input", + "${fuchsia_sdk}/fidl/fuchsia.ui.test.scene", + "${fuchsia_sdk}/fidl/fuchsia.web", + "${fuchsia_sdk}/pkg/async", + "${fuchsia_sdk}/pkg/async-loop-testing", + "${fuchsia_sdk}/pkg/fidl_cpp", + "${fuchsia_sdk}/pkg/sys_component_cpp_testing", + "${fuchsia_sdk}/pkg/zx", "embedding-flutter-view:package", "touch-input-view:package", "//flutter/fml", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/embedding-flutter-view/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/embedding-flutter-view/BUILD.gn index 6e86329531..e532a158c8 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/embedding-flutter-view/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/embedding-flutter-view/BUILD.gn @@ -2,10 +2,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/tools/fuchsia/dart/dart_library.gni") import("//flutter/tools/fuchsia/flutter/flutter_component.gni") import("//flutter/tools/fuchsia/gn-sdk/src/component.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("//flutter/tools/fuchsia/gn-sdk/src/package.gni") dart_library("lib") { diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/touch-input-view/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/touch-input-view/BUILD.gn index 9ef6301ece..2ba2fa5a73 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/touch-input-view/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/touch-input-view/BUILD.gn @@ -2,10 +2,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/tools/fuchsia/dart/dart_library.gni") import("//flutter/tools/fuchsia/flutter/flutter_component.gni") import("//flutter/tools/fuchsia/gn-sdk/src/component.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") import("//flutter/tools/fuchsia/gn-sdk/src/package.gni") dart_library("lib") { diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn index e7b6dc4018..613976f205 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn @@ -4,7 +4,7 @@ assert(is_fuchsia) -import("//build/fuchsia/sdk.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") source_set("check_view") { sources = [ @@ -13,8 +13,8 @@ source_set("check_view") { ] deps = [ - "$fuchsia_sdk_root/fidl:fuchsia.ui.observation.geometry", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/fidl/fuchsia.ui.observation.geometry", + "${fuchsia_sdk}/pkg/zx", "//flutter/fml", ] } @@ -26,8 +26,8 @@ source_set("screenshot") { ] deps = [ - "$fuchsia_sdk_root/fidl:fuchsia.logger", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/fidl/fuchsia.logger", + "${fuchsia_sdk}/pkg/zx", "//flutter/fml", ] } @@ -41,17 +41,18 @@ source_set("portable_ui_test") { deps = [ ":check_view", - "$fuchsia_sdk_root/fidl:fuchsia.inspect", - "$fuchsia_sdk_root/fidl:fuchsia.logger", - "$fuchsia_sdk_root/fidl:fuchsia.ui.app", - "$fuchsia_sdk_root/fidl:fuchsia.ui.composition", - "$fuchsia_sdk_root/fidl:fuchsia.ui.display.singleton", - "$fuchsia_sdk_root/fidl:fuchsia.ui.input", - "$fuchsia_sdk_root/fidl:fuchsia.ui.observation.geometry", - "$fuchsia_sdk_root/fidl:fuchsia.ui.test.input", - "$fuchsia_sdk_root/fidl:fuchsia.ui.test.scene", - "$fuchsia_sdk_root/pkg:async-loop-testing", - "$fuchsia_sdk_root/pkg:sys_component_cpp_testing", + "${fuchsia_sdk}/fidl/fuchsia.inspect", + "${fuchsia_sdk}/fidl/fuchsia.logger", + "${fuchsia_sdk}/fidl/fuchsia.tracing.provider", + "${fuchsia_sdk}/fidl/fuchsia.ui.app", + "${fuchsia_sdk}/fidl/fuchsia.ui.composition", + "${fuchsia_sdk}/fidl/fuchsia.ui.display.singleton", + "${fuchsia_sdk}/fidl/fuchsia.ui.input", + "${fuchsia_sdk}/fidl/fuchsia.ui.observation.geometry", + "${fuchsia_sdk}/fidl/fuchsia.ui.test.input", + "${fuchsia_sdk}/fidl/fuchsia.ui.test.scene", + "${fuchsia_sdk}/pkg/async-loop-testing", + "${fuchsia_sdk}/pkg/sys_component_cpp_testing", "//flutter/fml", ] } diff --git a/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/BUILD.gn index 0892d2e888..08660b5143 100644 --- a/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/BUILD.gn @@ -4,9 +4,9 @@ assert(is_fuchsia) -import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/testing/testing.gni") +import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") config("utils_config") { include_dirs = [ "../../.." ] @@ -37,17 +37,17 @@ template("make_utils") { deps = invoker.deps + [ ":generate_build_info_cc_file", - "$fuchsia_sdk_root/fidl:fuchsia.feedback", - "$fuchsia_sdk_root/fidl:fuchsia.mem", - "$fuchsia_sdk_root/pkg:async-loop", - "$fuchsia_sdk_root/pkg:async-loop-cpp", - "$fuchsia_sdk_root/pkg:async-loop-default", - "$fuchsia_sdk_root/pkg:fdio", - "$fuchsia_sdk_root/pkg:sys_cpp", - "$fuchsia_sdk_root/pkg:inspect_component_cpp", - "$fuchsia_sdk_root/pkg:trace", - "$fuchsia_sdk_root/pkg:vfs_cpp", - "$fuchsia_sdk_root/pkg:zx", + "${fuchsia_sdk}/fidl/fuchsia.feedback", + "${fuchsia_sdk}/fidl/fuchsia.mem", + "${fuchsia_sdk}/pkg/async-loop", + "${fuchsia_sdk}/pkg/async-loop-cpp", + "${fuchsia_sdk}/pkg/async-loop-default", + "${fuchsia_sdk}/pkg/fdio", + "${fuchsia_sdk}/pkg/sys_cpp", + "${fuchsia_sdk}/pkg/inspect_component_cpp", + "${fuchsia_sdk}/pkg/trace", + "${fuchsia_sdk}/pkg/vfs_cpp", + "${fuchsia_sdk}/pkg/zx", "//flutter/fml", "//flutter/third_party/tonic", ] @@ -94,7 +94,7 @@ executable("dart_utils_unittests") { libs = [ # This is needed for //flutter/third_party/googletest for linking zircon # symbols. - "$fuchsia_sdk_path/arch/$target_cpu/sysroot/lib/libzircon.so", + "${fuchsia_arch_root}/sysroot/lib/libzircon.so", ] deps = [ @@ -102,8 +102,8 @@ executable("dart_utils_unittests") { ":utils_fixtures", "$dart_src/runtime:libdart_jit", "$dart_src/runtime/bin:dart_io_api", - "$fuchsia_sdk_root/pkg:inspect_component_cpp", - "$fuchsia_sdk_root/pkg:sys_cpp", + "${fuchsia_sdk}/pkg/inspect_component_cpp", + "${fuchsia_sdk}/pkg/sys_cpp", "//flutter/testing", ] } diff --git a/engine/src/flutter/shell/testing/BUILD.gn b/engine/src/flutter/shell/testing/BUILD.gn index 31ff57aa49..28a19c75d1 100644 --- a/engine/src/flutter/shell/testing/BUILD.gn +++ b/engine/src/flutter/shell/testing/BUILD.gn @@ -2,10 +2,13 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/impeller/tools/impeller.gni") import("//flutter/shell/gpu/gpu.gni") +if (is_fuchsia) { + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") +} + shell_gpu_configuration("tester_gpu_configuration") { enable_software = true enable_gl = true diff --git a/engine/src/flutter/skia/BUILD.gn b/engine/src/flutter/skia/BUILD.gn index c2f1aea1c3..ef594071b5 100644 --- a/engine/src/flutter/skia/BUILD.gn +++ b/engine/src/flutter/skia/BUILD.gn @@ -10,7 +10,7 @@ import("$_skia_root/gn/toolchain/wasm.gni") import("flutter_defines.gni") if (is_fuchsia) { - import("//build/fuchsia/sdk.gni") + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") } # Skia public API, generally provided by :skia. @@ -287,8 +287,8 @@ optional("fontmgr_fuchsia") { deps = [] - if (is_fuchsia && using_fuchsia_sdk) { - deps += [ "//build/fuchsia/fidl:fuchsia.fonts" ] + if (is_fuchsia) { + deps += [ "${fuchsia_sdk}/fidl/fuchsia.fonts" ] } else { deps = [ "//sdk/fidl/fuchsia.fonts" ] } @@ -458,11 +458,7 @@ optional("gpu") { public += skia_gpu_vk_public sources += skia_gpu_vk_private if (is_fuchsia) { - if (using_fuchsia_sdk) { - public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ] - } else { - public_deps += [ "$_skia_root/src/graphics/lib/vulkan" ] - } + public_deps += [ "${fuchsia_sdk}/pkg/vulkan" ] } if (is_android) { sources += skia_gpu_vk_android_private diff --git a/engine/src/flutter/sky/packages/sky_engine/BUILD.gn b/engine/src/flutter/sky/packages/sky_engine/BUILD.gn index f03ddb53ea..bcef489889 100644 --- a/engine/src/flutter/sky/packages/sky_engine/BUILD.gn +++ b/engine/src/flutter/sky/packages/sky_engine/BUILD.gn @@ -2,7 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/build/dart/rules.gni") import("//flutter/lib/ui/dart_ui.gni") import("//flutter/web_sdk/web_sdk.gni") @@ -28,7 +27,9 @@ import("$dart_src/sdk/lib/js_util/js_util_sources.gni") import("$dart_src/sdk/lib/math/math_sources.gni") import("$dart_src/sdk/lib/typed_data/typed_data_sources.gni") -if (!is_fuchsia) { +if (is_fuchsia) { + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") +} else { copy("copy_sky_engine_authors") { sources = [ "//AUTHORS" ] diff --git a/engine/src/flutter/sky/packages/sky_engine/LICENSE b/engine/src/flutter/sky/packages/sky_engine/LICENSE index 546a8700b6..000defbd5c 100644 --- a/engine/src/flutter/sky/packages/sky_engine/LICENSE +++ b/engine/src/flutter/sky/packages/sky_engine/LICENSE @@ -31736,7 +31736,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. -You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/d006b668dcb252171d743526e2a2f3ba34f0c48e +You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/406955fe69503eb11fb16a8405534a979f5eef60 /third_party/fallback_root_certificates/ -------------------------------------------------------------------------------- diff --git a/engine/src/flutter/third_party/libjpeg-turbo/BUILD.gn b/engine/src/flutter/third_party/libjpeg-turbo/BUILD.gn index fa1802263b..d6bef4c58e 100644 --- a/engine/src/flutter/third_party/libjpeg-turbo/BUILD.gn +++ b/engine/src/flutter/third_party/libjpeg-turbo/BUILD.gn @@ -8,7 +8,9 @@ if (current_cpu == "arm") { import("//build/config/arm.gni") } -import("//build/fuchsia/sdk.gni") +if (is_fuchsia) { + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") +} if ((current_cpu == "x86" || current_cpu == "x64") && is_fuchsia && !using_fuchsia_sdk) { diff --git a/engine/src/flutter/third_party/txt/BUILD.gn b/engine/src/flutter/third_party/txt/BUILD.gn index 804865e088..9079ed1585 100644 --- a/engine/src/flutter/third_party/txt/BUILD.gn +++ b/engine/src/flutter/third_party/txt/BUILD.gn @@ -12,10 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/testing/testing.gni") +if (is_fuchsia) { + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") +} + declare_args() { flutter_use_fontconfig = false } @@ -109,7 +112,7 @@ source_set("txt") { sources += [ "src/txt/platform_linux.cc" ] } else if (is_fuchsia) { sources += [ "src/txt/platform_fuchsia.cc" ] - deps += [ "$fuchsia_sdk_root/fidl:fuchsia.fonts" ] + deps += [ "${fuchsia_sdk}/fidl/fuchsia.fonts" ] } else if (is_win) { sources += [ "src/txt/platform_windows.cc" ] } else { @@ -174,7 +177,7 @@ if (enable_unittests) { # symbols. if (is_fuchsia) { libs = - [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ] + [ "${fuchsia_arch_root}/sysroot/lib/libzircon.so" ] } } } diff --git a/engine/src/flutter/tools/fuchsia/dart/BUILD.gn b/engine/src/flutter/tools/fuchsia/dart/BUILD.gn index a1efa3520a..b68777d2b4 100644 --- a/engine/src/flutter/tools/fuchsia/dart/BUILD.gn +++ b/engine/src/flutter/tools/fuchsia/dart/BUILD.gn @@ -17,6 +17,6 @@ if (current_toolchain == default_toolchain) { if (current_toolchain != default_toolchain) { sdk_targets("dart_library") { - meta = "$fuchsia_sdk_path/meta/manifest.json" + meta = "$fuchsia_sdk/meta/manifest.json" } } diff --git a/engine/src/flutter/tools/fuchsia/fidl/BUILD.gn b/engine/src/flutter/tools/fuchsia/fidl/BUILD.gn deleted file mode 100644 index 0855b3f0bc..0000000000 --- a/engine/src/flutter/tools/fuchsia/fidl/BUILD.gn +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2013 The Flutter 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/fuchsia/sdk.gni") -import("//flutter/tools/fuchsia/fidl/fidl.gni") -import("//flutter/tools/fuchsia/fidl/toolchain.gni") -import("//flutter/tools/fuchsia/sdk/sdk_targets.gni") -import("//flutter/tools/fuchsia/toolchain/basic_toolchain.gni") - -# A toolchain dedicated to processing FIDL libraries. -# The only targets in this toolchain are action() targets, so it -# has no real tools. But every toolchain needs stamp and copy. -if (current_toolchain == default_toolchain) { - basic_toolchain("fidling") { - expected_label = fidl_toolchain - } -} - -if (current_toolchain != default_toolchain) { - sdk_targets("fidl_library") { - meta = "$fuchsia_sdk_path/meta/manifest.json" - } -} diff --git a/engine/src/flutter/tools/fuchsia/fidl/fidl.gni b/engine/src/flutter/tools/fuchsia/fidl/fidl.gni deleted file mode 100644 index c38db0a957..0000000000 --- a/engine/src/flutter/tools/fuchsia/fidl/fidl.gni +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2013 The Flutter 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/fuchsia/sdk.gni") -import("//flutter/tools/fuchsia/fidl/toolchain.gni") - -# Declares a FIDL library. -# -# Depending on the toolchain in which this targets is expanded, it will yield -# different results: -# - in the FIDL toolchain, it will compile its source files into an -# intermediate representation consumable by language bindings generators; -# - in the target or shared toolchain, this will produce a source_set -# containing language-specific bindings. -template("fidl") { - # Allow generated targets visibility to their dependant generated targets - if (defined(invoker.visibility)) { - invoker.visibility += [ ":*" ] - } - - assert(!defined(invoker.deps), - "All FIDL dependencies are inherently " + - "public, use 'public_deps' instead of 'deps'.") - - if (current_toolchain == fidl_toolchain) { - import("//flutter/tools/fuchsia/fidl/fidl_library.gni") - - not_needed(invoker, [ "meta" ]) - - fidl_library(target_name) { - forward_variables_from(invoker, "*") - } - } else if (current_toolchain == default_toolchain) { - not_needed(invoker, - [ - "name", - "sources", - ]) - - fuchsia_fidl_library(target_name) { - forward_variables_from(invoker, "*") - } - } else { - not_needed(invoker, "*") - not_needed("*") - } -} diff --git a/engine/src/flutter/tools/fuchsia/fidl/fidl_library.gni b/engine/src/flutter/tools/fuchsia/fidl/fidl_library.gni deleted file mode 100644 index ae8299485a..0000000000 --- a/engine/src/flutter/tools/fuchsia/fidl/fidl_library.gni +++ /dev/null @@ -1,151 +0,0 @@ -# Copyright 2013 The Flutter 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("//flutter/tools/executable_action.gni") -import("//flutter/tools/fuchsia/fidl/fidl.gni") -import("//flutter/tools/fuchsia/fidl/toolchain.gni") -import("//flutter/tools/fuchsia/gn-sdk/src/config/config.gni") - -# TODO(zijiehe): May use fidl_library in gn-sdk if possible. - http://crbug.com/40935282 - -# Generates some representation of a FIDL library that's consumable by Language -# bindings generators. -# -# The parameters for this template are defined in //flutter/tools/fuchsia/fidl/fidl.gni. The -# relevant parameters in this template are: -# - name; -# - sources. - -template("fidl_library") { - assert( - current_toolchain == fidl_toolchain, - "This template can only be used in the FIDL toolchain $fidl_toolchain.") - - assert(defined(invoker.sources), "A FIDL library requires some sources.") - - assert(fuchsia_target_api_level != -1, - "Must set a target api level when using FIDL libraries") - - library_name = target_name - if (defined(invoker.name)) { - library_name = invoker.name - } - - response_file = "$target_gen_dir/$target_name.args" - fidl_stem = "$target_gen_dir/$target_name.fidl" - json_representation = "$fidl_stem.json" - - coding_tables = "$fidl_stem.tables.c" - - main_target_name = target_name - response_file_target_name = "${target_name}_response_file" - compilation_target_name = "${target_name}_compile" - - # Only artifacts that have various associated FIDL generated targets. - fidl_deps = [] - - # Artifacts other than FIDL, that are also dependencies. - non_fidl_deps = [] - - if (defined(invoker.non_fidl_deps)) { - non_fidl_deps += invoker.non_fidl_deps - } - - if (defined(invoker.deps)) { - fidl_deps += invoker.deps - non_fidl_deps - } - if (defined(invoker.public_deps)) { - fidl_deps += invoker.public_deps - } - - action(response_file_target_name) { - visibility = [ ":*" ] - - script = "//flutter/tools/fuchsia/fidl/gen_response_file.py" - - forward_variables_from(invoker, - [ - "deps", - "public_deps", - "sources", - "testonly", - ]) - - libraries = "$target_gen_dir/$main_target_name.libraries" - - outputs = [ - response_file, - libraries, - ] - - args = [ - "--out-response-file", - rebase_path(response_file, root_build_dir), - "--out-libraries", - rebase_path(libraries, root_build_dir), - "--json", - rebase_path(json_representation, root_build_dir), - "--tables", - rebase_path(coding_tables, root_build_dir), - "--name", - library_name, - "--available", - "fuchsia:${fuchsia_target_api_level}", - "--sources", - ] + rebase_path(sources, root_build_dir) - - if (fidl_deps != []) { - dep_libraries = [] - - foreach(dep, fidl_deps) { - gen_dir = get_label_info(dep, "target_gen_dir") - name = get_label_info(dep, "name") - dep_libraries += [ "$gen_dir/$name.libraries" ] - } - - inputs = dep_libraries - - args += [ "--dep-libraries" ] + rebase_path(dep_libraries, root_build_dir) - } - } - - executable_action(compilation_target_name) { - forward_variables_from(invoker, [ "testonly" ]) - - visibility = [ ":*" ] - - tool = "$fuchsia_tool_dir/fidlc" - - inputs = [ response_file ] - - outputs = [ - coding_tables, - json_representation, - ] - - args = [ "@" + rebase_path(response_file, root_build_dir) ] - - deps = [ ":$response_file_target_name" ] + non_fidl_deps - } - - group(main_target_name) { - forward_variables_from(invoker, - [ - "testonly", - "visibility", - "response_file", - ]) - - # Metadata to allow us to query all FIDL IR files. - metadata = { - fidl_json = [ rebase_path(json_representation, root_build_dir) ] - generated_sources = fidl_json - } - - public_deps = [ - ":$compilation_target_name", - ":$response_file_target_name", - ] - } -} diff --git a/engine/src/flutter/tools/fuchsia/fidl/gen_response_file.py b/engine/src/flutter/tools/fuchsia/fidl/gen_response_file.py deleted file mode 100755 index 309e6f2343..0000000000 --- a/engine/src/flutter/tools/fuchsia/fidl/gen_response_file.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python3 -# Copyright 2013 The Flutter 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 argparse -from pathlib import Path - - -def main(): - parser = argparse.ArgumentParser( - description="Generate response file for FIDL frontend. " - "Arguments not mentioned here are forwarded as is to fidlc." - ) - parser.add_argument( - "--out-response-file", - help="The path for for the response file to generate", - type=Path, - required=True - ) - parser.add_argument( - "--out-libraries", - help="The path for for the libraries file to generate", - type=Path, - required=True - ) - parser.add_argument("--sources", help="List of FIDL source files", nargs="+", required=True) - parser.add_argument("--dep-libraries", help="List of dependent libraries", nargs="*") - args, args_to_forward = parser.parse_known_args() - - # Each line contains a library's source files separated by spaces. - # We use a dict instead of a set to maintain insertion order. - dep_lines = {} - for path in args.dep_libraries or []: - with open(path) as f: - for line in f: - dep_lines[line.rstrip()] = True - libraries = list(dep_lines) - libraries.append(" ".join(sorted(args.sources))) - - args.out_libraries.parent.mkdir(parents=True, exist_ok=True) - with open(args.out_libraries, "w") as f: - print("\n".join(libraries), file=f) - - args.out_response_file.parent.mkdir(parents=True, exist_ok=True) - with open(args.out_response_file, "w") as f: - fidlc_args = args_to_forward + ["--files " + line for line in libraries] - print(" ".join(fidlc_args), file=f) - - -if __name__ == "__main__": - main() diff --git a/engine/src/flutter/tools/fuchsia/fidl/toolchain.gni b/engine/src/flutter/tools/fuchsia/fidl/toolchain.gni deleted file mode 100644 index 503c5b6688..0000000000 --- a/engine/src/flutter/tools/fuchsia/fidl/toolchain.gni +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright 2013 The Flutter Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -fidl_toolchain = "//flutter/tools/fuchsia/fidl:fidling" diff --git a/engine/src/flutter/tools/fuchsia/fuchsia_archive.gni b/engine/src/flutter/tools/fuchsia/fuchsia_archive.gni index 41e51e09f1..9161dd0ccf 100644 --- a/engine/src/flutter/tools/fuchsia/fuchsia_archive.gni +++ b/engine/src/flutter/tools/fuchsia/fuchsia_archive.gni @@ -2,7 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/config.gni") import("//flutter/tools/fuchsia/fuchsia_debug_symbols.gni") import("//flutter/tools/fuchsia/fuchsia_libs.gni") import("//flutter/tools/fuchsia/gn-sdk/src/cmc.gni") diff --git a/engine/src/flutter/tools/fuchsia/sdk/sdk_targets.gni b/engine/src/flutter/tools/fuchsia/sdk/sdk_targets.gni index f0b5c8a649..274dd7be0b 100644 --- a/engine/src/flutter/tools/fuchsia/sdk/sdk_targets.gni +++ b/engine/src/flutter/tools/fuchsia/sdk/sdk_targets.gni @@ -2,11 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") import("//flutter/tools/fuchsia/dart/dart_library.gni") -import("//flutter/tools/fuchsia/fidl/fidl.gni") - -_fuchsia_sdk_path = "//fuchsia/sdk/$host_os" +import("//flutter/tools/fuchsia/gn-sdk/src/fidl_library.gni") template("_fuchsia_dart_library") { assert(defined(invoker.meta), "The meta file content must be specified.") @@ -63,7 +60,7 @@ template("_fuchsia_dart_library") { } dart_library(target_name) { - package_root = "${_fuchsia_sdk_path}/${meta.root}" + package_root = "${fuchsia_sdk}/${meta.root}" package_name = _output_name language_version = _dart_language_version sources = _sources @@ -71,23 +68,6 @@ template("_fuchsia_dart_library") { } } -template("_fuchsia_fidl_library") { - assert(defined(invoker.meta), "The meta file content must be specified.") - meta = invoker.meta - assert(meta.type == "fidl_library") - - fidl(target_name) { - sources = [] - foreach(source, meta.sources) { - sources += [ "$fuchsia_sdk_path/$source" ] - } - public_deps = [] - foreach(dep, meta.deps) { - public_deps += [ ":$dep" ] - } - } -} - template("sdk_targets") { assert(defined(invoker.meta), "The meta.json file path must be specified.") @@ -99,7 +79,7 @@ template("sdk_targets") { part_meta_json = { } part_meta = part.meta - part_meta_rebased = "$fuchsia_sdk_path/$part_meta" + part_meta_rebased = "$fuchsia_sdk/$part_meta" if (part_meta != "version_history.json") { part_meta_json = read_file(part_meta_rebased, "json") @@ -119,7 +99,7 @@ template("sdk_targets") { meta = part_meta_json } } else if (target_type == "fidl_library") { - _fuchsia_fidl_library(subtarget_name) { + fidl_library(subtarget_name) { meta = part_meta_json } } diff --git a/engine/src/flutter/tools/fuchsia/with_envs.py b/engine/src/flutter/tools/fuchsia/with_envs.py index 73f3ace1a4..bb23636a41 100644 --- a/engine/src/flutter/tools/fuchsia/with_envs.py +++ b/engine/src/flutter/tools/fuchsia/with_envs.py @@ -29,6 +29,9 @@ def Main(): assert platform.system() == 'Linux', 'Unsupported OS ' + platform.system() os.environ['FUCHSIA_SDK_ROOT'] = os.path.join(os.environ['SRC_ROOT'], 'fuchsia/sdk/linux/') + os.environ['FUCHSIA_GN_SDK_ROOT'] = os.path.join( + os.environ['SRC_ROOT'], 'flutter/tools/fuchsia/gn-sdk/src' + ) if os.getenv('DOWNLOAD_FUCHSIA_SDK') == 'True': sdk_path = os.environ['FUCHSIA_SDK_PATH'] diff --git a/engine/src/flutter/vulkan/BUILD.gn b/engine/src/flutter/vulkan/BUILD.gn index 0dbb894675..8dce31a768 100644 --- a/engine/src/flutter/vulkan/BUILD.gn +++ b/engine/src/flutter/vulkan/BUILD.gn @@ -2,7 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/fuchsia/sdk.gni") +if (is_fuchsia) { + import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni") +} source_set("vulkan") { sources = [