Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
63 changes: 48 additions & 15 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,73 @@

import PackageDescription

let swift = "-Swift"
let noLocation = "-NoLocation"

// MARK: - External Packages
let roktSDK = "Rokt-Widget"
let mpSDK = "mParticle-Apple-SDK"
let mpSDKNoLocation = mpSDK + noLocation


// MARK: - Names & Paths
let mpRokt = "mParticle-Rokt"
let mpRoktSwift = mpRokt + swift
let mpRoktNoLocation = mpRokt + noLocation
let mpRoktSwiftNoLocation = mpRoktSwift + noLocation

let package = Package(
name: "mParticle-Rokt",
platforms: [ .iOS(.v11), .tvOS(.v11) ],
name: mpRokt,
platforms: [ .iOS(.v11), .tvOS(.v11) ],
products: [
.library(
name: "mParticle-Rokt",
targets: ["mParticle-Rokt-Swift"]),
name: mpRokt,
targets: [mpRoktSwift]),
.library(
name: mpRoktNoLocation,
targets: [mpRoktSwiftNoLocation]),
],
dependencies: [
.package(name: "mParticle-Apple-SDK",
.package(name: mpSDK,
url: "https://github.com/mParticle/mparticle-apple-sdk",
.upToNextMajor(from: "8.0.0")),
.package(name: "Rokt-Widget",
.package(name: roktSDK,
url: "https://github.com/ROKT/rokt-sdk-ios",
.upToNextMajor(from: "4.10.0")),
],
targets: [
.target(
name: "mParticle-Rokt",
name: mpRokt,
dependencies: [
.product(name: mpSDK, package: mpSDK),
.product(name: roktSDK, package: roktSDK),
],
path: mpRokt,
publicHeadersPath: "."
),
.target(
name: mpRoktSwift,
dependencies: [
.target(name: mpRokt)
],
path: mpRoktSwift
),

.target(
name: mpRoktNoLocation,
dependencies: [
.product(name: "mParticle-Apple-SDK", package: "mParticle-Apple-SDK"),
.product(name: "Rokt-Widget", package: "Rokt-Widget"),
.product(name: mpSDKNoLocation, package: mpSDK),
.product(name: roktSDK, package: roktSDK),
],
path: "mParticle-Rokt",
path: mpRoktNoLocation,
publicHeadersPath: "."
),
.target(
name: "mParticle-Rokt-Swift",
name: mpRoktSwiftNoLocation,
dependencies: [
"mParticle-Rokt",
.product(name: "mParticle-Apple-SDK", package: "mParticle-Apple-SDK"),
.product(name: "Rokt-Widget", package: "Rokt-Widget"),
.target(name: mpRoktNoLocation)
],
path: "mParticle-Rokt-Swift"
path: mpRoktSwiftNoLocation
),
]
)
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,24 @@ This repository contains the Rokt integration for the [mParticle Apple SDK](http

**NOTE: THESE ARE EXAMPLE INSTRUCTIONS FOR YOUR NEW KIT, THIS EXAMPLE KIT IS NOT MEANT TO BE INCLUDED IN A REAL APPLICATION**

1. Add the kit dependency to your app's Podfile, Cartfile, or SPM:
1. Add the kit dependency to your app's `Podfile` or `SPM`:


```
#### CocoaPods:
```ruby
pod 'mParticle-Rokt', '~> 8.0'

# If you'd like to use a version of the mParticle SDK that doesn't include any location tracking
# nor links the CoreLocation framework, use this pod instead:
# pod 'mParticle-Rokt/SwiftNoLocation', '~> 8.0'
```

OR
#### Swift Package Manager
To integrate the SDK using Swift Package Manager, open your Xcode project and click on your project in the file list on the left, then select your Project in the middle of the window. Click on the **Package Dependencies** tab, and press the **"+"** button underneath the list of packages.

```
github "mparticle-integrations/mparticle-apple-integration-rokt" ~> 8.0
```
Enter the repository URL `https://github.com/mparticle-integrations/mparticle-apple-integration-rokt` in the search box on the top right, choose `mparticle-apple-integration-rokt` from the list of packages, and set the **Dependency Rule** to *Up to Next Major Version*. Then click the **Add Package** button.

Finally, choose either the package product `mParticle-Rokt`, or if you'd like to use a version of the SDK that doesn’t include any location tracking nor links the CoreLocation framework, choose `mParticle-Rokt-NoLocation`.

2. Follow the mParticle iOS SDK [quick-start](https://github.com/mParticle/mparticle-apple-sdk), then rebuild and launch your app, and verify that you see `"Included kits: { Rokt }"` in your Xcode console

Expand Down
1 change: 1 addition & 0 deletions mParticle-Rokt-NoLocation
1 change: 1 addition & 0 deletions mParticle-Rokt-Swift-NoLocation
20 changes: 16 additions & 4 deletions mParticle-Rokt.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Pod::Spec.new do |s|

s.ios.deployment_target = "12.0"

# Default includes both
s.default_subspecs = 'ObjC', 'Swift'

# Objective-C subspec
s.subspec 'ObjC' do |objc|
objc.source_files = 'mParticle-Rokt/*.{h,m}'
Expand All @@ -28,10 +31,19 @@ Pod::Spec.new do |s|
s.subspec 'Swift' do |swift|
swift.source_files = 'mParticle-Rokt-Swift/*.swift'
swift.dependency 'mParticle-Rokt/ObjC'
swift.dependency 'mParticle-Apple-SDK', '~> 8.0'
swift.dependency 'Rokt-Widget', '~> 4.10'
end

# Default includes both
s.default_subspecs = 'ObjC', 'Swift'
# Objective-C-NoLocation subspec
s.subspec 'ObjCNoLocation' do |objc|
objc.source_files = 'mParticle-Rokt/*.{h,m}'
objc.public_header_files = 'mParticle-Rokt/*.h'
objc.dependency 'mParticle-Apple-SDK/mParticleNoLocation', '~> 8.0'
objc.dependency 'Rokt-Widget', '~> 4.10'
end

# SwiftNoLocation subspec
s.subspec 'SwiftNoLocation' do |swift|
swift.source_files = 'mParticle-Rokt-Swift/*.swift'
swift.dependency 'mParticle-Rokt/ObjCNoLocation'
end
end
Loading