Skip to content

Commit

Permalink
feat: Add SPM Support (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonStalnaker authored Mar 3, 2023
1 parent 95bcb93 commit bbb3eba
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ fastlane/test_output
**/Cartfile.resolved
**/Pods
KitsExample

# Swift Package Manager
Package.resolved
.build
29 changes: 29 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

let package = Package(
name: "mParticle-CleverTap",
platforms: [ .iOS(.v9) ],
products: [
.library(
name: "mParticle-CleverTap",
targets: ["mParticle-CleverTap"]),
],
dependencies: [
.package(name: "mParticle-Apple-SDK",
url: "https://github.com/mParticle/mparticle-apple-sdk",
.upToNextMajor(from: "8.0.0")),
.package(name: "CleverTapSDK",
url: "https://github.com/CleverTap/clevertap-ios-sdk",
.upToNextMajor(from: "4.2.0")),
],
targets: [
.target(
name: "mParticle-CleverTap",
dependencies: ["mParticle-Apple-SDK", "CleverTapSDK"],
path: "mParticle-CleverTap",
publicHeadersPath: "."
),
]
)
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This repository contains the [CleverTap](https://clevertap.com/) integration for

### Adding the integration

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

```
pod 'mParticle-CleverTap', '~> 7.0'
Expand All @@ -15,6 +15,12 @@ This repository contains the [CleverTap](https://clevertap.com/) integration for
```
github "mparticle-integrations/mparticle-apple-integration-clevertap" ~> 7.0
```

OR

```
Open your project and navigate to the project's settings. Select the tab named Swift Packages and click on the add button (+) at the bottom left. then, enter the URL of CleverTap Kit GitHub repository - https://github.com/mparticle-integrations/mparticle-apple-integration-clevertap and click Next.
```

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: { CleverTap }"` in your Xcode console

Expand Down
1 change: 0 additions & 1 deletion mParticle-CleverTap/MPKitCleverTap.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#import "MPKitCleverTap.h"


#if defined(__has_include) && __has_include(<CleverTapSDK/CleverTap.h>)
#import <CleverTapSDK/CleverTap.h>
#else
Expand Down
5 changes: 4 additions & 1 deletion mParticle-CleverTap/mParticle_CleverTap.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@

FOUNDATION_EXPORT double mParticle_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char mParticle_ExampleVersionString[];

#if defined(__has_include) && __has_include(<mParticle_CleverTap/MPKitCleverTap.h>)
#import <mParticle_CleverTap/MPKitCleverTap.h>
#else
#import "MPKitCleverTap.h"
#endif

0 comments on commit bbb3eba

Please sign in to comment.