diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index b8f3068..676be1d 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -11,7 +11,7 @@ jobs: swift-code-checks: name: Code Tests - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v4 @@ -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 diff --git a/Package.swift b/Package.swift index f96709e..57162d8 100644 --- a/Package.swift +++ b/Package.swift @@ -22,7 +22,6 @@ let package = Package( name: "UID2", dependencies: [], resources: [ - .copy("Properties/sdk_properties.plist"), .copy("PrivacyInfo.xcprivacy") ]), .testTarget( diff --git a/Package@swift-5.8.swift b/Package@swift-5.8.swift index cb4f0d6..af95c90 100644 --- a/Package@swift-5.8.swift +++ b/Package@swift-5.8.swift @@ -21,7 +21,6 @@ let package = Package( name: "UID2", dependencies: [], resources: [ - .copy("Properties/sdk_properties.plist"), .copy("PrivacyInfo.xcprivacy") ], swiftSettings: [ diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index b85f54c..0209392 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -11,8 +11,8 @@ 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 @@ -20,6 +20,6 @@ Version Numbering follows [Semantic Versioning](https://semver.org) standards. * 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** diff --git a/Sources/UID2/Properties/SDKProperties.swift b/Sources/UID2/Properties/SDKProperties.swift deleted file mode 100644 index 46babc0..0000000 --- a/Sources/UID2/Properties/SDKProperties.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// SDKProperties.swift -// -// -// Created by Brad Leege on 3/15/23. -// - -import Foundation - -struct SDKProperties: Codable { - - let uid2Version: String? - - enum CodingKeys: String, CodingKey { - case uid2Version = "UID2Version" - } - -} diff --git a/Sources/UID2/Properties/SDKPropertyLoader.swift b/Sources/UID2/Properties/SDKPropertyLoader.swift deleted file mode 100644 index 1c30afa..0000000 --- a/Sources/UID2/Properties/SDKPropertyLoader.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// SDKPropertyLoader.swift -// -// -// Created by Brad Leege on 3/15/23. -// - -import Foundation - -class SDKPropertyLoader { - - static func load() -> SDKProperties { - - guard let plistURL = Bundle.module.url(forResource: "sdk_properties", withExtension: "plist") else { - return SDKProperties(uid2Version: nil) - } - - let decoder = PropertyListDecoder() - - guard let data = try? Data.init(contentsOf: plistURL), - let preferences = try? decoder.decode(SDKProperties.self, from: data) else { - return SDKProperties(uid2Version: nil) - } - - return preferences - - } - -} diff --git a/Sources/UID2/Properties/UID2SDKProperties.swift b/Sources/UID2/Properties/UID2SDKProperties.swift index 6b7342f..ba997d4 100644 --- a/Sources/UID2/Properties/UID2SDKProperties.swift +++ b/Sources/UID2/Properties/UID2SDKProperties.swift @@ -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) } - + } diff --git a/Sources/UID2/Properties/sdk_properties.plist b/Sources/UID2/Properties/sdk_properties.plist deleted file mode 100644 index 03d92bc..0000000 --- a/Sources/UID2/Properties/sdk_properties.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - UID2Version - 0.3.0 - - diff --git a/Sources/UID2/UID2Manager.swift b/Sources/UID2/UID2Manager.swift index 4a750f1..0f59419 100644 --- a/Sources/UID2/UID2Manager.swift +++ b/Sources/UID2/UID2Manager.swift @@ -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, @@ -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") diff --git a/UID2.podspec.json b/UID2.podspec.json new file mode 100644 index 0000000..4c41aa8 --- /dev/null +++ b/UID2.podspec.json @@ -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": "dave.snabel-caunt@thetradedesk.com" + }, + "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/**/*" + ] +}