Add support for ExtensionKit App Extensions with extensionkit_extension = True
#1944
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue: #1943
Plugin App Extensions
Before iOS 16.0, App Extensions were a product type
com.apple.product-type.app-extension
, build artifacts were installed into the app’sPlugIns
directory, and the bundle’s Info.plist properties are defined in anNSExtension
dictionary.ExtensionKit App Extensions
iOS 16, macOS 13, tvOS 16, and watchOS 9, introduced ExtensionKit extensions for newer extensions like the Background Asset Downloader, App Intents, and even third-party-defined extension points.
Distinct from the plugin-type app extensions, ExtensionKit extensions have a product type
com.apple.product-type.extensionkit-extension
, build artifacts are installed into the app’sExtensions
directory, and the bundle’s Info.plist properties are defined in anEXAppExtensionAttributes
dictionary.Architecture Decisions
I noticed the
watchos_extension
has an attribute to change the product type and linking flags. It's used by settingapplication_extension = True
onwatchos_extension
. This PR follows a similar pattern by settingextensionkit_extension = True
to update the product type and bundle install location.Alternatively, I considered introducing a separate rule for ExtensionKit app extensions, but this seems to make existing extension rules lose generalizability