From 3fba7fea1314752b8f736a1c59a6e84a9ee0549c Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 3 Aug 2023 09:57:19 -0700 Subject: [PATCH 1/3] [darwin] Move common targets to common/BUILD.gn Previously, some common Darwin framework targets existed in: //flutter/shell/platform/darwin/BUILD.gn This moves all targets into: //flutter/shell/platform/darwin/common/BUILD.gn --- BUILD.gn | 2 +- shell/platform/darwin/BUILD.gn | 68 --------------------------- shell/platform/darwin/common/BUILD.gn | 26 ++++++++++ 3 files changed, 27 insertions(+), 69 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 46a1e76c8fcea..cc200a1824c73 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -187,7 +187,7 @@ group("unittests") { if (is_mac) { public_deps += [ "//flutter/impeller/golden_tests:impeller_golden_tests", - "//flutter/shell/platform/darwin:flutter_channels_unittests", + "//flutter/shell/platform/darwin/common:flutter_channels_unittests", "//flutter/third_party/spring_animation:spring_animation_unittests", ] } diff --git a/shell/platform/darwin/BUILD.gn b/shell/platform/darwin/BUILD.gn index 7ff997fa4fced..c1db2da1341dc 100644 --- a/shell/platform/darwin/BUILD.gn +++ b/shell/platform/darwin/BUILD.gn @@ -5,7 +5,6 @@ assert(is_mac || is_ios) import("//flutter/shell/platform/config.gni") -import("//flutter/testing/testing.gni") group("darwin") { if (is_ios) { @@ -18,70 +17,3 @@ group("darwin") { } } } - -source_set("flutter_channels") { - cflags_objc = flutter_cflags_objc - cflags_objcc = flutter_cflags_objcc - - sources = [ - "common/buffer_conversions.h", - "common/buffer_conversions.mm", - ] - - deps = [ "//flutter/fml" ] - - public_deps = [ ":flutter_channels_arc" ] - - public_configs = [ "//flutter:config" ] -} - -source_set("flutter_channels_arc") { - cflags_objc = flutter_cflags_objc_arc - cflags_objcc = flutter_cflags_objcc_arc - - sources = [ - "common/framework/Headers/FlutterBinaryMessenger.h", - "common/framework/Headers/FlutterChannels.h", - "common/framework/Headers/FlutterCodecs.h", - "common/framework/Headers/FlutterMacros.h", - "common/framework/Source/FlutterChannels.mm", - "common/framework/Source/FlutterCodecs.mm", - "common/framework/Source/FlutterStandardCodec.mm", - "common/framework/Source/FlutterStandardCodecHelper.cc", - "common/framework/Source/FlutterStandardCodec_Internal.h", - ] - - public = [ - "common/framework/Headers/FlutterBinaryMessenger.h", - "common/framework/Headers/FlutterChannels.h", - "common/framework/Headers/FlutterCodecs.h", - "common/framework/Headers/FlutterMacros.h", - "common/framework/Source/FlutterStandardCodec_Internal.h", - ] - - public_configs = [ "//flutter:config" ] - - deps = [ "//flutter/fml" ] -} - -test_fixtures("flutter_channels_fixtures") { - fixtures = [] -} - -executable("flutter_channels_unittests") { - testonly = true - - sources = [ - "common/framework/Source/flutter_codecs_unittest.mm", - "common/framework/Source/flutter_standard_codec_unittest.mm", - ] - - deps = [ - ":flutter_channels", - ":flutter_channels_fixtures", - "//flutter/testing", - "//third_party/dart/runtime:libdart_jit", - ] - - public_configs = [ "//flutter:config" ] -} diff --git a/shell/platform/darwin/common/BUILD.gn b/shell/platform/darwin/common/BUILD.gn index d7c0a0cf17be6..e409d1d435bb5 100644 --- a/shell/platform/darwin/common/BUILD.gn +++ b/shell/platform/darwin/common/BUILD.gn @@ -2,7 +2,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +assert(is_mac || is_ios) + import("//flutter/common/config.gni") +import("//flutter/testing/testing.gni") import("framework_shared.gni") source_set("common") { @@ -56,3 +59,26 @@ source_set("framework_shared") { deps = [ "//flutter/fml" ] } + +test_fixtures("flutter_channels_fixtures") { + fixtures = [] +} + +# Unit tests for channels. +executable("flutter_channels_unittests") { + testonly = true + + sources = [ + "framework/Source/flutter_codecs_unittest.mm", + "framework/Source/flutter_standard_codec_unittest.mm", + ] + + deps = [ + ":flutter_channels_fixtures", + ":framework_shared", + "//flutter/testing", + "//third_party/dart/runtime:libdart_jit", + ] + + public_configs = [ "//flutter:config" ] +} From bd9730c989bc223c5ec1afd2546028e9cc33e22e Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 3 Aug 2023 11:40:46 -0700 Subject: [PATCH 2/3] Rename flutter_channels_unittests to framework_shared_unittests --- BUILD.gn | 2 +- shell/platform/darwin/common/BUILD.gn | 2 +- testing/run_tests.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index cc200a1824c73..4dfad28314bc0 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -187,7 +187,7 @@ group("unittests") { if (is_mac) { public_deps += [ "//flutter/impeller/golden_tests:impeller_golden_tests", - "//flutter/shell/platform/darwin/common:flutter_channels_unittests", + "//flutter/shell/platform/darwin/common:framework_shared_unittests", "//flutter/third_party/spring_animation:spring_animation_unittests", ] } diff --git a/shell/platform/darwin/common/BUILD.gn b/shell/platform/darwin/common/BUILD.gn index e409d1d435bb5..22a193f469482 100644 --- a/shell/platform/darwin/common/BUILD.gn +++ b/shell/platform/darwin/common/BUILD.gn @@ -65,7 +65,7 @@ test_fixtures("flutter_channels_fixtures") { } # Unit tests for channels. -executable("flutter_channels_unittests") { +executable("framework_shared_unittests") { testonly = true sources = [ diff --git a/testing/run_tests.py b/testing/run_tests.py index a73182a9cd200..2e2cb6724413f 100755 --- a/testing/run_tests.py +++ b/testing/run_tests.py @@ -418,7 +418,7 @@ def make_test(name, flags=None, extra_env=None): unittests += [ # The accessibility library only supports Mac and Windows. make_test('accessibility_unittests'), - make_test('flutter_channels_unittests'), + make_test('framework_shared_unittests'), make_test('spring_animation_unittests'), ] From 58a9800d6d9e3c676566258d28cce191947027d1 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 3 Aug 2023 12:42:52 -0700 Subject: [PATCH 3/3] Rename _shared to _common --- BUILD.gn | 2 +- shell/platform/darwin/common/BUILD.gn | 14 +++++++------- .../{framework_shared.gni => framework_common.gni} | 2 +- shell/platform/darwin/graphics/BUILD.gn | 2 +- shell/platform/darwin/ios/BUILD.gn | 12 ++++++------ shell/platform/darwin/macos/BUILD.gn | 8 ++++---- testing/run_tests.py | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) rename shell/platform/darwin/common/{framework_shared.gni => framework_common.gni} (95%) diff --git a/BUILD.gn b/BUILD.gn index 4dfad28314bc0..8bb4183c6ff89 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -187,7 +187,7 @@ group("unittests") { if (is_mac) { public_deps += [ "//flutter/impeller/golden_tests:impeller_golden_tests", - "//flutter/shell/platform/darwin/common:framework_shared_unittests", + "//flutter/shell/platform/darwin/common:framework_common_unittests", "//flutter/third_party/spring_animation:spring_animation_unittests", ] } diff --git a/shell/platform/darwin/common/BUILD.gn b/shell/platform/darwin/common/BUILD.gn index 22a193f469482..e359d1c332588 100644 --- a/shell/platform/darwin/common/BUILD.gn +++ b/shell/platform/darwin/common/BUILD.gn @@ -6,7 +6,7 @@ assert(is_mac || is_ios) import("//flutter/common/config.gni") import("//flutter/testing/testing.gni") -import("framework_shared.gni") +import("framework_common.gni") source_set("common") { cflags_objc = flutter_cflags_objc @@ -32,7 +32,7 @@ config("framework_relative_headers") { } # Framework code shared between iOS and macOS. -source_set("framework_shared") { +source_set("framework_common") { cflags_objc = flutter_cflags_objc_arc cflags_objcc = flutter_cflags_objcc_arc @@ -46,7 +46,7 @@ source_set("framework_shared") { "framework/Source/FlutterStandardCodec_Internal.h", ] - public = framework_shared_headers + public = framework_common_headers public += [ "framework/Source/FlutterNSBundleUtils.h" ] @@ -60,12 +60,12 @@ source_set("framework_shared") { deps = [ "//flutter/fml" ] } -test_fixtures("flutter_channels_fixtures") { +test_fixtures("framework_common_fixtures") { fixtures = [] } # Unit tests for channels. -executable("framework_shared_unittests") { +executable("framework_common_unittests") { testonly = true sources = [ @@ -74,8 +74,8 @@ executable("framework_shared_unittests") { ] deps = [ - ":flutter_channels_fixtures", - ":framework_shared", + ":framework_common", + ":framework_common_fixtures", "//flutter/testing", "//third_party/dart/runtime:libdart_jit", ] diff --git a/shell/platform/darwin/common/framework_shared.gni b/shell/platform/darwin/common/framework_common.gni similarity index 95% rename from shell/platform/darwin/common/framework_shared.gni rename to shell/platform/darwin/common/framework_common.gni index 84f50a7da548e..02bb8b7dfb521 100644 --- a/shell/platform/darwin/common/framework_shared.gni +++ b/shell/platform/darwin/common/framework_common.gni @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -framework_shared_headers = +framework_common_headers = get_path_info([ "framework/Headers/FlutterMacros.h", "framework/Headers/FlutterBinaryMessenger.h", diff --git a/shell/platform/darwin/graphics/BUILD.gn b/shell/platform/darwin/graphics/BUILD.gn index fbb5a7a5b1035..acb55214b3507 100644 --- a/shell/platform/darwin/graphics/BUILD.gn +++ b/shell/platform/darwin/graphics/BUILD.gn @@ -23,7 +23,7 @@ source_set("graphics") { "//flutter/display_list", "//flutter/fml", "//flutter/shell/common", - "//flutter/shell/platform/darwin/common:framework_shared", + "//flutter/shell/platform/darwin/common:framework_common", ] if (impeller_supports_rendering) { diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 762d3ca94a228..7e49ab27a3f0a 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -9,7 +9,7 @@ import("//build/toolchain/clang.gni") import("//flutter/common/config.gni") import("//flutter/shell/config.gni") import("//flutter/shell/gpu/gpu.gni") -import("//flutter/shell/platform/darwin/common/framework_shared.gni") +import("//flutter/shell/platform/darwin/common/framework_common.gni") import("//flutter/testing/testing.gni") _flutter_framework_dir = "$root_out_dir/Flutter.framework" @@ -52,7 +52,7 @@ source_set("flutter_framework_source_arc") { ":flutter_framework_source", "//flutter/fml", "//flutter/shell/platform/common:common_cpp_input", - "//flutter/shell/platform/darwin/common:framework_shared", + "//flutter/shell/platform/darwin/common:framework_common", "//third_party/icu", ] public_configs = [ "//flutter:config" ] @@ -189,7 +189,7 @@ source_set("flutter_framework_source") { "//flutter/shell/common", "//flutter/shell/platform/common:common_cpp_input", "//flutter/shell/platform/darwin/common", - "//flutter/shell/platform/darwin/common:framework_shared", + "//flutter/shell/platform/darwin/common:framework_common", "//flutter/shell/platform/embedder:embedder_as_internal_library", "//flutter/shell/profiling:profiling", "//flutter/third_party/spring_animation", @@ -243,7 +243,7 @@ source_set("ios_test_flutter_mrc") { "//flutter/common:common", "//flutter/lib/ui:ui", "//flutter/shell/common:common", - "//flutter/shell/platform/darwin/common:framework_shared", + "//flutter/shell/platform/darwin/common:framework_common", "//flutter/shell/platform/embedder:embedder_as_internal_library", "//flutter/third_party/tonic", "//flutter/third_party/txt", @@ -308,7 +308,7 @@ shared_library("ios_test_flutter") { ":ios_test_flutter_mrc", "//flutter/common:common", "//flutter/lib/ui:ui", - "//flutter/shell/platform/darwin/common:framework_shared", + "//flutter/shell/platform/darwin/common:framework_common", "//flutter/shell/platform/embedder:embedder_as_internal_library", "//flutter/shell/platform/embedder:embedder_test_utils", "//flutter/third_party/spring_animation", @@ -397,7 +397,7 @@ action("copy_framework_headers") { script = "//flutter/sky/tools/install_framework_headers.py" visibility = [ ":*" ] sources = get_path_info(_flutter_framework_headers, "abspath") + - framework_shared_headers + framework_common_headers outputs = [] foreach(header, sources) { header_basename = get_path_info(header, "file") diff --git a/shell/platform/darwin/macos/BUILD.gn b/shell/platform/darwin/macos/BUILD.gn index 86f681b21fe57..ff209817409e1 100644 --- a/shell/platform/darwin/macos/BUILD.gn +++ b/shell/platform/darwin/macos/BUILD.gn @@ -7,7 +7,7 @@ assert(is_mac) import("//build/config/mac/mac_sdk.gni") import("//flutter/build/zip_bundle.gni") import("//flutter/shell/gpu/gpu.gni") -import("//flutter/shell/platform/darwin/common/framework_shared.gni") +import("//flutter/shell/platform/darwin/common/framework_common.gni") import("//flutter/shell/platform/glfw/config.gni") import("//flutter/testing/testing.gni") @@ -121,7 +121,7 @@ source_set("flutter_framework_source") { "//flutter/shell/platform/common:common_cpp_enums", "//flutter/shell/platform/common:common_cpp_input", "//flutter/shell/platform/common:common_cpp_switches", - "//flutter/shell/platform/darwin/common:framework_shared", + "//flutter/shell/platform/darwin/common:framework_common", "//flutter/shell/platform/darwin/graphics:graphics", "//flutter/shell/platform/embedder:embedder_as_internal_library", "//third_party/skia", @@ -204,7 +204,7 @@ executable("flutter_desktop_darwin_unittests") { ":flutter_framework_source", "//flutter/shell/platform/common:common_cpp_accessibility", "//flutter/shell/platform/common:common_cpp_enums", - "//flutter/shell/platform/darwin/common:framework_shared", + "//flutter/shell/platform/darwin/common:framework_common", "//flutter/shell/platform/darwin/graphics", "//flutter/shell/platform/embedder:embedder_as_internal_library", "//flutter/shell/platform/embedder:embedder_test_utils", @@ -241,7 +241,7 @@ action("copy_framework_headers") { script = "//flutter/sky/tools/install_framework_headers.py" visibility = [ ":*" ] sources = get_path_info(_flutter_framework_headers, "abspath") + - framework_shared_headers + framework_common_headers outputs = [] foreach(header, sources) { header_basename = get_path_info(header, "file") diff --git a/testing/run_tests.py b/testing/run_tests.py index 2e2cb6724413f..7f67c3aacbd44 100755 --- a/testing/run_tests.py +++ b/testing/run_tests.py @@ -418,7 +418,7 @@ def make_test(name, flags=None, extra_env=None): unittests += [ # The accessibility library only supports Mac and Windows. make_test('accessibility_unittests'), - make_test('framework_shared_unittests'), + make_test('framework_common_unittests'), make_test('spring_animation_unittests'), ]