Use FlutterFeatures to configure web and desktop devices#36465
Use FlutterFeatures to configure web and desktop devices#36465jonahwilliams merged 9 commits intoflutter:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #36465 +/- ##
==========================================
+ Coverage 54.03% 54.75% +0.72%
==========================================
Files 188 188
Lines 17344 17303 -41
==========================================
+ Hits 9372 9475 +103
+ Misses 7972 7828 -144
Continue to review full report at Codecov.
|
| @@ -101,10 +101,18 @@ class BuildBundleCommand extends BuildSubCommand { | |||
| // Check for target platforms that are only allowed on unstable Flutter. | |||
There was a problem hiding this comment.
Does this comment need an update?
| // Check for target platforms that are only allowed on unstable Flutter. | ||
| switch (platform) { | ||
| case TargetPlatform.darwin_x64: | ||
| if (featureFlags.isMacOSEnabled) { |
There was a problem hiding this comment.
Aren't these all backwards?
(Follow-up: does that mean this codepath isn't tested?)
There was a problem hiding this comment.
These were wrong, I've added positive/negative test cases for both
| @@ -21,10 +21,10 @@ class LinuxWorkflow implements Workflow { | |||
| bool get appliesToHostPlatform => platform.isLinux; | |||
There was a problem hiding this comment.
Shouldn't these be gated on it being enabled too? That's how web is done, and it seems odd to be inconsistent about it. That would also simplify other code, since, e.g., the doctor conditions wouldn't need to check the feature flag.
There was a problem hiding this comment.
Yeah, moving the check here simplifies the rest of the code
| /// Only add desktop devices if the flag is enabled. | ||
| static List<DeviceDiscovery> get _conditionalDesktopDevices { | ||
| return flutterDesktopEnabled ? <DeviceDiscovery>[ | ||
| if (featureFlags.isMacOSEnabled) |
There was a problem hiding this comment.
Do we actually need any of these checks? The devices object will say it can't discover devices anyways, right? Having the checks consolidated in fewer places seems easier.
| if (linuxWorkflow.appliesToHostPlatform) LinuxDoctorValidator(), | ||
| if (windowsWorkflow.appliesToHostPlatform) visualStudioValidator, | ||
| ], | ||
| if (featureFlags.isLinuxEnabled && linuxWorkflow.appliesToHostPlatform) |
There was a problem hiding this comment.
Linux and Windows are behind a check here, but macOS isn't; it should be consistent (even though in practice it doesn't matter, since iOS applying is the same as being on macOS). Per my later comment I think the better option is to remove them all here, but if you don't go that route you should add the check for macOS.
|
I've also removed the |
)" This reverts commit bd52a78.
…tter#36465)" (flutter#36654) This reverts commit bd52a78.
Description
A follow up to #36138, this PR enables the usage of flutter config for web, Linux, macOS, and Windows features. This removes the on-by default behavior of these features on master branch and instead replaces it with a configurable flag. For backwards compatibility, the old environment variables
ENABLE_FLUTER_DESKTOPandFLUTTER_WEBstill exist. I would like to deprecate and remove these at some point in the future, and encourage user to provide config values.Example: