-
Notifications
You must be signed in to change notification settings - Fork 6k
ios: remove shared_application and support app extension build #44732
Conversation
fddbd73
to
f168f89
Compare
|
||
NSBundle* FLTGetApplicationBundle(); | ||
|
||
NSURL* FLTAssetsFromBundle(NSBundle* bundle); |
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.
Can this be given a more precise name? I'm assuming this is an assets directory, rather than actual assets?
return bundle; | ||
NSBundle* FLTGetApplicationBundle() { | ||
NSBundle* mainBundle = [NSBundle mainBundle]; | ||
// App extension bundle is in Runner.app/PlugIns/Extension.appex. |
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.
Nit: It's not necessarily "Runner.app", right? Maybe <AppName>.app/PlugiIns/Extension.appex
?
|
||
NSBundle* FLTFrameworkBundleWithIdentifier(NSString* flutterBundleID) { | ||
NSBundle* appBundle = FLTGetApplicationBundle(); | ||
NSBundle* bundle = FLTFrameworkBundleInternal(flutterBundleID, appBundle.privateFrameworksURL); |
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.
frameworkBundle
(since it's confusing to have something just called bundle
when there are two different bundles being tracked).
NSURL* FLTAssetsFromBundle(NSBundle* bundle) { | ||
NSString* assetsPathFromInfoPlist = [bundle objectForInfoDictionaryKey:@"FLTAssetsPath"]; | ||
NSString* flutterAssetsName = | ||
assetsPathFromInfoPlist != nil ? assetsPathFromInfoPlist : @"flutter_assets"; |
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.
Optional: You can use the Elvis operator extensions here (it's a style-guide-approved language extension): assetsPathFromInfoPlist ?: @"flutter_assets";
constexpr char kTextPlainFormat[] = "text/plain"; | ||
const UInt32 kKeyPressClickSoundId = 1306; | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wunused-variable" |
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.
Can we ifdef these pragmas to make it clearer why it's needed?
currentInterfaceOrientation = 1 << windowScene.interfaceOrientation; | ||
} else { | ||
#if APPLICATION_EXTENSION_API_ONLY | ||
FML_LOG(ERROR) << "Applicatioin based status bar orentiation update is not supported in " |
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.
Typo: Application
f168f89
to
4b5c020
Compare
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 with comment nits.
NSBundle* FLTFrameworkBundleWithIdentifier(NSString* bundleID); | ||
NSBundle* FLTFrameworkBundleWithIdentifier(NSString* flutterFrameworkBundleID); | ||
|
||
// Find the bundle of the application. |
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.
Nit: Finds
// This returns [NSBundle mainBundle] if the current running process is the application. | ||
NSBundle* FLTGetApplicationBundle(); | ||
|
||
// Find the Flutter asset directory from `bundle`. |
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.
Nit: Finds
|
||
// Find the bundle of the application. | ||
// | ||
// This returns [NSBundle mainBundle] if the current running process is the application. |
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.
Nit: "This returns" -> "Returns"
// The raw path can be set by the application via info.plist's `FLTAssetsPath` key. | ||
// If the key is not set, `flutter_assets` is used as the raw path value. | ||
// | ||
// If no valid asset is found under the raw path, return nil. |
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.
nit: returns
…133362) flutter/engine@1ec7b89...53595c9 2023-08-25 [email protected] [Impeller] Fix mask blurs and the Gaussian blur coverage hint. (flutter/engine#45079) 2023-08-25 [email protected] ios: remove shared_application and support app extension build (flutter/engine#44732) 2023-08-25 [email protected] Roll Skia from 76672468e8d7 to 40f4e01fca40 (3 revisions) (flutter/engine#45126) 2023-08-25 [email protected] Roll Fuchsia Mac SDK from 4LHUJjNlDT21v_pdT... to Qj4BGsKtF7EJssKIK... (flutter/engine#45127) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from 4LHUJjNlDT21 to Qj4BGsKtF7EJ If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…er#44732) This PR turns on the flag to support engine to build app extension. When building for app extension, the usage of sharedApplication API is removed. fixes flutter/flutter#124286 and flutter/flutter#124289 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
… extension build" (flutter#45250) Reverts flutter#44732 context: b/297654739 Synced with Chris and the error message is related to the PR
…#44732" (#45351) Relands #44732 with fix. The original PR returns nil when the assets is not reachable, in some cases, the assets are not loaded yet but will be loaded later, so we should return the asset URL regardless. Also added a fallback to main bundle to match the previous implementation. The original PR was failed in internal tests in b/297654739 Now with the fix, all tests passed: cl/561449914 fixes flutter/flutter#124289 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This PR turns on the flag to support engine to build app extension.
When building for app extension, the usage of sharedApplication API is removed.
fixes flutter/flutter#124286 and flutter/flutter#124289
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.