Skip to content

Commit a768d89

Browse files
Patrick-KladekMaartenZonneveldGiordano-Menegazzi
authored
Fix CI for Swift Package Manager (#33)
* SPM * Remove carthage support * Delete MapboxCoreNavigation.podspec * Fix ExampleSwift * Add to changelog * Examples & tests in xcodeproj * Clean up * Append * Update XcodeProj/MapboxNavigationTests/MapboxNavigationTests.swift * Update XcodeProj/RouteTest/Fixture.swift Co-authored-by: Giordano Menegazzi <[email protected]> * Remove Carthage from workflow * Fix merge * Test plan * Revert let voiceController change * Revert CustomViewController changes * Remove redundant import * Restore iOS 12 support * add tests and make them pass * restructure project * update gitignore * Add TestPlan * reduce swift-tools version as github images is not up to date * install latest swift version for github actions run * run via xcrun * use xcodebuild with toolchain flag * fix flag * configure newest Xcode app * investigate xcode-select * xcode-select switch to correct path * print all /Applications * explicitly request macos-14 * try again * pipe through xcbeautify * enable github actions renderer in xcbeautify * update name of workflow * use spaces for indentation * fix last missing indentation change --------- Co-authored-by: Maarten Zonneveld <[email protected]> Co-authored-by: Giordano Menegazzi <[email protected]>
1 parent d1e2581 commit a768d89

File tree

311 files changed

+644
-8806
lines changed

Some content is hidden

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

311 files changed

+644
-8806
lines changed

.github/workflows/ios.yml

+10-30
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,21 @@ on:
88

99
jobs:
1010
build:
11-
name: Build and Test default scheme using any available iPhone simulator
12-
runs-on: macos-latest
11+
name: Build and Test using Xcode 15.3 on iPhone 15 Pro
12+
runs-on: macos-14
1313

1414
steps:
15+
- name: Configure Xcode 15.3
16+
run: |
17+
sudo xcode-select -s /Applications/Xcode_15.3.app
18+
- name: Print Xcode Version
19+
run: |
20+
xcode-select --print-path
1521
- name: Checkout
1622
uses: actions/checkout@v3
17-
- name: Set Default Scheme
18-
run: |
19-
scheme_list=$(xcodebuild -list -json | tr -d "\n")
20-
default="All Tests"
21-
echo $default | cat >default
22-
echo Using default scheme: $default
23-
- name: "Carthage Bootstrap"
24-
uses: olejnjak/carthage-workaround@v1
25-
with:
26-
action: bootstrap --platform iOS --use-xcframeworks --cache-builds
2723
- name: Build
28-
env:
29-
scheme: ${{ 'default' }}
30-
platform: ${{ 'iOS Simulator' }}
3124
run: |
32-
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
33-
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
34-
if [ $scheme = default ]; then scheme=$(cat default); fi
35-
if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
36-
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
37-
xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
25+
set -o pipefail && xcodebuild build -scheme maplibre-navigation-ios -destination 'platform=iOS Simulator,OS=17.0.1,name=iPhone 15 Pro' | xcbeautify --renderer github-actions
3826
- name: Test
39-
env:
40-
scheme: ${{ 'default' }}
41-
platform: ${{ 'iOS Simulator' }}
4227
run: |
43-
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
44-
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
45-
if [ $scheme = default ]; then scheme=$(cat default); fi
46-
if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
47-
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
48-
xcodebuild test-without-building -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
28+
set -o pipefail && xcodebuild test -scheme maplibre-navigation-ios -destination 'platform=iOS Simulator,OS=17.0.1,name=iPhone 15 Pro' | xcbeautify --renderer github-actions

.gitignore

+141-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,150 @@
1-
MapboxNavigation.xcworkspace
1+
# Created by https://www.toptal.com/developers/gitignore/api/xcode,swiftpackagemanager,swiftpm,swift,macos,carthage
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=xcode,swiftpackagemanager,swiftpm,swift,macos,carthage
23

4+
### Carthage ###
5+
# Carthage
6+
#
7+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
8+
# Carthage/Checkouts
9+
10+
Carthage/Build
11+
12+
### macOS ###
13+
# General
314
.DS_Store
4-
.idea
15+
.AppleDouble
16+
.LSOverride
517

6-
xcuserdata
18+
# Icon must end with two \r
19+
Icon
20+
21+
22+
# Thumbnails
23+
._*
24+
25+
# Files that might appear in the root of a volume
26+
.DocumentRevisions-V100
27+
.fseventsd
28+
.Spotlight-V100
29+
.TemporaryItems
30+
.Trashes
31+
.VolumeIcon.icns
32+
.com.apple.timemachine.donotpresent
33+
34+
# Directories potentially created on remote AFP share
35+
.AppleDB
36+
.AppleDesktop
37+
Network Trash Folder
38+
Temporary Items
39+
.apdisk
40+
41+
### macOS Patch ###
42+
# iCloud generated files
43+
*.icloud
44+
45+
### Swift ###
46+
# Xcode
47+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
48+
49+
## User settings
50+
xcuserdata/
51+
52+
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
53+
*.xcscmblueprint
754
*.xccheckout
55+
56+
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
57+
build/
58+
DerivedData/
859
*.moved-aside
9-
*.xcuserstate
10-
*.xcscmblueprint
11-
IDEWorkspaceChecks.plist
60+
*.pbxuser
61+
!default.pbxuser
62+
*.mode1v3
63+
!default.mode1v3
64+
*.mode2v3
65+
!default.mode2v3
66+
*.perspectivev3
67+
!default.perspectivev3
1268

13-
Pods/
69+
## Obj-C/Swift specific
70+
*.hmap
1471

15-
Carthage/Build
16-
Carthage/Checkouts
17-
/documentation
18-
/build
72+
## App packaging
73+
*.ipa
74+
*.dSYM.zip
75+
*.dSYM
76+
77+
## Playgrounds
78+
timeline.xctimeline
79+
playground.xcworkspace
80+
81+
# Swift Package Manager
82+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
83+
# Packages/
84+
# Package.pins
85+
# Package.resolved
86+
# *.xcodeproj
87+
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
88+
# hence it is not needed unless you have added a package configuration file to your project
89+
# .swiftpm
90+
91+
.build/
92+
93+
# CocoaPods
94+
# We recommend against adding the Pods directory to your .gitignore. However
95+
# you should judge for yourself, the pros and cons are mentioned at:
96+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
97+
# Pods/
98+
# Add this line if you want to avoid checking in source code from the Xcode workspace
99+
# *.xcworkspace
100+
101+
# Carthage
102+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
103+
# Carthage/Checkouts
104+
105+
Carthage/Build/
106+
107+
# Accio dependency management
108+
Dependencies/
109+
.accio/
110+
111+
# fastlane
112+
# It is recommended to not store the screenshots in the git repo.
113+
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
114+
# For more information about the recommended setup visit:
115+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
116+
117+
fastlane/report.xml
118+
fastlane/Preview.html
119+
fastlane/screenshots/**/*.png
120+
fastlane/test_output
121+
122+
# Code Injection
123+
# After new code Injection tools there's a generated folder /iOSInjectionProject
124+
# https://github.com/johnno1962/injectionforxcode
125+
126+
iOSInjectionProject/
127+
128+
### SwiftPackageManager ###
129+
Packages
130+
xcuserdata
131+
*.xcodeproj
132+
133+
134+
### SwiftPM ###
135+
136+
137+
### Xcode ###
138+
139+
## Xcode 8 and earlier
19140

141+
### Xcode Patch ###
142+
*.xcodeproj/*
143+
!*.xcodeproj/project.pbxproj
144+
!*.xcodeproj/xcshareddata/
145+
!*.xcodeproj/project.xcworkspace/
146+
!*.xcworkspace/contents.xcworkspacedata
147+
/*.gcno
148+
**/xcshareddata/WorkspaceSettings.xcsettings
20149

21-
Examples/Swift/Navigation_Example.mobileprovision
150+
# End of https://www.toptal.com/developers/gitignore/api/xcode,swiftpackagemanager,swiftpm,swift,macos,carthage

.swift-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0
1+
5.9

MapboxNavigation.xcodeproj/xcshareddata/xcschemes/MapboxCoreNavigation.xcscheme .swiftpm/xcode/xcshareddata/xcschemes/maplibre-navigation-ios.xcscheme

+39-37
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1400"
4-
version = "1.3">
3+
LastUpgradeVersion = "1520"
4+
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
@@ -14,10 +14,24 @@
1414
buildForAnalyzing = "YES">
1515
<BuildableReference
1616
BuildableIdentifier = "primary"
17-
BlueprintIdentifier = "C5ADFBC81DDCC7840011824B"
18-
BuildableName = "MapboxCoreNavigation.framework"
19-
BlueprintName = "MapboxCoreNavigation"
20-
ReferencedContainer = "container:MapboxNavigation.xcodeproj">
17+
BlueprintIdentifier = "MapboxNavigation"
18+
BuildableName = "MapboxNavigation"
19+
BlueprintName = "MapboxNavigation"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "NO"
27+
buildForArchiving = "NO"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "MapboxCoreNavigationTests"
32+
BuildableName = "MapboxCoreNavigationTests"
33+
BlueprintName = "MapboxCoreNavigationTests"
34+
ReferencedContainer = "container:">
2135
</BuildableReference>
2236
</BuildActionEntry>
2337
</BuildActionEntries>
@@ -26,31 +40,28 @@
2640
buildConfiguration = "Debug"
2741
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2842
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "YES">
30-
<MacroExpansion>
31-
<BuildableReference
32-
BuildableIdentifier = "primary"
33-
BlueprintIdentifier = "C5ADFBC81DDCC7840011824B"
34-
BuildableName = "MapboxCoreNavigation.framework"
35-
BlueprintName = "MapboxCoreNavigation"
36-
ReferencedContainer = "container:MapboxNavigation.xcodeproj">
37-
</BuildableReference>
38-
</MacroExpansion>
43+
shouldUseLaunchSchemeArgsEnv = "YES"
44+
shouldAutocreateTestPlan = "YES">
3945
<Testables>
4046
<TestableReference
4147
skipped = "NO">
4248
<BuildableReference
4349
BuildableIdentifier = "primary"
44-
BlueprintIdentifier = "C5ADFBD11DDCC7840011824B"
45-
BuildableName = "MapboxCoreNavigationTests.xctest"
50+
BlueprintIdentifier = "MapboxCoreNavigationTests"
51+
BuildableName = "MapboxCoreNavigationTests"
4652
BlueprintName = "MapboxCoreNavigationTests"
47-
ReferencedContainer = "container:MapboxNavigation.xcodeproj">
53+
ReferencedContainer = "container:">
54+
</BuildableReference>
55+
</TestableReference>
56+
<TestableReference
57+
skipped = "NO">
58+
<BuildableReference
59+
BuildableIdentifier = "primary"
60+
BlueprintIdentifier = "MapboxNavigationTests"
61+
BuildableName = "MapboxNavigationTests"
62+
BlueprintName = "MapboxNavigationTests"
63+
ReferencedContainer = "container:">
4864
</BuildableReference>
49-
<SkippedTests>
50-
<Test
51-
Identifier = "MapboxNavigationTests/testLowAlert()">
52-
</Test>
53-
</SkippedTests>
5465
</TestableReference>
5566
</Testables>
5667
</TestAction>
@@ -64,15 +75,6 @@
6475
debugDocumentVersioning = "YES"
6576
debugServiceExtension = "internal"
6677
allowLocationSimulation = "YES">
67-
<MacroExpansion>
68-
<BuildableReference
69-
BuildableIdentifier = "primary"
70-
BlueprintIdentifier = "C5ADFBC81DDCC7840011824B"
71-
BuildableName = "MapboxCoreNavigation.framework"
72-
BlueprintName = "MapboxCoreNavigation"
73-
ReferencedContainer = "container:MapboxNavigation.xcodeproj">
74-
</BuildableReference>
75-
</MacroExpansion>
7678
</LaunchAction>
7779
<ProfileAction
7880
buildConfiguration = "Release"
@@ -83,10 +85,10 @@
8385
<MacroExpansion>
8486
<BuildableReference
8587
BuildableIdentifier = "primary"
86-
BlueprintIdentifier = "C5ADFBC81DDCC7840011824B"
87-
BuildableName = "MapboxCoreNavigation.framework"
88-
BlueprintName = "MapboxCoreNavigation"
89-
ReferencedContainer = "container:MapboxNavigation.xcodeproj">
88+
BlueprintIdentifier = "MapboxNavigation"
89+
BuildableName = "MapboxNavigation"
90+
BlueprintName = "MapboxNavigation"
91+
ReferencedContainer = "container:">
9092
</BuildableReference>
9193
</MacroExpansion>
9294
</ProfileAction>

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Remove MapboxVoiceController and Mapbox Speech dependency. If you would like to use MapboxSpeech, you can copy the deleted MapboxVoiceController into your project.
1212
- Updated MapLibre Native dependency to ios-v6.0.0 (https://github.com/maplibre/maplibre-native/releases/tag/ios-v6.0.0). Implementers need to change the prefix MGL to MLN for all MapLibre Native classes that are referenced.
1313
- Only snap location to route if the location is within the `RouteControllerUserLocationSnappingDistance`
14+
- Add support for Swift Package Manager while dropping Carthage and Cocoapods.
1415

1516
## v2.0.0 (May 23, 2023)
1617
- Upgrade minimum iOS version from 11.0 to 12.0.

Cartfile

-4
This file was deleted.

Cartfile.private

-3
This file was deleted.

Cartfile.resolved

-8
This file was deleted.

Examples/Objective-C/AppDelegate.h

-8
This file was deleted.

0 commit comments

Comments
 (0)