Create LICENSE
Example library showing how to break a library into multiple modules, but only require the consuming app to use a single import statement.
For two targets, MainTarget and CoreTarget, where MainTarget depends on CoreTarget, we want to be able to write:
MainTarget
CoreTarget
import MainTarget
And that is it, not:
import CoreTarget import MainTarget
This is possible, if in MainTarget, as done in this example project, this is added:
@_exported import CoreTarget
It will not prevent users/consumers of MainTarget from manually importing CoreTarget, but it will not be required.
Note that this is an experimental feature.
Create XCFrameworks with:
swift create-xcframework CoreTarget MainTarget --zip
Note that all targets need to be listed.
To see how to distribute as XCFrameworks, look at the following repo: https://github.com/mhays118/TestDistributingXCFrameworks
For example consuming app (with single import), see: https://github.com/mhays118/TestSPMLibraryConsumerApp
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
ExampleMergeSwiftModules
Example library showing how to break a library into multiple modules, but only require the consuming app to use a single import statement.
What this example shows:
For two targets,
MainTarget
andCoreTarget
, whereMainTarget
depends onCoreTarget
, we want to be able to write:And that is it, not:
This is possible, if in
MainTarget
, as done in this example project, this is added:It will not prevent users/consumers of
MainTarget
from manually importingCoreTarget
, but it will not be required.Note that this is an experimental feature.
Create XCFrameworks
Create XCFrameworks with:
Note that all targets need to be listed.
Related
To see how to distribute as XCFrameworks, look at the following repo: https://github.com/mhays118/TestDistributingXCFrameworks
For example consuming app (with single import), see: https://github.com/mhays118/TestSPMLibraryConsumerApp