Skip to content

Commit 2aebdc0

Browse files
cameroncookecodexcursoragent
authored
build: Add XCFramework binary distribution support (#266)
* build: Add XCFramework binary distribution support Generate the vendored SnapshotPreviews frameworks with a Bash-based Xcode archive flow and a build-only package manifest that forces dynamic products for packaging. Add a binary-framework DemoApp example, document the manual integration requirements, and update release packaging to publish the generated XCFramework artifacts from the XCFrameworks directory. Co-Authored-By: Codex <noreply@openai.com> * Remove unnecessary file cleanup in CI The runner is ephemeral and starts fresh each time, so cleaning up *.xcframework.zip files before zipping is unnecessary. Co-authored-by: Cameron Cooke <web@cameroncooke.com> * Fix: Sanitize Swift interfaces in archived framework even when source module is missing Ensure sanitize_swift_interfaces runs on Modules folder in the archived framework when the source swiftmodule path is absent but the archived Modules directory exists (e.g., from Swift dependencies like SnapshottingSwift). Applied via @cursor push command --------- Co-authored-by: Codex <noreply@openai.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent f0fbf24 commit 2aebdc0

22 files changed

Lines changed: 2188 additions & 95 deletions

File tree

.github/workflows/build-xcframework.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111

1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515
- name: Xcode select
1616
run: sudo xcode-select -s '/Applications/Xcode_15.4.app/Contents/Developer'
17-
- name: Build xcframework
18-
run: sh build.sh
17+
- name: Build xcframeworks
18+
run: bash build.sh

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Xcode select
1616
run: sudo xcode-select -s '/Applications/Xcode_15.4.app/Contents/Developer'
1717
- name: Build TestApp
18-
run: cd Examples && xcodebuild build -scheme DemoApp -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -project DemoApp/DemoApp.xcodeproj
18+
run: cd Examples && xcodebuild build -scheme DemoApp -destination 'generic/platform=iOS Simulator' -project DemoApp/DemoApp.xcodeproj
1919
- name: Build Snapshotting
2020
run: xcodebuild build -scheme Snapshotting -sdk iphonesimulator -destination 'generic/platform=iOS Simulator'
2121
- name: Build SnapshottingTests

.github/workflows/release.yaml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,23 @@ jobs:
1111

1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515
- name: Xcode select
1616
run: sudo xcode-select -s '/Applications/Xcode_15.4.app/Contents/Developer'
17-
- name: Build xcframework
18-
run: sh build.sh
19-
- name: Zip SnapshottingTests xcframework
20-
run: zip -r SnapshottingTests.xcframework.zip SnapshottingTests.xcframework
21-
- name: Zip PreviewGallery xcframework
22-
run: zip -r PreviewGallery.xcframework.zip PreviewGallery.xcframework
23-
- name: Zip preivews support
24-
run: (cd PreviewsSupport && zip -r PreviewsSupport.xcframework.zip PreviewsSupport.xcframework)
17+
- name: Build xcframeworks
18+
run: bash build.sh
19+
- name: Zip xcframeworks
20+
run: |
21+
for framework_path in XCFrameworks/*.xcframework
22+
do
23+
framework="$(basename "$framework_path")"
24+
(cd XCFrameworks && zip -r "../$framework.zip" "$framework")
25+
done
2526
- name: Upload Artifact
26-
uses: softprops/action-gh-release@v1
27+
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
2728
if: startsWith(github.ref, 'refs/tags/')
2829
with:
29-
files: |
30-
PreviewGallery.xcframework.zip
31-
SnapshottingTests.xcframework.zip
32-
PreviewsSupport/PreviewsSupport.xcframework.zip
30+
files: "*.xcframework.zip"
3331
body:
3432
Release ${{ github.ref }}
3533
Automated release created by GitHub Actions.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
.DS_Store
2+
/build/
3+
/Package.resolved
4+
/XCFrameworks/
25
/.build
36
/Packages
47
xcuserdata/

Examples/DemoApp-XCFrameworks/DemoApp-XCFrameworks.xcodeproj/project.pbxproj

Lines changed: 1433 additions & 0 deletions
Large diffs are not rendered by default.

Examples/DemoApp-XCFrameworks/DemoApp-XCFrameworks.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1540"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "FA309EBF2C38D71C00C85FF4"
19+
BuildableName = "Demo Watch App.app"
20+
BlueprintName = "Demo Watch App"
21+
ReferencedContainer = "container:DemoApp-XCFrameworks.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
</BuildActionEntries>
25+
</BuildAction>
26+
<TestAction
27+
buildConfiguration = "Debug"
28+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
29+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
31+
<Testables>
32+
<TestableReference
33+
skipped = "NO">
34+
<BuildableReference
35+
BuildableIdentifier = "primary"
36+
BlueprintIdentifier = "FACBAD9F2C67B8D60012D600"
37+
BuildableName = "Demo Watch AppTests.xctest"
38+
BlueprintName = "Demo Watch AppTests"
39+
ReferencedContainer = "container:DemoApp-XCFrameworks.xcodeproj">
40+
</BuildableReference>
41+
</TestableReference>
42+
</Testables>
43+
</TestAction>
44+
<LaunchAction
45+
buildConfiguration = "Debug"
46+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
47+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
48+
launchStyle = "0"
49+
useCustomWorkingDirectory = "NO"
50+
ignoresPersistentStateOnLaunch = "NO"
51+
debugDocumentVersioning = "YES"
52+
debugServiceExtension = "internal"
53+
allowLocationSimulation = "YES">
54+
<BuildableProductRunnable
55+
runnableDebuggingMode = "0">
56+
<BuildableReference
57+
BuildableIdentifier = "primary"
58+
BlueprintIdentifier = "FA309EBF2C38D71C00C85FF4"
59+
BuildableName = "Demo Watch App.app"
60+
BlueprintName = "Demo Watch App"
61+
ReferencedContainer = "container:DemoApp-XCFrameworks.xcodeproj">
62+
</BuildableReference>
63+
</BuildableProductRunnable>
64+
</LaunchAction>
65+
<ProfileAction
66+
buildConfiguration = "Release"
67+
shouldUseLaunchSchemeArgsEnv = "YES"
68+
savedToolIdentifier = ""
69+
useCustomWorkingDirectory = "NO"
70+
debugDocumentVersioning = "YES">
71+
<BuildableProductRunnable
72+
runnableDebuggingMode = "0">
73+
<BuildableReference
74+
BuildableIdentifier = "primary"
75+
BlueprintIdentifier = "FA309EBF2C38D71C00C85FF4"
76+
BuildableName = "Demo Watch App.app"
77+
BlueprintName = "Demo Watch App"
78+
ReferencedContainer = "container:DemoApp-XCFrameworks.xcodeproj">
79+
</BuildableReference>
80+
</BuildableProductRunnable>
81+
</ProfileAction>
82+
<AnalyzeAction
83+
buildConfiguration = "Debug">
84+
</AnalyzeAction>
85+
<ArchiveAction
86+
buildConfiguration = "Release"
87+
revealArchiveInOrganizer = "YES">
88+
</ArchiveAction>
89+
</Scheme>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1500"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "FA1671BE2A5367A800A42DB0"
18+
BuildableName = "DemoApp.app"
19+
BlueprintName = "DemoApp"
20+
ReferencedContainer = "container:DemoApp-XCFrameworks.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<TestPlans>
31+
<TestPlanReference
32+
reference = "container:DemoApp.xctestplan"
33+
default = "YES">
34+
</TestPlanReference>
35+
</TestPlans>
36+
</TestAction>
37+
<LaunchAction
38+
buildConfiguration = "Debug"
39+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
40+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
41+
launchStyle = "0"
42+
useCustomWorkingDirectory = "NO"
43+
ignoresPersistentStateOnLaunch = "NO"
44+
debugDocumentVersioning = "YES"
45+
debugServiceExtension = "internal"
46+
allowLocationSimulation = "YES">
47+
<BuildableProductRunnable
48+
runnableDebuggingMode = "0">
49+
<BuildableReference
50+
BuildableIdentifier = "primary"
51+
BlueprintIdentifier = "FA1671BE2A5367A800A42DB0"
52+
BuildableName = "DemoApp.app"
53+
BlueprintName = "DemoApp"
54+
ReferencedContainer = "container:DemoApp-XCFrameworks.xcodeproj">
55+
</BuildableReference>
56+
</BuildableProductRunnable>
57+
</LaunchAction>
58+
<ProfileAction
59+
buildConfiguration = "Release"
60+
shouldUseLaunchSchemeArgsEnv = "YES"
61+
savedToolIdentifier = ""
62+
useCustomWorkingDirectory = "NO"
63+
debugDocumentVersioning = "YES">
64+
<BuildableProductRunnable
65+
runnableDebuggingMode = "0">
66+
<BuildableReference
67+
BuildableIdentifier = "primary"
68+
BlueprintIdentifier = "FA1671BE2A5367A800A42DB0"
69+
BuildableName = "DemoApp.app"
70+
BlueprintName = "DemoApp"
71+
ReferencedContainer = "container:DemoApp-XCFrameworks.xcodeproj">
72+
</BuildableReference>
73+
</BuildableProductRunnable>
74+
</ProfileAction>
75+
<AnalyzeAction
76+
buildConfiguration = "Debug">
77+
</AnalyzeAction>
78+
<ArchiveAction
79+
buildConfiguration = "Debug"
80+
revealArchiveInOrganizer = "YES">
81+
</ArchiveAction>
82+
</Scheme>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1540"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
</BuildAction>
10+
<TestAction
11+
buildConfiguration = "Debug"
12+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
13+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
14+
shouldUseLaunchSchemeArgsEnv = "YES">
15+
<TestPlans>
16+
<TestPlanReference
17+
reference = "container:DemoAppTests.xctestplan"
18+
default = "YES">
19+
</TestPlanReference>
20+
</TestPlans>
21+
<Testables>
22+
<TestableReference
23+
skipped = "NO">
24+
<BuildableReference
25+
BuildableIdentifier = "primary"
26+
BlueprintIdentifier = "FA8F8B7A2C66C4C4007CEA33"
27+
BuildableName = "DemoAppTests.xctest"
28+
BlueprintName = "DemoAppTests"
29+
ReferencedContainer = "container:DemoApp-XCFrameworks.xcodeproj">
30+
</BuildableReference>
31+
</TestableReference>
32+
</Testables>
33+
</TestAction>
34+
<LaunchAction
35+
buildConfiguration = "Debug"
36+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
37+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
38+
launchStyle = "0"
39+
useCustomWorkingDirectory = "NO"
40+
ignoresPersistentStateOnLaunch = "NO"
41+
debugDocumentVersioning = "YES"
42+
debugServiceExtension = "internal"
43+
allowLocationSimulation = "YES">
44+
</LaunchAction>
45+
<ProfileAction
46+
buildConfiguration = "Release"
47+
shouldUseLaunchSchemeArgsEnv = "YES"
48+
savedToolIdentifier = ""
49+
useCustomWorkingDirectory = "NO"
50+
debugDocumentVersioning = "YES">
51+
</ProfileAction>
52+
<AnalyzeAction
53+
buildConfiguration = "Debug">
54+
</AnalyzeAction>
55+
<ArchiveAction
56+
buildConfiguration = "Release"
57+
revealArchiveInOrganizer = "YES">
58+
</ArchiveAction>
59+
</Scheme>

0 commit comments

Comments
 (0)