Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,33 @@ jobs:
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0

- name: Disable #error app-id gate (CI build only)
run: |
# SampleApp may ship `#error("insert your application_id here")` to force
# SDK consumers to set a real app id. Comment it out so CI can build.
# No-op when the directive is not present.
sed -i '' -E 's@^([[:space:]]*)#error@\1// #error@' SampleApp/AppDelegate.swift

- name: Cache CocoaPods
id: cocoapods-cache
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: |
Pods
SampleApp.xcworkspace
~/Library/Caches/CocoaPods
key: ${{ runner.os }}-pods-${{ hashFiles('Podfile.lock', 'SampleApp.xcodeproj/project.pbxproj') }}
restore-keys: |
${{ runner.os }}-pods-

- name: Install pods
run: pod install
# Skipped on an exact cache hit, where Pods/ and the gitignored
# SampleApp.xcworkspace are restored from the cache. On a miss or a
# restore-keys partial restore this runs and regenerates the workspace
# the build step needs. --deployment keeps CI reproducible: it errors if
# Podfile.lock is out of sync with Podfile and never mutates the lock.
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
run: pod install --deployment

- name: Build (simulator, no signing)
run: |
Expand Down
16 changes: 13 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Mac OS
.DS_Store

# Cocoapods
# CocoaPods — restored by `pod install`
Pods

# Project
# Build output (regenerated)
DerivedData
.derived-data-log-*

# CocoaPods generates the workspace on `pod install`
SampleApp.xcworkspace

# User-specific Xcode state
SampleApp.xcodeproj/project.xcworkspace/xcuserdata
SampleApp.xcodeproj/xcuserdata
SampleApp.xcodeproj/xcuserdata

# NOTE: SampleApp.xcodeproj and Derived/ are intentionally committed. They are produced
# by `tuist generate` at deploy time so integrators can open and build the sample with
# just `pod install` — no Tuist required. Regenerate them from Project.swift if needed.
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Contributing

## Continuous integration

Every pull request to `master` builds the Sample App via GitHub Actions. See [`.github/workflows/ci.yml`](.github/workflows/ci.yml) for the workflow definition.
8 changes: 4 additions & 4 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
platform :ios, '13.0'
platform :ios, '16.0'

target 'SampleApp' do
pod 'OnfleetDriver', :path => '.'
end
target 'SampleApp' do
pod 'OnfleetDriver', :path => '.'
end
16 changes: 16 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
PODS:
- OnfleetDriver (0.17.2)

DEPENDENCIES:
- OnfleetDriver (from `.`)

EXTERNAL SOURCES:
OnfleetDriver:
:path: "."

SPEC CHECKSUMS:
OnfleetDriver: 037810c6b7803fe3e2ec235239f9771236dfb95f

PODFILE CHECKSUM: 5e3f8d838e94af12935f88a6deabda82e4cca230

COCOAPODS: 1.16.2
38 changes: 38 additions & 0 deletions Project.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import ProjectDescription

// Tuist manifest for the published OnfleetDriver SDK's SampleApp. deploy-sdk.sh copies
// this to the destination repo root and runs `tuist generate`, so the published repo
// ships a ready-to-open SampleApp.xcodeproj (+ Derived/) without integrators needing
// Tuist — they only run `pod install`.
//
// OnfleetDriver is NOT a dependency here: CocoaPods provides it (see the generated
// Podfile, `pod 'OnfleetDriver', :path => '.'`), vendoring the local
// OnfleetDriver.xcframework and supplying the linker/import settings (-ObjC and the
// OnfleetReactiveKit satellite SWIFT_INCLUDE_PATHS) via the podspec. Keeping the
// framework wiring in CocoaPods is what lets this manifest stay free of hardcoded
// framework-search / import paths.
let project = Project(
name: "SampleApp",
targets: [
.target(
name: "SampleApp",
destinations: .iOS,
product: .app,
bundleId: "com.onfleet.driver.sampleApp",
deploymentTargets: .iOS("16.0"),
infoPlist: .file(path: "SampleApp/Info.plist"),
sources: ["SampleApp/**/*.swift"],
resources: [
"SampleApp/**/*.storyboard",
"SampleApp/**/*.xcassets",
],
entitlements: .file(path: "SampleApp/SampleApp.entitlements"),
settings: .settings(
base: [
"SWIFT_VERSION": "5.0",
"TARGETED_DEVICE_FAMILY": "1,2",
]
)
),
]
)
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,7 @@ This repository contains `Sample App` project that integrates Driver SDK. It pro
1. clone `onfleet/ios-driver-sdk` repository using `git clone git@github.com:onfleet/ios-driver-sdk.git`
2. open root directory and install pods using `pod install`
3. open `SampleApp.xcworkspace` in Xcode
4. in `AppDelegate.swift` file replace the `applicationId` placeholder with your Onfleet **application_id** (the project compiles with the placeholder, but a real id is required to log in and run against Onfleet)
4. in `AppDelegate.swift` file add your Onfleet **application_id**
5. in target's Signing & Capabilities update bundle identifier and team, please make sure that push notifications work
6. build and run using `SampleApp` scheme
7. when logging in for the first time please perform the [Device Provision](#Provision).

### Continuous integration

Every pull request to `master` builds the Sample App via GitHub Actions (see `.github/workflows/ci.yml`).
Loading