Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions shell/platform/darwin/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import("//flutter/shell/platform/config.gni")
group("darwin") {
if (is_ios) {
deps = [ "ios:flutter_framework" ]
if (is_debug) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just if (enable_unittests)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable_unittests = current_toolchain == host_toolchain || is_fuchsia || is_mac, I will add || is_ios

deps += [ "//flutter/shell/platform/darwin/ios:ios_test_flutter" ]
}
}
if (is_mac) {
deps = []
Expand Down
6 changes: 4 additions & 2 deletions shell/platform/darwin/ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,10 @@ source_set("ios_test_flutter_mrc") {
}

shared_library("ios_test_flutter") {
testonly = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we getting rid of this? It seems like a useful guard against non-test targets including test TUs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this flag is on, because flutter_framework is not testonly, it cannot depend on ios_test_flutter

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not make flutter_framework depend on ios_test_flutter, we should update some higher level BUILD.gn that checks if unit tests are enabled and if so include ios_test_flutter (if ios etc.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. in //BUILD.gn something like

if (enable_unittests && is_ios) {
  public_deps += [ "//flutter/shell/platform/darwin/ios:ios_test_flutter" ]
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add testonly= true back now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Or I can make group(darwin) testonly? If that's a problem I can move the dependency to a upper level. Eventually I should be able to find a unbrella build target that is testonly up in the chain.

visibility = [ ":*" ]
visibility = [
":*",
"//flutter/shell/platform/darwin:*",
]
cflags = [
"-fvisibility=default",
"-F$platform_frameworks_path",
Expand Down