Skip to content

Commit c4986c5

Browse files
enedclaude
andcommitted
feat: add dual CI testing for iOS SPM and CocoaPods
Integrates Swift Package Manager testing into the examples.yml workflow: - Matrix build strategy tests both dependency managers - SPM build removes Podfile for pure testing - Maintains backward compatibility with CocoaPods 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 2ad7db3 commit c4986c5

File tree

5 files changed

+69
-23
lines changed

5 files changed

+69
-23
lines changed

.github/workflows/examples.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,40 @@ jobs:
2828
2929
example_ios:
3030
runs-on: macos-latest
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
dependency_manager: [cocoapods, spm]
35+
include:
36+
- dependency_manager: cocoapods
37+
build_name: "CocoaPods"
38+
flutter_config: "flutter config --no-enable-swift-package-manager"
39+
cleanup_step: "echo 'Using CocoaPods - no cleanup needed'"
40+
- dependency_manager: spm
41+
build_name: "Swift Package Manager"
42+
flutter_config: "flutter config --enable-swift-package-manager"
43+
cleanup_step: "cd example/ios && rm -f Podfile Podfile.lock && rm -rf Pods"
44+
name: iOS Example (${{ matrix.build_name }})
3145
steps:
3246
- uses: actions/checkout@v4
3347
- uses: subosito/flutter-action@v2
3448
with:
3549
channel: "stable"
3650
cache: true
3751

38-
- name: build
52+
- name: Configure Flutter for ${{ matrix.build_name }}
53+
run: ${{ matrix.flutter_config }}
54+
55+
- name: Bootstrap project
3956
run: |
4057
dart pub global activate melos
4158
melos bootstrap
42-
cd example && flutter build ios --debug --no-codesign
59+
60+
- name: Cleanup for ${{ matrix.build_name }}
61+
run: ${{ matrix.cleanup_step }}
62+
63+
- name: Build iOS example with ${{ matrix.build_name }}
64+
run: |
65+
cd example
66+
flutter clean
67+
flutter build ios --debug --no-codesign

example/ios/Podfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
platform :ios, '14.0'
2+
# platform :ios, '12.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -29,10 +29,8 @@ flutter_ios_podfile_setup
2929

3030
target 'Runner' do
3131
use_frameworks!
32-
use_modular_headers!
3332

3433
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35-
3634
target 'RunnerTests' do
3735
inherit! :search_paths
3836
end

example/ios/Podfile.lock

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,35 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- integration_test (0.0.1):
4-
- Flutter
53
- path_provider_foundation (0.0.1):
64
- Flutter
75
- FlutterMacOS
86
- permission_handler_apple (9.3.0):
97
- Flutter
10-
- shared_preferences_foundation (0.0.1):
11-
- Flutter
12-
- FlutterMacOS
138
- workmanager_apple (0.0.1):
149
- Flutter
1510

1611
DEPENDENCIES:
1712
- Flutter (from `Flutter`)
18-
- integration_test (from `.symlinks/plugins/integration_test/ios`)
1913
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
2014
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
21-
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
2215
- workmanager_apple (from `.symlinks/plugins/workmanager_apple/ios`)
2316

2417
EXTERNAL SOURCES:
2518
Flutter:
2619
:path: Flutter
27-
integration_test:
28-
:path: ".symlinks/plugins/integration_test/ios"
2920
path_provider_foundation:
3021
:path: ".symlinks/plugins/path_provider_foundation/darwin"
3122
permission_handler_apple:
3223
:path: ".symlinks/plugins/permission_handler_apple/ios"
33-
shared_preferences_foundation:
34-
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
3524
workmanager_apple:
3625
:path: ".symlinks/plugins/workmanager_apple/ios"
3726

3827
SPEC CHECKSUMS:
3928
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
40-
integration_test: 4a889634ef21a45d28d50d622cf412dc6d9f586e
4129
path_provider_foundation: 608fcb11be570ce83519b076ab6a1fffe2474f05
4230
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
43-
shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
4431
workmanager_apple: 904529ae31e97fc5be632cf628507652294a0778
4532

46-
PODFILE CHECKSUM: bf5d48b0f58a968d755f5b593e79332a40015529
33+
PODFILE CHECKSUM: 4305caec6b40dde0ae97be1573c53de1882a07e5
4734

4835
COCOAPODS: 1.16.2

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1212
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
1314
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1415
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1516
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -73,6 +74,7 @@
7374
isa = PBXFrameworksBuildPhase;
7475
buildActionMask = 2147483647;
7576
files = (
77+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
7678
A4F342DE9D752B13EF553010 /* Pods_Runner.framework in Frameworks */,
7779
);
7880
runOnlyForDeploymentPostprocessing = 0;
@@ -196,6 +198,9 @@
196198
dependencies = (
197199
);
198200
name = Runner;
201+
packageProductDependencies = (
202+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
203+
);
199204
productName = Runner;
200205
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
201206
productType = "com.apple.product-type.application";
@@ -251,6 +256,9 @@
251256
Base,
252257
);
253258
mainGroup = 97C146E51CF9000F007C117D;
259+
packageReferences = (
260+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
261+
);
254262
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
255263
projectDirPath = "";
256264
projectRoot = "";
@@ -361,16 +369,12 @@
361369
);
362370
inputPaths = (
363371
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
364-
"${BUILT_PRODUCTS_DIR}/integration_test/integration_test.framework",
365372
"${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework",
366-
"${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework",
367373
"${BUILT_PRODUCTS_DIR}/workmanager_apple/workmanager_apple.framework",
368374
);
369375
name = "[CP] Embed Pods Frameworks";
370376
outputPaths = (
371-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/integration_test.framework",
372377
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework",
373-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework",
374378
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/workmanager_apple.framework",
375379
);
376380
runOnlyForDeploymentPostprocessing = 0;
@@ -840,6 +844,20 @@
840844
defaultConfigurationName = Release;
841845
};
842846
/* End XCConfigurationList section */
847+
848+
/* Begin XCLocalSwiftPackageReference section */
849+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
850+
isa = XCLocalSwiftPackageReference;
851+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
852+
};
853+
/* End XCLocalSwiftPackageReference section */
854+
855+
/* Begin XCSwiftPackageProductDependency section */
856+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
857+
isa = XCSwiftPackageProductDependency;
858+
productName = FlutterGeneratedPluginSwiftPackage;
859+
};
860+
/* End XCSwiftPackageProductDependency section */
843861
};
844862
rootObject = 97C146E61CF9000F007C117D /* Project object */;
845863
}

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"

0 commit comments

Comments
 (0)