-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Update minimum macOS version as needed in Swift package #152347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| final Directory xcodeProject = flutterProject.macos.xcodeProject; | ||
|
|
||
| // If the standard project exists, specify it to getInfo to handle the case where there are | ||
| // other Xcode projects in the macos/ directory. Otherwise pass no name, which will work | ||
| // regardless of the project name so long as there is exactly one project. | ||
| final String? xcodeProjectName = xcodeProject.existsSync() ? xcodeProject.basename : null; | ||
| final XcodeProjectInfo? projectInfo = await globals.xcodeProjectInterpreter?.getInfo( | ||
| xcodeProject.parent.path, | ||
| projectFilename: xcodeProjectName, | ||
| ); | ||
| final String? scheme = projectInfo?.schemeFor(buildInfo); | ||
| if (scheme == null) { | ||
| projectInfo!.reportFlavorNotFoundAndExit(); | ||
| } | ||
| final String? configuration = projectInfo?.buildConfigurationFor(buildInfo, scheme); | ||
| if (configuration == null) { | ||
| throwToolExit('Unable to find expected configuration in Xcode project.'); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code above this comment is existing code that was moved up in this method.
Code below this comment is new code that grabs the project's deployment target and uses it to update the generated Swift package.
This mirrors the same logic for iOS.
flutter/packages/flutter_tools/lib/src/ios/mac.dart
Lines 268 to 277 in 978657b
| if (project.usesSwiftPackageManager) { | |
| final String? iosDeploymentTarget = buildSettings['IPHONEOS_DEPLOYMENT_TARGET']; | |
| if (iosDeploymentTarget != null) { | |
| SwiftPackageManager.updateMinimumDeployment( | |
| platform: SupportedPlatform.ios, | |
| project: project.ios, | |
| deploymentTarget: iosDeploymentTarget, | |
| ); | |
| } | |
| } |
(This comment was stolen shamelessly from Jenn)
| configuration: configuration, | ||
| target: target, | ||
| deviceId: deviceId, | ||
| isMacOS: this is MacOSProject, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method was moved from IosProject to the base class XcodeBasedProject so it can be used by the subclass MacOSProject.
The only change to this method was the addition of this line: isMacOS: this is MacOSProject,
| this.environmentType = EnvironmentType.physical, | ||
| this.deviceId, | ||
| this.target, | ||
| this.isMacOS = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might make sense to instead change environmentType to instead match an enum like xcodebuild -showsdks
iOS, iOS simulator, macOS, etc. I think EnvironmentType is only used for iOS right now so you could change that, but I may be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, updated! I'm much happier with how this looks now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once the tests are happy, we can iterate on it as needed.
Also, I expect this to make flutter build macos benchmarks regress, fetching the build settings takes some time.
https://flutter-flutter-perf.skia.org/e/?numCommits=10&queries=test%3Dflutter_gallery_macos__compile%26test%3Dbasic_material_app_macos__compile%26test%3Dhello_world_macos__compile&selected=commit%3D41745%26name%3D%252Carch%253Dintel%252Cbranch%253Dmaster%252Cconfig%253Ddefault%252Cdevice_type%253Dnone%252Cdevice_version%253Dnone%252Chost_type%253Dmac%252Csub_result%253Drelease_size_bytes%252Ctest%253Dflutter_gallery_macos__compile%252C
|
I verified that |
Manual roll requested by [email protected] flutter/flutter@031dc3d...4d12197 2024-07-26 [email protected] further shard Mac tool_integration_tests from 4 to 5 shards (flutter/flutter#152399) 2024-07-26 [email protected] Change flutter_build_with_compilation_error_test to check stdout or stderr (flutter/flutter#152404) 2024-07-26 [email protected] [cupertino/icons.dart] Replace ligature references with characters corresponding to codepoints (flutter/flutter#152387) 2024-07-26 [email protected] Update minimum macOS version as needed in Swift package (flutter/flutter#152347) 2024-07-26 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.25.14 to 3.25.15 (flutter/flutter#152401) 2024-07-26 49699333+dependabot[bot]@users.noreply.github.com Bump ossf/scorecard-action from 2.3.3 to 2.4.0 (flutter/flutter#152400) 2024-07-26 [email protected] Update text_painter.dart (flutter/flutter#152398) 2024-07-26 [email protected] Fix some tests that fail with Swift Package Manager enabled (flutter/flutter#152267) 2024-07-26 [email protected] Reland "Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)" (flutter/flutter#152386) 2024-07-26 [email protected] Make `DragGestureRecognizer` abstract methods public (flutter/flutter#151627) 2024-07-26 [email protected] Fix cursor position when Unicode Zs category is entered in TextField (flutter/flutter#152215) 2024-07-26 [email protected] Roll Flutter Engine from 354abf2800a0 to e28f8755e25b (2 revisions) (flutter/flutter#152388) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
If Swift Package Manager is enabled, the tool generates a Swift package at `<ios/macos>/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/`. This Swift package is how the tool adds plugins to the Flutter project. SwiftPM is strictly enforces platform versions: you cannot depend on a Swift package if its supported version is higher than your own. On iOS, we use the project's minimum deployment version for the generated Swift package. If a plugin has a higher requirement, you'll need to update your project's minimum deployment version. The generated Swift package is automatically updated the next time you run the tool. This updates macOS to do the same thing. Fixes flutter#146204
Fix the xcodebuild flags mixing up the iOS and watchOS simulators. Confirmed this passed in CI on Xcode 16 beta 5: flutter#152408 Fixes flutter#152983 See also flutter#152347
If Swift Package Manager is enabled, the tool generates a Swift package at `<ios/macos>/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/`. This Swift package is how the tool adds plugins to the Flutter project. SwiftPM is strictly enforces platform versions: you cannot depend on a Swift package if its supported version is higher than your own. On iOS, we use the project's minimum deployment version for the generated Swift package. If a plugin has a higher requirement, you'll need to update your project's minimum deployment version. The generated Swift package is automatically updated the next time you run the tool. This updates macOS to do the same thing. Fixes flutter#146204
Fix the xcodebuild flags mixing up the iOS and watchOS simulators. Confirmed this passed in CI on Xcode 16 beta 5: flutter#152408 Fixes flutter#152983 See also flutter#152347
If Swift Package Manager is enabled, the tool generates a Swift package at
<ios/macos>/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/. This Swift package is how the tool adds plugins to the Flutter project.SwiftPM is strictly enforces platform versions: you cannot depend on a Swift package if its supported version is higher than your own.
On iOS, we use the project's minimum deployment version for the generated Swift package. If a plugin has a higher requirement, you'll need to update your project's minimum deployment version. The generated Swift package is automatically updated the next time you run the tool.
This updates macOS to do the same thing.
Fixes #146204
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.