-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Mergeable Library Support #127
Merged
+95
−17
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0af8bde
Add mergeable framework type
giginet 687339f
Implement CLI interface to pass framework type
giginet 3df7f7d
Add article about Mergeable Library
giginet bdfe916
Update documents
giginet 9606352
Resolve SwiftLint warnings
giginet f964649
Use append instead
giginet 1b59af9
Add test case to generate Mergeable Library
giginet 0565b50
Update to binary path
giginet cf373db
Fix SwiftLint violation
giginet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Support Mergeable Library | ||
|
||
Apple announced [Mergeable Library](https://developer.apple.com/documentation/xcode/configuring-your-project-to-use-mergeable-libraries) in WWDC23. Mergeable Library is the new framework type which can switch the linking style by the build configuration. It has the metadata to change the linking style on the link time. | ||
|
||
Scipio supports `mergeable` framework type to distribute packages as mergeable libraries. | ||
|
||
```shell | ||
$ scipio create path/to/MyPackage --framework-type mergeable --enable-library-evolution | ||
``` | ||
|
||
See details the official documentation and following WWDC session. | ||
|
||
- [Configuring your project to use mergeable libraries | Apple Developer Documentation](https://developer.apple.com/documentation/xcode/configuring-your-project-to-use-mergeable-libraries) | ||
- [Meet mergeable libraries - WWDC23 - Videos - Apple Developer](https://developer.apple.com/videos/play/wwdc2023/10268/) | ||
|
||
In general, mergeable frameworks will be about 2x bigger binary size than the normal dynamic frameworks. | ||
|
||
## How to check whether the built framework is mergeable or not | ||
|
||
Mergeable frameworks have `LC_ATOM_INFO` load command in the binary. You can check it by `otool` command. | ||
|
||
```shell | ||
echo $(otool -l MyFramework.framework/MyFramework) | grep "LC_ATOM_INFO" | ||
``` | ||
|
||
## Limitation | ||
|
||
Some frameworks can't build as a dynamic framework by some reasons. They can't be distributed as mergeable libraries. Try `--framework-type static` instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,16 +86,16 @@ All XCFrameworks are generated into `MyAppDependencies/XCFramework` by default. | |
|
||
`prepare` command has some options. These are available options. | ||
|
||
|Flag|Description|Default| | ||
|---------|------------|-----------| | ||
|-\-configuration, -c|Build configuration for generated frameworks (debug / release)|release| | ||
|-\-output, -o|Path indicates a XCFrameworks output directory|$PACKAGE_ROOT/XCFrameworks| | ||
|-\-embed-debug-symbols|Whether embed debug symbols to frameworks or not|-| | ||
|-\-static|Whether generated frameworks are Static Frameworks or not|-| | ||
|-\-support-simulators|Whether also building for simulators of each SDKs or not|-| | ||
|-\-cache-policy|How to reuse built frameworks|project| | ||
|-\-enable-library-evolution|Whether to enable Library Evolution feature or not|-| | ||
|-\-only-use-versions-from-resolved-file|Whether to disable updating Package.resolved automatically|false| | ||
| Flag | Description | Default | | ||
|-----------------------------------------|---------------------------------------------------------------------|----------------------------| | ||
| -\-configuration, -c | Build configuration for generated frameworks (debug / release) | release | | ||
| -\-output, -o | Path indicates a XCFrameworks output directory | $PACKAGE_ROOT/XCFrameworks | | ||
| -\-embed-debug-symbols | Whether embed debug symbols to frameworks or not | - | | ||
| -\-framework-type | Framework type to generate Available: dynamic, static or mergeable) | dynamic | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q. Default is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, third column is the default value |
||
| -\-support-simulators | Whether also building for simulators of each SDKs or not | - | | ||
| -\-cache-policy | How to reuse built frameworks | project | | ||
| -\-enable-library-evolution | Whether to enable Library Evolution feature or not | - | | ||
| -\-only-use-versions-from-resolved-file | Whether to disable updating Package.resolved automatically | false | | ||
|
||
|
||
See `--help` for details. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
👍 Thank you for the links