Skip to content

Commit 58200b7

Browse files
authored
Merge pull request #48 from GetStream/chore/spm_support_2
SPM support for iOS
2 parents 8a5b3ed + 7b7b6e9 commit 58200b7

File tree

125 files changed

+8995
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+8995
-111
lines changed

.github/workflows/ios_spm.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: iOS Build CI (CocoaPods + SPM)
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-ios:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Flutter
18+
uses: subosito/flutter-action@v2
19+
with:
20+
channel: "stable"
21+
22+
- name: Flutter pub get
23+
run: flutter pub get
24+
25+
# 🧪 Build iOS example using CocoaPods
26+
- name: Build iOS example with CocoaPods
27+
working-directory: example
28+
run: |
29+
echo "=== Building with CocoaPods ==="
30+
cd ios
31+
pod repo update
32+
pod install
33+
cd ..
34+
flutter config --no-enable-swift-package-manager
35+
flutter build ios --no-codesign --verbose
36+
37+
# 🧹 Clean build + prepare for SPM test
38+
- name: Clean and prepare for SPM test
39+
working-directory: example
40+
run: |
41+
echo "=== Cleaning Pods ==="
42+
rm -rf ios/Pods ios/Podfile.lock
43+
flutter clean
44+
45+
# 🧪 Step 7: Build iOS example using Swift Package Manager
46+
- name: Build iOS example with Swift Package Manager
47+
working-directory: example
48+
run: |
49+
echo "=== Building with SPM ==="
50+
flutter config --enable-swift-package-manager
51+
flutter build ios --no-codesign --verbose
52+
53+
# ✅ Step 8: Verify output
54+
- name: Verify build artifacts
55+
run: |
56+
echo "✅ Both CocoaPods and SPM builds succeeded."

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,7 @@ android/.settings/org.eclipse.buildship.core.prefs
6666
# vs
6767
*.pdb
6868
ios/Frameworks
69+
70+
# SPM
71+
.build/
72+
.swiftpm/

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
# Changelog
33

4+
[2.1.0]
5+
* [iOS] Added Swift Package Manager (SPM) support to iOS.
6+
47
[2.0.0]
58
* [Android] Fixed the camera device facing mode detection.
69
* Synced flutter-webrtc v0.14.2

