Skip to content

apple_framework

Apple framework bundle.

Description

Builds an Apple framework product with module metadata, a generated Info.plist property-list file, and ad-hoc signing. Attributes whose names contain sdk configure the Apple software development kit (SDK) used for the build.

Attributes

AttributeTypeRequiredDefaultDescription
platformstringyesApple platform for the framework
minimum_osstringno13.0Minimum supported operating system version
target_sdk_versionstringnominimum_osSoftware development kit version used in the target triple
sdk_variantstringnosimulatorsimulator or device; ignored on macOS (not configurable)
xcode_developer_dirstringnoactive XcodeXcode developer directory used to resolve build tools
bundle_idstringnodev.once.<product_name>Framework bundle identifier
product_namestringnotarget nameFramework product name (not configurable)
module_namestringnoproduct_nameSwift module name
headerslist<string>no[]Headers packaged with the framework
exported_headerslist<string>no[]Headers exported to downstream consumers
resourceslist<string>no[]Resource glob patterns bundled into the framework
asset_catalogslist<string>no[]Asset catalog paths compiled into the framework bundle
privacy_manifeststringnoPrivacy manifest placed in the framework bundle
sdk_frameworkslist<string>no[]Apple software development kit frameworks linked by name
weak_sdk_frameworkslist<string>no[]Apple software development kit frameworks linked weakly
sdk_dylibslist<string>no[]Apple software development kit dynamic libraries linked by name
linkoptslist<string>no[]Extra linker flags
swift_flagslist<string>no[]Extra Swift compiler flags

Dependency Edges

EdgeAcceptsDescription
depsapple_linkable, apple_resource, apple_swift_plugin, native_linkableLibraries, resources, native linkables, and Swift compiler plugins linked or embedded by the framework

Providers

The target emits apple_linkable, apple_framework, and apple_bundle.

Capabilities

CapabilityOutput groups
builddefault, framework, dsyms, swiftmodule

Outputs

OutputLocation
Framework bundle.once/out/<target>/<product_name>.framework
Dynamic library.once/out/<target>/<product_name>.framework/<product_name>
Swift module.once/out/<target>/<product_name>.framework/Modules/<module_name>.swiftmodule
Swift documentation.once/out/<target>/<product_name>.framework/Modules/<module_name>.swiftdoc
Module map.once/out/<target>/<product_name>.framework/Modules/module.modulemap
Property list.once/out/<target>/<product_name>.framework/Info.plist
Code signature.once/out/<target>/<product_name>.framework/_CodeSignature/CodeResources

Limitations

Header packaging, resource bundling, asset catalogs, and privacy manifests are unsupported. The target rejects non-empty values for those attributes instead of ignoring them.

Example

toml
[[target]]
name = "UI"
kind = "apple_framework"
srcs = ["UI/Sources/*.swift"]

[target.attrs]
platform = "ios"
minimum_os = "17.0"
sdk_variant = "simulator"
bundle_id = "dev.once.UI"

Released under an open-source license.