Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI for Swift Package Manager #33

Merged
merged 39 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7eff4aa
SPM
MaartenZonneveld Jan 26, 2024
546ac8c
Remove carthage support
MaartenZonneveld Jan 26, 2024
01ba2a2
Delete MapboxCoreNavigation.podspec
MaartenZonneveld Jan 26, 2024
622441e
Fix ExampleSwift
MaartenZonneveld Feb 5, 2024
6bf6a0d
Add to changelog
MaartenZonneveld Feb 5, 2024
e858692
Examples & tests in xcodeproj
MaartenZonneveld Feb 5, 2024
50ffd3e
Clean up
MaartenZonneveld Feb 5, 2024
08acf41
Append
MaartenZonneveld Feb 5, 2024
b06b25d
Update XcodeProj/MapboxNavigationTests/MapboxNavigationTests.swift
MaartenZonneveld Feb 6, 2024
d49f418
Update XcodeProj/RouteTest/Fixture.swift
MaartenZonneveld Feb 6, 2024
5c7e396
Remove Carthage from workflow
MaartenZonneveld Feb 6, 2024
eaa6797
Merge remote-tracking branch 'upstream/main' into feature/swift-packa…
MaartenZonneveld Feb 12, 2024
d7aab4f
Fix merge
MaartenZonneveld Feb 12, 2024
5d8673d
Test plan
MaartenZonneveld Feb 12, 2024
83cc086
Revert let voiceController change
MaartenZonneveld Feb 16, 2024
55a467a
Revert CustomViewController changes
MaartenZonneveld Feb 16, 2024
ca235b7
Remove redundant import
MaartenZonneveld Feb 16, 2024
929d70b
Restore iOS 12 support
MaartenZonneveld Feb 16, 2024
555c6ef
add tests and make them pass
Patrick-Kladek Apr 4, 2024
acc36b3
restructure project
Patrick-Kladek Apr 4, 2024
a10c101
update gitignore
Patrick-Kladek Apr 4, 2024
7217bae
Add TestPlan
Patrick-Kladek Apr 4, 2024
3872b79
Merge branch 'main' of https://github.com/maplibre/maplibre-navigatio…
Patrick-Kladek Apr 4, 2024
1e05e04
reduce swift-tools version as github images is not up to date
Patrick-Kladek Apr 4, 2024
b888183
install latest swift version for github actions run
Patrick-Kladek Apr 4, 2024
a61999c
run via xcrun
Patrick-Kladek Apr 4, 2024
41fb08b
use xcodebuild with toolchain flag
Patrick-Kladek Apr 4, 2024
bf3df08
fix flag
Patrick-Kladek Apr 4, 2024
dc978d0
configure newest Xcode app
Patrick-Kladek Apr 4, 2024
f01cd5f
investigate xcode-select
Patrick-Kladek Apr 4, 2024
2868c42
xcode-select switch to correct path
Patrick-Kladek Apr 4, 2024
e6e25ef
print all /Applications
Patrick-Kladek Apr 4, 2024
f65f4b5
explicitly request macos-14
Patrick-Kladek Apr 4, 2024
d20fabf
try again
Patrick-Kladek Apr 4, 2024
c7934d2
pipe through xcbeautify
Patrick-Kladek Apr 4, 2024
fd944c5
enable github actions renderer in xcbeautify
Patrick-Kladek Apr 4, 2024
a61c166
update name of workflow
Patrick-Kladek Apr 4, 2024
c5541e8
use spaces for indentation
Patrick-Kladek Apr 11, 2024
98a3a55
fix last missing indentation change
Patrick-Kladek Apr 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
40 changes: 10 additions & 30 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,21 @@ on:

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

steps:
- name: Configure Xcode 15.3
run: |
sudo xcode-select -s /Applications/Xcode_15.3.app
- name: Print Xcode Version
run: |
xcode-select --print-path
- name: Checkout
uses: actions/checkout@v3
- name: Set Default Scheme
run: |
scheme_list=$(xcodebuild -list -json | tr -d "\n")
default="All Tests"
echo $default | cat >default
echo Using default scheme: $default
- name: "Carthage Bootstrap"
uses: olejnjak/carthage-workaround@v1
with:
action: bootstrap --platform iOS --use-xcframeworks --cache-builds
- name: Build
env:
scheme: ${{ 'default' }}
platform: ${{ 'iOS Simulator' }}
run: |
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
if [ $scheme = default ]; then scheme=$(cat default); fi
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
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
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
- name: Test
env:
scheme: ${{ 'default' }}
platform: ${{ 'iOS Simulator' }}
run: |
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
if [ $scheme = default ]; then scheme=$(cat default); fi
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
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
xcodebuild test-without-building -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
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
153 changes: 141 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,150 @@
MapboxNavigation.xcworkspace
# Created by https://www.toptal.com/developers/gitignore/api/xcode,swiftpackagemanager,swiftpm,swift,macos,carthage
# Edit at https://www.toptal.com/developers/gitignore?templates=xcode,swiftpackagemanager,swiftpm,swift,macos,carthage