Package.resolved

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// swift-tools-version: 6.1
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "stream_webrtc_flutter",
6+
platforms: [
7+
.iOS("13.0")
8+
],
9+
products: [
10+
.library(name: "stream-webrtc-flutter", targets: ["stream_webrtc_flutter"])
11+
],
12+
dependencies: [
13+
.package(
14+
url: "https://github.com/GetStream/stream-video-swift-webrtc.git", exact: "137.0.43"
15+
)
16+
17+
],
18+
targets: [
19+
.target(
20+
name: "stream_webrtc_flutter",
21+
dependencies: [
22+
.product(name: "StreamWebRTC", package: "stream-video-swift-webrtc")
23+
],
24+
path: "ios/stream_webrtc_flutter/Sources/stream_webrtc_flutter",
25+
resources: []
26+
)
27+
]
28+
)

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
331C80F4294D02FB00263BE5 /* RunnerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 331C80F3294D02FB00263BE5 /* RunnerTests.m */; };
1212
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1313
5CDFF0275A08E50A6164A3F8 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4037B0CEBA1653808EE0CA63 /* libPods-Runner.a */; };
14+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
1415
7C3FB43872C7FE2C07692790 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 550D33CD52ED8A2B5A569475 /* libPods-RunnerTests.a */; };
1516
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
1617
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
@@ -52,6 +53,7 @@
5253
4037B0CEBA1653808EE0CA63 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5354
550D33CD52ED8A2B5A569475 /* libPods-RunnerTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5455
778F77E979EC8E07FC2C0C68 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
56+
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; };
5557
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
5658
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
5759
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -82,6 +84,7 @@
8284
isa = PBXFrameworksBuildPhase;
8385
buildActionMask = 2147483647;
8486
files = (
87+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
8588
5CDFF0275A08E50A6164A3F8 /* libPods-Runner.a in Frameworks */,
8689
);
8790
runOnlyForDeploymentPostprocessing = 0;
@@ -100,6 +103,7 @@
100103
9740EEB11CF90186004384FC /* Flutter */ = {
101104
isa = PBXGroup;
102105
children = (
106+
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
103107
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
104108
9740EEB21CF90195004384FC /* Debug.xcconfig */,
105109
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
@@ -172,7 +176,6 @@
172176
BA896DE0E3457D7F8E7B874C /* Pods-RunnerTests.release.xcconfig */,
173177
F5CFB2CC6A32D774511849CE /* Pods-RunnerTests.profile.xcconfig */,
174178
);
175-
name = Pods;
176179
path = Pods;
177180
sourceTree = "<group>";
178181
};
@@ -209,14 +212,16 @@
209212
97C146EC1CF9000F007C117D /* Resources */,
210213
9705A1C41CF9048500538489 /* Embed Frameworks */,
211214
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
212-
B72DA1812AE95A75DB2BD298 /* [CP] Embed Pods Frameworks */,
213215
F3FBAC538468FF33051E9409 /* [CP] Copy Pods Resources */,
214216
);
215217
buildRules = (
216218
);
217219
dependencies = (
218220
);
219221
name = Runner;
222+
packageProductDependencies = (
223+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
224+
);
220225
productName = Runner;
221226
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
222227
productType = "com.apple.product-type.application";
@@ -248,6 +253,9 @@
248253
Base,
249254
);
250255
mainGroup = 97C146E51CF9000F007C117D;
256+
packageReferences = (
257+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
258+
);
251259
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
252260
projectDirPath = "";
253261
projectRoot = "";
@@ -333,23 +341,6 @@
333341
shellPath = /bin/sh;
334342
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
335343
};
336-
B72DA1812AE95A75DB2BD298 /* [CP] Embed Pods Frameworks */ = {
337-
isa = PBXShellScriptBuildPhase;
338-
buildActionMask = 2147483647;
339-
files = (
340-
);
341-
inputFileListPaths = (
342-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
343-
);
344-
name = "[CP] Embed Pods Frameworks";
345-
outputFileListPaths = (
346-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
347-
);
348-
runOnlyForDeploymentPostprocessing = 0;
349-
shellPath = /bin/sh;
350-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
351-
showEnvVarsInLog = 0;
352-
};
353344
F11C086B6FEBB173967B74C4 /* [CP] Check Pods Manifest.lock */ = {
354345
isa = PBXShellScriptBuildPhase;
355346
buildActionMask = 2147483647;
@@ -496,6 +487,7 @@
496487
buildSettings = {
497488
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
498489
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
490+
DEVELOPMENT_TEAM = EHV7XZLAHA;
499491
ENABLE_BITCODE = NO;
500492
INFOPLIST_FILE = Runner/Info.plist;
501493
LD_RUNPATH_SEARCH_PATHS = (
@@ -661,6 +653,7 @@
661653
buildSettings = {
662654
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
663655
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
656+
DEVELOPMENT_TEAM = EHV7XZLAHA;
664657
ENABLE_BITCODE = NO;
665658
INFOPLIST_FILE = Runner/Info.plist;
666659
LD_RUNPATH_SEARCH_PATHS = (
@@ -679,6 +672,7 @@
679672
buildSettings = {
680673
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
681674
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
675+
DEVELOPMENT_TEAM = EHV7XZLAHA;
682676
ENABLE_BITCODE = NO;
683677
INFOPLIST_FILE = Runner/Info.plist;
684678
LD_RUNPATH_SEARCH_PATHS = (
@@ -725,6 +719,20 @@
725719
defaultConfigurationName = Release;
726720
};
727721
/* End XCConfigurationList section */
722+
723+
/* Begin XCLocalSwiftPackageReference section */
724+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
725+
isa = XCLocalSwiftPackageReference;
726+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
727+
};
728+
/* End XCLocalSwiftPackageReference section */
729+
730+
/* Begin XCSwiftPackageProductDependency section */
731+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
732+
isa = XCSwiftPackageProductDependency;
733+
productName = FlutterGeneratedPluginSwiftPackage;
734+
};
735+
/* End XCSwiftPackageProductDependency section */
728736
};
729737
rootObject = 97C146E61CF9000F007C117D /* Project object */;
730738
}

example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<PreActions>
9+
<ExecutionAction
10+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
11+
<ActionContent
12+
title = "Run Prepare Flutter Framework Script"
13+
scriptText = "/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; prepare&#10;">
14+
<EnvironmentBuildable>
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
18+
BuildableName = "Runner.app"
19+
BlueprintName = "Runner"
20+
ReferencedContainer = "container:Runner.xcodeproj">
21+
</BuildableReference>
22+
</EnvironmentBuildable>
23+
</ActionContent>
24+
</ExecutionAction>
25+
</PreActions>
826
<BuildActionEntries>
927
<BuildActionEntry
1028
buildForTesting = "YES"

example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)