Skip to content

Commit 14a2765

Browse files
authored
Mgration iOS to SPM (#2633)
* Complete migration to SPM * Add build cache * Try and fix the build * Update package, try another build fix. * Another attempt * Another attempt * Update maplibre-contour-rs * Fix build * Fix build * temp * debug * debug * remove debug stuff * Remove timeouts. * Remove heavy comments * Remove more comments * Remove more comments
1 parent 45a0664 commit 14a2765

17 files changed

Lines changed: 253 additions & 307 deletions

File tree

.github/workflows/build-publish.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,34 @@ jobs:
214214
npm run set-version ${{ needs.version.outputs.version_string }} ${{ needs.version.outputs.version_code }}
215215
npm run build:mobile -- --no-progress
216216
npx cap sync ios
217+
218+
- name: Restore Swift package cache
219+
id: spm-cache
220+
uses: actions/cache/restore@v4
221+
with:
222+
path: IsraelHiking.Web/ios/.spm-cache
223+
key: spm-${{ runner.os }}-${{ hashFiles('IsraelHiking.Web/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
224+
restore-keys: spm-${{ runner.os }}-
225+
226+
- name: Resolve Swift packages
227+
run: |
228+
cd IsraelHiking.Web/ios/App
229+
xcodebuild -resolvePackageDependencies \
230+
-project App.xcodeproj \
231+
-clonedSourcePackagesDirPath ../.spm-cache
232+
233+
- name: Save Swift package cache
234+
if: steps.spm-cache.outputs.cache-hit != 'true'
235+
uses: actions/cache/save@v4
236+
with:
237+
path: IsraelHiking.Web/ios/.spm-cache
238+
key: spm-${{ runner.os }}-${{ hashFiles('IsraelHiking.Web/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
239+
217240
- name: Build iOS with signing
218241
if: ${{ github.secret_source == 'Actions' }}
219242
run: |
220243
cd IsraelHiking.Web/ios/App
244+
# The lane reuses ios/.spm-cache, populated by the resolve step above.
221245
bundle exec fastlane build_ios
222246
env:
223247
MATCH_PASSWORD: ${{ secrets.PASSWORD }}

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,29 @@ jobs:
132132
npm ci
133133
npm run build:mobile -- --no-progress
134134
npx cap sync ios
135+
136+
- name: Restore Swift package cache
137+
id: spm-cache
138+
uses: actions/cache/restore@v4
139+
with:
140+
path: IsraelHiking.Web/ios/.spm-cache
141+
key: spm-${{ runner.os }}-${{ hashFiles('IsraelHiking.Web/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
142+
restore-keys: spm-${{ runner.os }}-
143+
144+
- name: Resolve Swift packages
145+
run: |
146+
cd IsraelHiking.Web/ios/App
147+
xcodebuild -resolvePackageDependencies \
148+
-project App.xcodeproj \
149+
-clonedSourcePackagesDirPath ../.spm-cache
150+
151+
- name: Save Swift package cache
152+
if: steps.spm-cache.outputs.cache-hit != 'true'
153+
uses: actions/cache/save@v4
154+
with:
155+
path: IsraelHiking.Web/ios/.spm-cache
156+
key: spm-${{ runner.os }}-${{ hashFiles('IsraelHiking.Web/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
157+
135158
- name: Build iOS with signing
136159
if: ${{ github.secret_source == 'Actions' }}
137160
run: |

IsraelHiking.Web/ios/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
App/build
2-
App/Pods
32
App/App/public
43
DerivedData
54
xcuserdata
65

6+
# Swift package checkouts and binary artifacts, populated by CI and cached
7+
.spm-cache
8+
79
# Cordova plugins for Capacitor
810
capacitor-cordova-ios-plugins
911

IsraelHiking.Web/ios/App/App.xcodeproj/project.pbxproj

Lines changed: 46 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 54;
6+
objectVersion = 60;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -24,6 +24,8 @@
2424
0DAA0106000000000000AA06 /* ShareExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 0DAA0105000000000000AA05 /* ShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
2525
0DAA0112000000000000AA12 /* Translations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DAA0113000000000000AA13 /* Translations.swift */; };
2626
0DAA0114000000000000AA14 /* Translations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DAA0113000000000000AA13 /* Translations.swift */; };
27+
0DCC0103000000000000CC03 /* CapApp-SPM in Frameworks */ = {isa = PBXBuildFile; productRef = 0DCC0102000000000000CC02 /* CapApp-SPM */; };
28+
0DCC0106000000000000CC06 /* MapLibre in Frameworks */ = {isa = PBXBuildFile; productRef = 0DCC0105000000000000CC05 /* MapLibre */; };
2729
0DD5D9592FDBDBB300983BAA /* PMTiles in Frameworks */ = {isa = PBXBuildFile; productRef = 0DD5D9582FDBDBB300983BAA /* PMTiles */; };
2830
2FAD9763203C412B000D30F8 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = 2FAD9762203C412B000D30F8 /* config.xml */; };
2931
50379B232058CBB4000EE86E /* capacitor.config.json in Resources */ = {isa = PBXBuildFile; fileRef = 50379B222058CBB4000EE86E /* capacitor.config.json */; };
@@ -32,7 +34,6 @@
3234
504EC30F1FED79650016851F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30E1FED79650016851F /* Assets.xcassets */; };
3335
504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; };
3436
50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; };
35-
A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; };
3637
/* End PBXBuildFile section */
3738

3839
/* Begin PBXContainerItemProxy section */
@@ -77,6 +78,7 @@
7778
0DAA0104000000000000AA04 /* ShareExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ShareExtension.entitlements; sourceTree = "<group>"; };
7879
0DAA0105000000000000AA05 /* ShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
7980
0DAA0113000000000000AA13 /* Translations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Translations.swift; sourceTree = "<group>"; };
81+
0DCC0107000000000000CC07 /* debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = debug.xcconfig; path = ../debug.xcconfig; sourceTree = SOURCE_ROOT; };
8082
2FAD9762203C412B000D30F8 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = "<group>"; };
8183
50379B222058CBB4000EE86E /* capacitor.config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = capacitor.config.json; sourceTree = "<group>"; };
8284
504EC3041FED79650016851F /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -86,10 +88,7 @@
8688
504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
8789
504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8890
50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = "<group>"; };
89-
AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App.framework; sourceTree = BUILT_PRODUCTS_DIR; };
90-
AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.release.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.release.xcconfig"; sourceTree = "<group>"; };
9191
F15F05A52935486900827848 /* App.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = App.entitlements; sourceTree = "<group>"; };
92-
FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.debug.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig"; sourceTree = "<group>"; };
9392
/* End PBXFileReference section */
9493

9594
/* Begin PBXFrameworksBuildPhase section */
@@ -104,7 +103,8 @@
104103
isa = PBXFrameworksBuildPhase;
105104
buildActionMask = 2147483647;
106105
files = (
107-
A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */,
106+
0DCC0103000000000000CC03 /* CapApp-SPM in Frameworks */,
107+
0DCC0106000000000000CC06 /* MapLibre in Frameworks */,
108108
0DD5D9592FDBDBB300983BAA /* PMTiles in Frameworks */,
109109
0D6243252FDEC57E00B2C10A /* MaplibreContour in Frameworks */,
110110
);
@@ -141,20 +141,11 @@
141141
path = ShareExtension;
142142
sourceTree = "<group>";
143143
};
144-
27E2DDA53C4D2A4D1A88CE4A /* Frameworks */ = {
145-
isa = PBXGroup;
146-
children = (
147-
AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */,
148-
);
149-
name = Frameworks;
150-
sourceTree = "<group>";
151-
};
152144
504EC2FB1FED79650016851F = {
153145
isa = PBXGroup;
154146
children = (
147+
0DCC0107000000000000CC07 /* debug.xcconfig */,
155148
504EC3051FED79650016851F /* Products */,
156-
7F8756D8B27F46E3366F6CEA /* Pods */,
157-
27E2DDA53C4D2A4D1A88CE4A /* Frameworks */,
158149
504EC3061FED79650016851F /* App */,
159150
0DAA0107000000000000AA07 /* ShareExtension */,
160151
);
@@ -188,15 +179,6 @@
188179
path = App;
189180
sourceTree = "<group>";
190181
};
191-
7F8756D8B27F46E3366F6CEA /* Pods */ = {
192-
isa = PBXGroup;
193-
children = (
194-
FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */,
195-
AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */,
196-
);
197-
name = Pods;
198-
sourceTree = "<group>";
199-
};
200182
/* End PBXGroup section */
201183

202184
/* Begin PBXNativeTarget section */
@@ -221,11 +203,9 @@
221203
isa = PBXNativeTarget;
222204
buildConfigurationList = 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */;
223205
buildPhases = (
224-
6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */,
225206
504EC3001FED79650016851F /* Sources */,
226207
504EC3011FED79650016851F /* Frameworks */,
227208
504EC3021FED79650016851F /* Resources */,
228-
9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */,
229209
0DAA010F000000000000AA0F /* Embed App Extensions */,
230210
);
231211
buildRules = (
@@ -234,6 +214,12 @@
234214
0DAA0110000000000000AA10 /* PBXTargetDependency */,
235215
);
236216
name = App;
217+
packageProductDependencies = (
218+
0DCC0102000000000000CC02 /* CapApp-SPM */,
219+
0DCC0105000000000000CC05 /* MapLibre */,
220+
0DD5D9582FDBDBB300983BAA /* PMTiles */,
221+
0D6243242FDEC57E00B2C10A /* MaplibreContour */,
222+
);
237223
productName = App;
238224
productReference = 504EC3041FED79650016851F /* App.app */;
239225
productType = "com.apple.product-type.application";
@@ -267,6 +253,8 @@
267253
);
268254
mainGroup = 504EC2FB1FED79650016851F;
269255
packageReferences = (
256+
0DCC0101000000000000CC01 /* XCLocalSwiftPackageReference "CapApp-SPM" */,
257+
0DCC0104000000000000CC04 /* XCRemoteSwiftPackageReference "maplibre-gl-native-distribution" */,
270258
0DD5D9572FDBDBB300983BAA /* XCRemoteSwiftPackageReference "pmtiles-mobile" */,
271259
0D6243232FDEC57E00B2C10A /* XCRemoteSwiftPackageReference "maplibre-contour-rs" */,
272260
);
@@ -303,42 +291,6 @@
303291
};
304292
/* End PBXResourcesBuildPhase section */
305293

306-
/* Begin PBXShellScriptBuildPhase section */
307-
6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */ = {
308-
isa = PBXShellScriptBuildPhase;
309-
buildActionMask = 2147483647;
310-
files = (
311-
);
312-
inputPaths = (
313-
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
314-
"${PODS_ROOT}/Manifest.lock",
315-
);
316-
name = "[CP] Check Pods Manifest.lock";
317-
outputPaths = (
318-
"$(DERIVED_FILE_DIR)/Pods-App-checkManifestLockResult.txt",
319-
);
320-
runOnlyForDeploymentPostprocessing = 0;
321-
shellPath = /bin/sh;
322-
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
323-
showEnvVarsInLog = 0;
324-
};
325-
9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */ = {
326-
isa = PBXShellScriptBuildPhase;
327-
buildActionMask = 2147483647;
328-
files = (
329-
);
330-
inputPaths = (
331-
);
332-
name = "[CP] Embed Pods Frameworks";
333-
outputPaths = (
334-
);
335-
runOnlyForDeploymentPostprocessing = 0;
336-
shellPath = /bin/sh;
337-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-App/Pods-App-frameworks.sh\"\n";
338-
showEnvVarsInLog = 0;
339-
};
340-
/* End PBXShellScriptBuildPhase section */
341-
342294
/* Begin PBXSourcesBuildPhase section */
343295
0DAA0108000000000000AA08 /* Sources */ = {
344296
isa = PBXSourcesBuildPhase;
@@ -455,6 +407,7 @@
455407
};
456408
504EC3141FED79650016851F /* Debug */ = {
457409
isa = XCBuildConfiguration;
410+
baseConfigurationReference = 0DCC0107000000000000CC07 /* debug.xcconfig */;
458411
buildSettings = {
459412
ALWAYS_SEARCH_USER_PATHS = NO;
460413
CLANG_ANALYZER_NONNULL = YES;
@@ -573,7 +526,7 @@
573526
};
574527
504EC3171FED79650016851F /* Debug */ = {
575528
isa = XCBuildConfiguration;
576-
baseConfigurationReference = FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */;
529+
baseConfigurationReference = 0DCC0107000000000000CC07 /* debug.xcconfig */;
577530
buildSettings = {
578531
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
579532
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
@@ -588,7 +541,6 @@
588541
"@executable_path/Frameworks",
589542
);
590543
MARKETING_VERSION = 9.20.0;
591-
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
592544
PRODUCT_BUNDLE_IDENTIFIER = com.mapeak;
593545
PRODUCT_NAME = "$(TARGET_NAME)";
594546
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -600,7 +552,6 @@
600552
};
601553
504EC3181FED79650016851F /* Release */ = {
602554
isa = XCBuildConfiguration;
603-
baseConfigurationReference = AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */;
604555
buildSettings = {
605556
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
606557
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
@@ -658,26 +609,51 @@
658609
};
659610
/* End XCConfigurationList section */
660611

612+
/* Begin XCLocalSwiftPackageReference section */
613+
0DCC0101000000000000CC01 /* XCLocalSwiftPackageReference "CapApp-SPM" */ = {
614+
isa = XCLocalSwiftPackageReference;
615+
relativePath = "CapApp-SPM";
616+
};
617+
/* End XCLocalSwiftPackageReference section */
618+
661619
/* Begin XCRemoteSwiftPackageReference section */
620+
0DCC0104000000000000CC04 /* XCRemoteSwiftPackageReference "maplibre-gl-native-distribution" */ = {
621+
isa = XCRemoteSwiftPackageReference;
622+
repositoryURL = "https://github.com/maplibre/maplibre-gl-native-distribution";
623+
requirement = {
624+
kind = exactVersion;
625+
version = 6.28.0;
626+
};
627+
};
662628
0D6243232FDEC57E00B2C10A /* XCRemoteSwiftPackageReference "maplibre-contour-rs" */ = {
663629
isa = XCRemoteSwiftPackageReference;
664-
repositoryURL = "https://github.com/Mapeak-com/maplibre-contour-rs";
630+
repositoryURL = "https://github.com/mapeak-com/maplibre-contour-rs";
665631
requirement = {
666632
kind = exactVersion;
667-
version = 0.4.1;
633+
version = 0.4.2;
668634
};
669635
};
670636
0DD5D9572FDBDBB300983BAA /* XCRemoteSwiftPackageReference "pmtiles-mobile" */ = {
671637
isa = XCRemoteSwiftPackageReference;
672-
repositoryURL = "https://github.com/mapeak-com/pmtiles-mobile.git";
638+
repositoryURL = "https://github.com/mapeak-com/pmtiles-mobile";
673639
requirement = {
674640
kind = exactVersion;
675-
version = 0.3.2;
641+
version = 0.3.3;
676642
};
677643
};
678644
/* End XCRemoteSwiftPackageReference section */
679645

680646
/* Begin XCSwiftPackageProductDependency section */
647+
0DCC0102000000000000CC02 /* CapApp-SPM */ = {
648+
isa = XCSwiftPackageProductDependency;
649+
package = 0DCC0101000000000000CC01 /* XCLocalSwiftPackageReference "CapApp-SPM" */;
650+
productName = "CapApp-SPM";
651+
};
652+
0DCC0105000000000000CC05 /* MapLibre */ = {
653+
isa = XCSwiftPackageProductDependency;
654+
package = 0DCC0104000000000000CC04 /* XCRemoteSwiftPackageReference "maplibre-gl-native-distribution" */;
655+
productName = MapLibre;
656+
};
681657
0D6243242FDEC57E00B2C10A /* MaplibreContour */ = {
682658
isa = XCSwiftPackageProductDependency;
683659
package = 0D6243232FDEC57E00B2C10A /* XCRemoteSwiftPackageReference "maplibre-contour-rs" */;

0 commit comments

Comments
 (0)