Add overloads for lookup that lets you specify a bundle#8007
Add overloads for lookup that lets you specify a bundle#8007dnfield merged 5 commits intoflutter:masterfrom
Conversation
| } | ||
|
|
||
| + (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { | ||
| return [self lookupKeyForAsset:[NSString stringWithFormat:@"packages/%@/%@", package, asset]]; |
There was a problem hiding this comment.
I'd prefer leveraging lookupKeyForAsset:fromPackage:fromBundle: here. Duplicating [NSBundle mainBundle] seems less error-prone than duplicating [NSString stringWithFormat:@"packages/%@/%@", package, asset].
Otherwise looks good to me.
There was a problem hiding this comment.
Updated this and another spot where there was duplicated code.
|
|
||
| + (NSString*)lookupKeyForAsset:(NSString*)asset { | ||
| return [self lookupKeyForAsset fromBundle:[NSBundle mainBundle]]; | ||
| NSBundle* bundle = [NSBundle bundleWithIdnetifier:[FlutterDartProject defaultBundleIdentifier]]; |
There was a problem hiding this comment.
FYI on this: it is mainly for allowing the documented way (https://flutter.dev/docs/development/ui/assets-and-images#ios) to work with the default setting of Flutter iOS app, which has default bundle id but may have different bundle name.
jamesderlin
left a comment
There was a problem hiding this comment.
This will slightly change the existing behavior by making the existing versions of lookupKeyForAsset check [FlutterDartProject defaultBundleIdentifier] first, but I assume that's ok.
LGTM (aside from the typo).
|
|
||
| + (NSString*)flutterAssetsName:(NSBundle*)bundle { | ||
| if (bundle == nil) { | ||
| bundle = [NSBundle bundleWithIdnetifier:[FlutterDartProject defaultBundleIdentifier]]; |
There was a problem hiding this comment.
Typo in bundleWithIdentifier
flutter/engine@39c46de...a28329c git log 39c46de..a28329c --no-merges --oneline a28329c Roll src/third_party/skia 58a75383a70b..c97b0672a73f (1 commits) (flutter/engine#8018) cdc1410 Roll src/third_party/skia 0d7012a80c17..58a75383a70b (1 commits) (flutter/engine#8017) 01d8a1f Roll src/third_party/skia c945f0e31a53..0d7012a80c17 (1 commits) (flutter/engine#8016) 75cd4df Roll src/third_party/skia 9159c8ef83b2..c945f0e31a53 (1 commits) (flutter/engine#8015) 13064ae Add overloads for lookup that lets you specify a bundle (flutter/engine#8007) 130cf77 Build engine for iOS on presubmit (flutter/engine#8011) 7234cc4 Roll src/third_party/skia 705e67347962..9159c8ef83b2 (1 commits) (flutter/engine#8014) 8a0b054 Roll src/third_party/skia 09198525261a..705e67347962 (7 commits) (flutter/engine#8013) 36cdd2e Roll src/third_party/skia 436d47d5bde9..09198525261a (6 commits) (flutter/engine#8012) 9bef73a Roll src/third_party/skia e1f5b644656f..436d47d5bde9 (3 commits) (flutter/engine#8009) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.
Some customers want to package up the App.framework into a separate bundle from the main one. This lets them look up flutter asset keys in whatever bundle they desire.
fixes flutter/flutter#28739
/cc @AlbertWang0116