diff --git a/examples/integration/ExtensionKitExtension/BUILD b/examples/integration/ExtensionKitExtension/BUILD new file mode 100644 index 0000000000..684ecc0385 --- /dev/null +++ b/examples/integration/ExtensionKitExtension/BUILD @@ -0,0 +1,56 @@ +load("@build_bazel_rules_apple//apple:apple.bzl", "local_provisioning_profile") +load("@build_bazel_rules_apple//apple:ios.bzl", "ios_extension") +load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") +load("@rules_xcodeproj//xcodeproj:defs.bzl", "xcode_provisioning_profile") +load( + "//:xcodeproj_targets.bzl", + "IOS_BUNDLE_ID", + "TEAMID", +) + +config_setting( + name = "device_build", + values = { + "cpu": "ios_arm64", + }, +) + +ios_extension( + name = "ExtensionKitExtension", + bundle_id = "{}.extensionkit-extension".format(IOS_BUNDLE_ID), + extensionkit_extension = True, + families = ["iphone"], + infoplists = [":Info.plist"], + minimum_os_version = "15.0", + provisioning_profile = select({ + ":device_build": ":xcode_profile", + "//conditions:default": None, + }), + version = "//iOSApp:Version", + visibility = ["//iOSApp:__subpackages__"], + deps = [ + "ExtensionKitExtension.library", + ], +) + +xcode_provisioning_profile( + name = "xcode_profile", + managed_by_xcode = True, + provisioning_profile = ":xcode_managed_profile", + tags = ["manual"], +) + +local_provisioning_profile( + name = "xcode_managed_profile", + profile_name = "iOS Team Provisioning Profile: {}.extensionkit-extension".format(IOS_BUNDLE_ID), + tags = ["manual"], + team_id = TEAMID, +) + +swift_library( + name = "ExtensionKitExtension.library", + srcs = glob(["**/*.swift"]), + module_name = "ExtensionKitExtension", + tags = ["manual"], + visibility = ["//:__subpackages__"], +) diff --git a/examples/integration/ExtensionKitExtension/Info.plist b/examples/integration/ExtensionKitExtension/Info.plist new file mode 100644 index 0000000000..551c5ab00a --- /dev/null +++ b/examples/integration/ExtensionKitExtension/Info.plist @@ -0,0 +1,21 @@ + + + + + CFBundleName + $(PRODUCT_NAME) + CFBundleVersion + 1.0 + CFBundleShortVersionString + 1.0 + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + EXAppExtensionAttributes + + EXExtensionPointIdentifier + com.apple.generic-extension + + + diff --git a/examples/integration/ExtensionKitExtension/main.swift b/examples/integration/ExtensionKitExtension/main.swift new file mode 100644 index 0000000000..3ad1a2960e --- /dev/null +++ b/examples/integration/ExtensionKitExtension/main.swift @@ -0,0 +1,6 @@ +import Foundation + +public class main { + public init() {} + public func main() { print("Hello world") } +} diff --git a/examples/integration/iOSApp/Source/BUILD b/examples/integration/iOSApp/Source/BUILD index a50a9f81e6..f9e358e266 100644 --- a/examples/integration/iOSApp/Source/BUILD +++ b/examples/integration/iOSApp/Source/BUILD @@ -52,7 +52,10 @@ ios_application( ":device_build": None, "//conditions:default": "iOSApp_ExecutableName", }), - extensions = ["//WidgetExtension"], + extensions = [ + "//ExtensionKitExtension", + "//WidgetExtension", + ], families = ["iphone"], frameworks = [ "//iOSApp/Source/CoreUtilsObjC:FrameworkCoreUtilsObjC", diff --git a/tools/extension_point_identifiers_parser/extension_point_identifiers_parser.py b/tools/extension_point_identifiers_parser/extension_point_identifiers_parser.py index 750abd44ea..88936c24ed 100755 --- a/tools/extension_point_identifiers_parser/extension_point_identifiers_parser.py +++ b/tools/extension_point_identifiers_parser/extension_point_identifiers_parser.py @@ -28,6 +28,13 @@ def _main( extension_point_identifier = ( plist.get("NSExtension", {}).get("NSExtensionPointIdentifier") ) + + # Supports ExtensionKit + if not extension_point_identifier: + extension_point_identifier = ( + plist.get("EXAppExtensionAttributes", {}).get("EXExtensionPointIdentifier") + ) + if not extension_point_identifier: continue