### Carthage ###
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

### macOS ###
# General
.DS_Store
.idea
.AppleDouble
.LSOverride

xcuserdata
# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Swift ###
# Xcode
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.xcuserstate
*.xcscmblueprint
IDEWorkspaceChecks.plist
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

Pods/
## Obj-C/Swift specific
*.hmap

Carthage/Build
Carthage/Checkouts
/documentation
/build
## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# Pods/
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

### SwiftPackageManager ###
Packages
xcuserdata
*.xcodeproj


### SwiftPM ###


### Xcode ###

## Xcode 8 and earlier

### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcodeproj/project.xcworkspace/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno
**/xcshareddata/WorkspaceSettings.xcsettings

Examples/Swift/Navigation_Example.mobileprovision
# End of https://www.toptal.com/developers/gitignore/api/xcode,swiftpackagemanager,swiftpm,swift,macos,carthage
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
5.9
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
version = "1.3">
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand All @@ -14,10 +14,24 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C5ADFBC81DDCC7840011824B"
BuildableName = "MapboxCoreNavigation.framework"
BlueprintName = "MapboxCoreNavigation"
ReferencedContainer = "container:MapboxNavigation.xcodeproj">
BlueprintIdentifier = "MapboxNavigation"
BuildableName = "MapboxNavigation"
BlueprintName = "MapboxNavigation"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MapboxCoreNavigationTests"
BuildableName = "MapboxCoreNavigationTests"
BlueprintName = "MapboxCoreNavigationTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand All @@ -26,31 +40,28 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C5ADFBC81DDCC7840011824B"
BuildableName = "MapboxCoreNavigation.framework"
BlueprintName = "MapboxCoreNavigation"
ReferencedContainer = "container:MapboxNavigation.xcodeproj">
</BuildableReference>
</MacroExpansion>
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C5ADFBD11DDCC7840011824B"
BuildableName = "MapboxCoreNavigationTests.xctest"
BlueprintIdentifier = "MapboxCoreNavigationTests"
BuildableName = "MapboxCoreNavigationTests"
BlueprintName = "MapboxCoreNavigationTests"
ReferencedContainer = "container:MapboxNavigation.xcodeproj">
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MapboxNavigationTests"
BuildableName = "MapboxNavigationTests"
BlueprintName = "MapboxNavigationTests"
ReferencedContainer = "container:">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "MapboxNavigationTests/testLowAlert()">
</Test>
</SkippedTests>
</TestableReference>
</Testables>
</TestAction>
Expand All @@ -64,15 +75,6 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C5ADFBC81DDCC7840011824B"
BuildableName = "MapboxCoreNavigation.framework"
BlueprintName = "MapboxCoreNavigation"
ReferencedContainer = "container:MapboxNavigation.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand All @@ -83,10 +85,10 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C5ADFBC81DDCC7840011824B"
BuildableName = "MapboxCoreNavigation.framework"
BlueprintName = "MapboxCoreNavigation"
ReferencedContainer = "container:MapboxNavigation.xcodeproj">
BlueprintIdentifier = "MapboxNavigation"
BuildableName = "MapboxNavigation"
BlueprintName = "MapboxNavigation"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Remove MapboxVoiceController and Mapbox Speech dependency. If you would like to use MapboxSpeech, you can copy the deleted MapboxVoiceController into your project.
- 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.
- Only snap location to route if the location is within the `RouteControllerUserLocationSnappingDistance`
- Add support for Swift Package Manager while dropping Carthage and Cocoapods.

## v2.0.0 (May 23, 2023)
- Upgrade minimum iOS version from 11.0 to 12.0.
Expand Down
4 changes: 0 additions & 4 deletions Cartfile

This file was deleted.

3 changes: 0 additions & 3 deletions Cartfile.private

This file was deleted.

8 changes: 0 additions & 8 deletions Cartfile.resolved

This file was deleted.

8 changes: 0 additions & 8 deletions Examples/Objective-C/AppDelegate.h

This file was deleted.

Loading
Loading