Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CocoaPods podspec #18

Merged
merged 2 commits into from
Apr 26, 2024
Merged
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
5 changes: 4 additions & 1 deletion .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

swift-code-checks:
name: Code Tests
runs-on: macos-latest
runs-on: macos-12

steps:
- uses: actions/checkout@v4
Expand All @@ -30,3 +30,6 @@ jobs:

- name: Run unit tests on tvOS
run: xcodebuild test -scheme UID2Tests -sdk appletvsimulator16.1 -destination "OS=16.1,name=Apple TV"

- name: Lint pod spec
run: pod lib lint --verbose
1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ let package = Package(
name: "UID2",
dependencies: [],
resources: [
.copy("Properties/sdk_properties.plist"),
.copy("PrivacyInfo.xcprivacy")
]),
.testTarget(
Expand Down
1 change: 0 additions & 1 deletion [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ let package = Package(
name: "UID2",
dependencies: [],
resources: [
.copy("Properties/sdk_properties.plist"),
.copy("PrivacyInfo.xcprivacy")
],
swiftSettings: [
Expand Down
6 changes: 3 additions & 3 deletions RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ 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.

23 changes: 2 additions & 21 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 class 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
(0, 3, 0)
}

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

This file was deleted.

13 changes: 4 additions & 9 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,11 +72,10 @@ 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"
}

// SDK Supplied Properties
sdkVersion = UID2SDKProperties.getUID2SDKVersion()
let clientVersion = "\(sdkVersion.major).\(sdkVersion.minor).\(sdkVersion.patch)"

let isLoggingEnabled = UID2Settings.shared.isLoggingEnabled
self.log = isLoggingEnabled
? .init(subsystem: "com.uid2", category: "UID2Manager")
Expand Down
29 changes: 29 additions & 0 deletions UID2.podspec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "UID2",
"summary": "A framework for integrating UID2 into iOS applications.",
"homepage": "https://unifiedid.com/",
"license": "Apache License, Version 2.0",
"version": "0.3.0",
"authors": {
"David Snabel-Caunt": "[email protected]"
},
"source": {
"git": "https://github.com/IABTechLab/uid2-ios-sdk.git",
"tag": "v0.3.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/**/*"
]
}