Skip to content

Commit

Permalink
feat: introduce spm (#45)
Browse files Browse the repository at this point in the history
* feat: introduce spm
  • Loading branch information
muhammedtanriverdi-tomtom authored Nov 13, 2023
1 parent 9976b23 commit 35d55c0
Show file tree
Hide file tree
Showing 21 changed files with 982 additions and 182 deletions.
38 changes: 34 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,52 @@ name: Buid iOS app
on:
workflow_call:

env:
spm_dir: './SPM'
cocoapods_dir: './CocoaPods'
platform: 'iOS Simulator'
device_name: 'iPhone 14'
ios_version: '16.4'

# clear out default permissions
permissions: {}

jobs:
build:
name: Buid iOS app
build-spm:
name: Buid iOS app - SPM
permissions:
contents: read
runs-on: macos-latest
runs-on: macos-13
defaults:
run:
working-directory: ${{ env.spm_dir }}
steps:
- uses: actions/checkout@v3

- name: Build iOS app
run: >
xcodebuild
-project 'TomTomSDKExamples.xcodeproj'
-scheme 'TomTomSDKExamples'
-destination 'platform=${{ env.platform }},name=${{ env.device_name }},OS=${{ env.ios_version }}'
build-cocoapods:
name: Buid iOS app - CocoaPods
permissions:
contents: read
runs-on: macos-13
defaults:
run:
working-directory: ${{ env.cocoapods_dir }}
steps:
- uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
env:
BUNDLE_GEMFILE: '${{ env.cocoapods_dir }}/Gemfile'

- name: Add Cocoapods repository
# Ensure we have repos dir created
Expand All @@ -39,4 +69,4 @@ jobs:
xcodebuild
-workspace 'TomTomSDKExamples.xcworkspace'
-scheme 'TomTomSDKExamples'
-destination 'platform=iOS Simulator,name=iPhone 14'
-destination 'platform=${{ env.platform }},name=${{ env.device_name }},OS=${{ env.ios_version }}'
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,4 @@ iOSInjectionProject/
*.DS_Store

# Bundle gems
**/bundle

## Offline Map files #
Map/
**/bundle
2 changes: 1 addition & 1 deletion Gemfile → CocoaPods/Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'
ruby "~>#{File.read(File.join(__dir__, ".ruby-version")).strip}"
ruby "~>#{File.read(File.join(__dir__, "../.ruby-version")).strip}"
gem "cocoapods", "1.11.3"
gem "cocoapods-art"
File renamed without changes.
File renamed without changes.
File renamed without changes.
55 changes: 55 additions & 0 deletions CocoaPods/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Development setup

Once you have gained access, set up the development environment by following:

1. We recommend using `rbenv` to handle `ruby` selection/installation.
1. Install `rbenv`
```zsh
brew install rbenv
```
2. Clone the [tomtom-navigation-ios-examples] repository
```zsh
git clone [email protected]:tomtom-international/tomtom-navigation-ios-examples.git
```
3. Change directory to the related folder of the recently cloned repository and install `ruby` via `rbenv`
```zsh
cd tomtom-navigation-ios-examples/CocoaPods
rbenv install
```
4. Load `rbenv` to your shell
```zsh
echo 'eval "$(rbenv init - zsh)"' >> ~/.zshrc
```
Above command assumes that `zsh` is being used. If a different shell is being used, then you can find
commands for most common shells in [rbenv documentation].

5. Update `bundler`
```zsh
gem install bundler
```
6. ***reload*** your shell so the `rbenv` can extend `PATH` accordingly.

2. Install project's `gem` dependencies via `bundler`
```zsh
bundle install
```

3. Add a reference to the [CocoaPods] private repository:
```zsh
bundle exec pod repo-art add tomtom-sdk-cocoapods "https://repositories.tomtom.com/artifactory/api/pods/cocoapods"
```

4. Install the dependencies by executing the following command in **the project folder**.
```zsh
bundle exec pod install
```

5. To update the SDK version, run the command:
```zsh
bundle exec pod repo-art update tomtom-sdk-cocoapods
```
6. Open the project’s `xcworkspace` and start developing your awesome application.

[CocoaPods]: (https://guides.cocoapods.org/using/getting-started.html)
[rbenv documentation]: https://github.com/rbenv/rbenv#readme
[tomtom-navigation-ios-examples]: https://github.com/tomtom-international/tomtom-navigation-ios-examples

Large diffs are not rendered by default.

63 changes: 7 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,11 @@ Hello and welcome to this repository with examples showcasing the [TomTom Naviga

## Development setup

Once you have gained access, set up the development environment by following:
Before beginning, make sure you have Xcode 13 or 14 installed.

1. Install Xcode if you don't already have it. Supported versions of Xcode are 13 to 14, inclusive.

2. We recommend using `rbenv` to handle `ruby` selection/installation.
1. Install `rbenv`
```zsh
brew install rbenv
```
2. Clone the [tomtom-navigation-ios-examples] repository
```zsh
git clone https://github.com/tomtom-international/tomtom-navigation-ios-examples.git
```
3. Change directory to the recently cloned repository and install `ruby` via `rbenv`
```zsh
cd tomtom-navigation-ios-examples
rbenv install
```
4. Load `rbenv` to your shell
```zsh
echo 'eval "$(rbenv init - zsh)"' >> ~/.zshrc
```
Above command assumes that `zsh` is being used. If a different shell is being used, then you can find
commands for most common shells in [rbenv documentation].

5. Update `bundler`
```zsh
gem install bundler
```
6. Ensure you ***reload*** your shell so the `rbenv` can extend `PATH` accordingly.

3. Install project's `gem` dependencies via `bundler`
```zsh
bundle install
```

4. Add a reference to the [Cocoapods] private repository:
```zsh
bundle exec pod repo-art add tomtom-sdk-cocoapods "https://repositories.tomtom.com/artifactory/api/pods/cocoapods"
```

5. Install the dependencies by executing the following command in **the project folder**.
```
bundle exec pod install
```
6. To update the SDK version, run the command:
```
bundle exec pod repo-art update tomtom-sdk-cocoapods
```
7. Open the project’s `xcworkspace` and start developing your awesome application.
SPM or CocoaPods can be used to install the Navigation SDK. Both configurations are available in the examples. Please navigate to the related directory and find the project setup configuration.
- [Project setup for SPM]
- [Project setup for CocoaPods]

## API Keys

Expand All @@ -86,13 +40,10 @@ If you have a **black screen** when launching the Basic driving app, please foll
- Check that your `API key` is valid for the requested features
- Check your internet connection

---

[Cocoapods]: (https://guides.cocoapods.org/using/getting-started.html)
[contact us]: https://developer.tomtom.com/tomtom-sdk-for-ios/request-access
[How to get a TomTom API Key]: https://developer.tomtom.com/how-to-get-tomtom-api-key
[rbenv documentation]: https://github.com/rbenv/rbenv#readme
[register]: https://developer.tomtom.com/user/register
[tomtom-navigation-ios-examples]: https://github.com/tomtom-international/tomtom-navigation-ios-examples
[TomTom Navigation SDK for iOS]: https://developer.tomtom.com/ios/navigation/documentation/overview/introduction
[TomTom Developer Portal]: https://developer.tomtom.com/user/me/apps
[TomTom Developer Portal]: https://developer.tomtom.com/user/me/apps
[Project setup for SPM]: /SPM
[Project setup for CocoaPods]: /CocoaPods
11 changes: 11 additions & 0 deletions SPM/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Development setup

Once you have gained access, set up the development environment by following:

1. Clone the [tomtom-navigation-ios-examples] repository
```zsh
git clone [email protected]:tomtom-international/tomtom-navigation-ios-examples.git
```
2. Open the project’s `xcodeproj` in the `SPM` folder and start developing your awesome application.

[tomtom-navigation-ios-examples]: https://github.com/tomtom-international/tomtom-navigation-ios-examples
Loading

0 comments on commit 35d55c0

Please sign in to comment.