-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[quick_actions] add custom modulemap with test submodule #6169
[quick_actions] add custom modulemap with test submodule #6169
Conversation
| <key>CADisableMinimumFrameDurationOnPhone</key> | ||
| <true/> | ||
| <key>UIApplicationSupportsIndirectInputEvents</key> | ||
| <true/> |
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.
these changes are automatically added when i do flutter build ios
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.
These should be fine I think?
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.
Yes, these and the alwaysOutOfDate change are from auto-migrations.
| @@ -1,5 +1,5 @@ | |||
| # Uncomment this line to define a global platform for your project | |||
| # platform :ios, '9.0' | |||
| # platform :ios, '11.0' | |||
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.
these changes are automatically added when i do flutter build ios
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.
You need to manually undo them; it's a change that's on master but hasn't rolled out to stable, and we keep our plugin OS support the same as Flutter stable's OS support (except in cases where we can't for technical reasons).
| @@ -1,5 +1,5 @@ | |||
| # Uncomment this line to define a global platform for your project | |||
| # platform :ios, '9.0' | |||
| # platform :ios, '11.0' | |||
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.
You need to manually undo them; it's a change that's on master but hasn't rolled out to stable, and we keep our plugin OS support the same as Flutter stable's OS support (except in cases where we can't for technical reasons).
| <key>CADisableMinimumFrameDurationOnPhone</key> | ||
| <true/> | ||
| <key>UIApplicationSupportsIndirectInputEvents</key> | ||
| <true/> |
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.
These should be fine I think?
|
|
||
| /// Initializes a FLTQuickActionsPlugin with the given method channel. | ||
| /// API exposed for unit tests. | ||
| /// @param channel a method channel |
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.
Doxygen comments follow the usual comment rules about being sentences. E.g.:
@param channel A method channel.
@return The initialized FLTQuickActionsPlugin.
| s.documentation_url = 'https://pub.dev/packages/quick_actions' | ||
| s.source_files = 'Classes/**/*' | ||
| s.source_files = 'Classes/**/*.{h,m}' | ||
| s.public_header_files = 'Classes/**/*.h' |
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 is making the test header a public header. We've made that mistake in other plugins, but we shouldn't replicate it here.
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.
@stuartmorgan Looks like the test header must be public. I got this error when not adding the test header to this public_header_files:
- ERROR | [iOS] xcodebuild: /Users/admin/Library/Developer/Xcode/DerivedData/App-cgyuubhexmicjpawtwtidfnntejc/Build/Products/Debug-iphonesimulator/quick_actions_ios/quick_actions_ios.framework/Modules/module.modulemap:8:12: error: header 'FLTQuickActionsPlugin_Test.h' not found
If I understand this error correctly, modulemap file defines the module by mapping headers in the output directory. The Test submodule is no difference than regular module in terms of visibility, except that it's scoped under a submodule.
CC @jmagman probably know more about modulemap.
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.
Please ignore my previous comment, I misunderstood how private headers work. It turned out that private headers ARE copied to the output directory (so that modulemap can refer to them).
| <key>CADisableMinimumFrameDurationOnPhone</key> | ||
| <true/> | ||
| <key>UIApplicationSupportsIndirectInputEvents</key> | ||
| <true/> |
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.
Yes, these and the alwaysOutOfDate change are from auto-migrations.
| [registrar addApplicationDelegate:instance]; | ||
| } | ||
|
|
||
| - (instancetype)initWithChannel:(FlutterMethodChannel *)channel { |
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.
should -init and +new be marked unavailable in the header then?
| /// API exposed for unit tests. | ||
| /// @param channel A method channel. | ||
| /// @return The initialized FLTQuickActionsPlugin. | ||
| - (instancetype)initWithChannel:(FlutterMethodChannel *)channel; |
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.
Designated initializer?
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.
Got this error. Looks like designated initializer does not support class categories:
'objc_designated_initializer' attribute only applies to init methods of interface or class extension declarations
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.
Oh right
e76e91f to
8a780b8
Compare
8a780b8 to
db79c26
Compare
|
@stuartmorgan friendly ping |
4c3dc31 to
e732cfc
Compare
| @@ -1,5 +1,6 @@ | |||
| ## NEXT | |||
| ## 0.6.0+12 | |||
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.
Hmmm, looks like the version bump is not picked up by the CI.
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.
You changed the version in the wrong package; the changes are in quick_actions_ios.
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.
Good catch!
stuartmorgan-g
left a comment
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
| s.source_files = 'Classes/**/*' | ||
| s.public_header_files = 'Classes/**/*.h' | ||
| s.source_files = 'Classes/**/*.{h,m}' | ||
| s.public_header_files = 'Classes/*.h' |
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.
Doesn't this also match Classes/PrivateHeaders/*.h?
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.
Oh I removed /**, so it won't include the private headers.
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.
|
|
||
| @interface FLTQuickActionsPlugin : NSObject <FlutterPlugin> | ||
|
|
||
| /// Unavailable. Please use `initWithChannel:` instead. |
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.
But that's "private", how would they be able to do it? I think registerWithRegistrar: is the only way for developers to create an instance.
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.
Oh the unit tests will import the Test submodule that contains initWithChannel: private API. But I think you made a good point that a public header shouldn't mention about this private API. I will remove this comment in next PR.
| /// API exposed for unit tests. | ||
| /// @param channel A method channel. | ||
| /// @return The initialized FLTQuickActionsPlugin. | ||
| - (instancetype)initWithChannel:(FlutterMethodChannel *)channel; |
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.
Oh right

This is to prepare for backfilling unit tests, which is a pre-requisite for swift migration.
This plugin is chosen to be the first plugin for Swift migration, because:
List which issues are fixed by this PR. You must list at least one issue.
flutter/flutter#108750
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.