Skip to content

Commit

Permalink
Add CocoaPods support (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcaunt authored May 14, 2024
1 parent 3ef6511 commit ac16a77
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 88 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
- name: Run unit tests on tvOS
run: xcodebuild test -scheme UID2 -sdk appletvsimulator17.4 -destination "OS=17.4,name=Apple TV"

- name: Lint pod spec
run: pod lib lint --verbose

vulnerability-scan:
name: Vulnerability Scan
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ let package = Package(
name: "UID2",
dependencies: [ .product(name: "SwiftASN1", package: "swift-asn1") ],
resources: [
.copy("Properties/sdk_properties.plist"),
.copy("PrivacyInfo.xcprivacy")
],
swiftSettings: [
Expand Down
7 changes: 3 additions & 4 deletions RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ Version Numbering follows [Semantic Versioning](https://semver.org) standards.
### Release Checklist

1. Create a Release PR
* Update / Confirm `UID2Version` in `sdk_properties.plist` is set to
* https://github.com/IABTechLab/uid2-ios-sdk/blob/9706cbc8959593a81e5aea82926bc41ac9bbb9d3/Sources/UID2/Properties/sdk_properties.plist#L6
* Update / Confirm `UID2Version` in `UID2SDKProperties.swift` is set to
* https://github.com/IABTechLab/uid2-ios-sdk/blob/b725a503093d9984740b3b7e3f4325588bf7fbcd/Sources/UID2/Properties/UID2SDKProperties.swift#L13
* Add and / or Edit any ADRs that support this release
2. Merge Release PR
3. Use GitHub Releases to Publish the release
* https://github.com/IABTechLab/uid2-ios-sdk/releases/new
* Create tag on `main` for the commit created by merge of the Release PR
* Document any Release Notes
4. Create a Next Release PR
* Set `UID2Version` in `sdk_properties.plist` to the expected next (likely minor) release version of the SDK.
* Set `UID2Version` in `UID2SDKProperties.swift` to the expected next (likely minor) release version of the SDK.
5. Merge Next Release PR **BEFORE ANY CODE FOR NEXT RELEASE IS MERGED**

18 changes: 0 additions & 18 deletions Sources/UID2/Properties/SDKProperties.swift

This file was deleted.

29 changes: 0 additions & 29 deletions Sources/UID2/Properties/SDKPropertyLoader.swift

This file was deleted.

21 changes: 1 addition & 20 deletions Sources/UID2/Properties/UID2SDKProperties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,7 @@ import Foundation
public enum UID2SDKProperties {

public static func getUID2SDKVersion() -> (major: Int, minor: Int, patch: Int) {

let invalidVersion = (major: 0, minor: 0, patch: 0)

let properties = SDKPropertyLoader.load()
guard let version = properties.uid2Version else {
return invalidVersion
}

let versionComponents = version.components(separatedBy: ".")

if versionComponents.count == 3 {
guard let major = Int(versionComponents[0]),
let minor = Int(versionComponents[1]),
let patch = Int(versionComponents[2]) else {
return invalidVersion
}
return (major: major, minor: minor, patch: patch)
}

return invalidVersion
(1, 2, 0)
}

}
8 changes: 0 additions & 8 deletions Sources/UID2/Properties/sdk_properties.plist

This file was deleted.

10 changes: 2 additions & 8 deletions Sources/UID2/UID2Manager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ public final actor UID2Manager {
private let defaultUid2ApiUrl = "https://prod.uidapi.com"

private init() {

// SDK Supplied Properties
self.sdkVersion = UID2SDKProperties.getUID2SDKVersion()

// App Supplied Properites
let environment: Environment
if let apiUrlOverride = Bundle.main.object(forInfoDictionaryKey: "UID2ApiUrl") as? String,
Expand All @@ -76,10 +72,8 @@ public final actor UID2Manager {
environment = UID2Settings.shared.environment
}

var clientVersion = "\(sdkVersion.major).\(sdkVersion.minor).\(sdkVersion.patch)"
if self.sdkVersion == (major: 0, minor: 0, patch: 0) {
clientVersion = "unknown"
}
sdkVersion = UID2SDKProperties.getUID2SDKVersion()
let clientVersion = "\(sdkVersion.major).\(sdkVersion.minor).\(sdkVersion.patch)"

let isLoggingEnabled = UID2Settings.shared.isLoggingEnabled
self.log = isLoggingEnabled
Expand Down
34 changes: 34 additions & 0 deletions UID2.podspec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "UID2",
"summary": "A framework for integrating UID2 into iOS applications.",
"homepage": "https://unifiedid.com/",
"license": "Apache License, Version 2.0",
"version": "1.2.0",
"authors": {
"David Snabel-Caunt": "dave.snabel-caunt@thetradedesk.com"
},
"source": {
"git": "https://github.com/IABTechLab/uid2-ios-sdk.git",
"tag": "v1.2.0"
},
"platforms": {
"ios": "13.0",
"tvos": "13.0"
},
"swift_versions": [
"5"
],
"requires_arc": true,
"frameworks": "Foundation",
"resource_bundles": {
"UID2": ["Sources/UID2/PrivacyInfo.xcprivacy"]
},
"source_files": [
"Sources/UID2/**/*"
],
"dependencies": {
"SwiftASN1": [
"~> 1.0"
]
}
}

0 comments on commit ac16a77

Please sign in to comment.