diff --git a/.github/actions/prepare-simulator/action.yml b/.github/actions/prepare-simulator/action.yml index b893ab38..6a98684b 100644 --- a/.github/actions/prepare-simulator/action.yml +++ b/.github/actions/prepare-simulator/action.yml @@ -14,19 +14,6 @@ outputs: runs: using: composite steps: - - name: "Print bundled runtimes" - shell: bash - run: | - echo "::group::Bundled runtimes:" - for xcode in /Applications/Xcode*.app; do \ - echo $xcode | grep -o "Xcode.*\.app"; \ - for plist in $xcode/Contents/Developer/Platforms/*.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/*.simruntime/Contents/Info.plist; do \ - defaults read $plist CFBundleName; \ - done; \ - echo ""; \ - done - echo "::endgroup::" - - name: "Install runtime" shell: bash run: | @@ -36,9 +23,9 @@ runs: echo "$RUNTIME is already installed."; else echo "::group::Available runtimes:" - xcversion simulators + xcodes runtimes echo "::endgroup::" - xcversion simulators --install="$RUNTIME"; + sudo xcodes runtimes install "$RUNTIME" --keep-archive; fi - name: "Create and boot simulator" @@ -47,8 +34,8 @@ runs: run: | RUNTIME="${{ inputs.runtime }}" DEVICE="${{ inputs.device }}" - DEVICE_ID=com.apple.CoreSimulator.SimDeviceType.$(echo $DEVICE | sed -E -e "s/[ \-]+/ /g" -e "s/[^[:alnum:]]/-/g") - RUNTIME_ID=com.apple.CoreSimulator.SimRuntime.$(echo $RUNTIME | sed -E -e "s/[ \-]+/ /g" -e "s/[^[:alnum:]]/-/g") + DEVICE_ID=com.apple.CoreSimulator.SimDeviceType.$(echo $DEVICE | sed -E -e "s/[ \-]+/ /g" -e "s/[\(\)]//g" -e "s/[^[:alnum:]]/-/g") + RUNTIME_ID=com.apple.CoreSimulator.SimRuntime.$(echo $RUNTIME | sed -E -e "s/[ \-]+/ /g" -e "s/[\(\)]//g" -e "s/[^[:alnum:]]/-/g") DESTINATION_ID=$(xcrun simctl create "Custom: $DEVICE, $RUNTIME" $DEVICE_ID $RUNTIME_ID) xcrun simctl boot $DESTINATION_ID echo "destination-id=$(echo $DESTINATION_ID)" >> $GITHUB_OUTPUT diff --git a/.github/workflows/carthage.yml b/.github/workflows/carthage.yml index 5352e80a..fbb4364a 100644 --- a/.github/workflows/carthage.yml +++ b/.github/workflows/carthage.yml @@ -5,13 +5,13 @@ on: [push] jobs: carthage: name: "Xcode ${{ matrix.env.xcode }}" - runs-on: macOS-12 + runs-on: macOS-14 strategy: matrix: env: - - xcode: 13.4 + - xcode: 15.4 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: "Upgrade Carthage" diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index 6d84be02..abf3afac 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -5,13 +5,13 @@ on: [push] jobs: spm: name: "Xcode ${{ matrix.env.xcode }}" - runs-on: macOS-12 + runs-on: macOS-14 strategy: matrix: env: - - xcode: 13.4 + - xcode: 15.4 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: "Select Xcode ${{ matrix.env.xcode }}" uses: ./.github/actions/xcode-select with: diff --git a/.github/workflows/xcode.yml b/.github/workflows/xcode.yml index 6b02da66..4ae6fd81 100644 --- a/.github/workflows/xcode.yml +++ b/.github/workflows/xcode.yml @@ -5,21 +5,21 @@ on: [push] jobs: ios: name: "Xcode ${{ matrix.env.xcode }}, ${{ matrix.env.runtime }}, ${{ matrix.env.device }}" - runs-on: macOS-12 + runs-on: macOS-14 strategy: matrix: env: - - xcode: 13.4 + - xcode: 15.4 + runtime: "iOS 17.5" + device: "iPhone 15 Pro Max" + - xcode: 15.4 + runtime: "iOS 16.4" + device: "iPhone 12 mini" + - xcode: 15.4 runtime: "iOS 15.5" - device: "iPhone 13 Pro" - - xcode: 13.4 - runtime: "iOS 14.5" - device: "iPhone 12 Pro Max" - - xcode: 13.4 - runtime: "iOS 13.7" - device: "iPhone 11" + device: "iPhone SE" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: "Select Xcode ${{ matrix.env.xcode }}" @@ -27,9 +27,9 @@ jobs: with: version: ${{ matrix.env.xcode }} - name: "Cache downloaded simulator runtimes" - uses: actions/cache@v3 + uses: actions/cache@v4 with: - path: ~/Library/Caches/XcodeInstall/*.dmg + path: ~/Downloads/*.dmg key: Xcode ${{ matrix.env.xcode }}+${{ matrix.env.runtime }} - name: "Prepare simulator" id: prepare-simulator @@ -40,31 +40,32 @@ jobs: - name: "Build and test" run: | set -o pipefail - xcodebuild test -workspace "OneTimePassword.xcworkspace" -scheme "OneTimePassword (iOS)" -destination "id=${{ steps.prepare-simulator.outputs.destination-id }}" | xcpretty -c - - uses: sersoft-gmbh/swift-coverage-action@v3 + xcodebuild test -project "OneTimePassword.xcodeproj" -scheme "OneTimePassword (iOS)" -destination "id=${{ steps.prepare-simulator.outputs.destination-id }}" | xcpretty -c + - uses: sersoft-gmbh/swift-coverage-action@v4 with: target-name-filter: ^OneTimePassword$ - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v4 with: + token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true watchos: name: "Xcode ${{ matrix.env.xcode }}, ${{ matrix.env.runtime }}, ${{ matrix.env.device }}" - runs-on: macOS-12 + runs-on: macOS-14 strategy: matrix: env: - - xcode: 13.4 + - xcode: 15.4 + runtime: "watchOS 10.5" + device: "Apple Watch Ultra 2 (49mm)" + - xcode: 15.4 + runtime: "watchOS 9.4" + device: "Apple Watch SE (44mm) (2nd generation)" + - xcode: 15.4 runtime: "watchOS 8.5" - device: "Apple Watch Series 7 - 45mm" - - xcode: 13.4 - runtime: "watchOS 7.4" - device: "Apple Watch Series 6 - 44mm" - - xcode: 13.4 - runtime: "watchOS 6.2" - device: "Apple Watch Series 4 - 40mm" + device: "Apple Watch Series 3 (38mm)" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: "Select Xcode ${{ matrix.env.xcode }}" @@ -72,9 +73,9 @@ jobs: with: version: ${{ matrix.env.xcode }} - name: "Cache downloaded simulator runtimes" - uses: actions/cache@v3 + uses: actions/cache@v4 with: - path: ~/Library/Caches/XcodeInstall/*.dmg + path: ~/Downloads/*.dmg key: Xcode ${{ matrix.env.xcode }}+${{ matrix.env.runtime }} - name: "Prepare simulator" id: prepare-simulator @@ -85,4 +86,4 @@ jobs: - name: "Build" run: | set -o pipefail - xcodebuild build -workspace "OneTimePassword.xcworkspace" -scheme "OneTimePassword (watchOS)" -destination "id=${{ steps.prepare-simulator.outputs.destination-id }}" | xcpretty -c + xcodebuild build -project "OneTimePassword.xcodeproj" -scheme "OneTimePassword (watchOS)" -destination "id=${{ steps.prepare-simulator.outputs.destination-id }}" | xcpretty -c diff --git a/.gitmodules b/.gitmodules index 1cecbcbf..89a11d97 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "Carthage/Checkouts/Base32"] - path = Carthage/Checkouts/Base32 - url = https://github.com/mattrubin/Base32.git [submodule "Carthage/Checkouts/xcconfigs"] path = Carthage/Checkouts/xcconfigs url = https://github.com/xcconfigs/xcconfigs.git diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c2dd2012..61d9ac8a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,15 +29,16 @@ Please note that this project is released with a [Contributor Code of Conduct][c git submodule update --init --recursive ``` -3. Open the `OneTimePassword.xcworkspace` file. -> If you open the `.xcodeproj` instead, the project will not be able to find its dependencies. +3. Open the `OneTimePassword.xcodeproj` file. 4. Build and run the "OneTimePassword" scheme. ## Managing Dependencies -OneTimePassword uses [Carthage][] to manage its dependencies, but it does not currently use Carthage to build those dependencies. The dependent projects are checked out as submodules, are included in `OneTimePassword.xcworkspace`, and are built by Xcode as target dependencies of the OneTimePassword framework. +OneTimePassword's source dependencies are [Xcode-managed package dependencies][package dependencies]. + +Additionally, [Carthage][] is used to manage the project's dependency on shared build configuration files. The dependent project is checked out as a submodule. To check out the dependencies, simply follow the "Getting Started" instructions above. @@ -46,5 +47,6 @@ To update the dependencies, modify the [Cartfile][] and run: carthage update --no-build --use-submodules ``` +[package dependencies]: https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app [Carthage]: https://github.com/Carthage/Carthage [Cartfile]: https://github.com/mattrubin/OneTimePassword/blob/develop/Cartfile diff --git a/Cartfile b/Cartfile deleted file mode 100644 index 0b63f00f..00000000 --- a/Cartfile +++ /dev/null @@ -1,3 +0,0 @@ -# Configuration for Carthage (https://github.com/Carthage/Carthage) - -github "mattrubin/Base32" ~> 1.2 diff --git a/Cartfile.resolved b/Cartfile.resolved index 189a83fe..f070ff6e 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1 @@ -github "mattrubin/Base32" "1.2.0" github "xcconfigs/xcconfigs" "1.1" diff --git a/Carthage/Checkouts/Base32 b/Carthage/Checkouts/Base32 deleted file mode 160000 index 6389546e..00000000 --- a/Carthage/Checkouts/Base32 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6389546e8e9a34a9d9db452726900383f3e4ac57 diff --git a/Configuration/OneTimePassword.xcconfig b/Configuration/OneTimePassword.xcconfig index f3abd7d7..1f0162dc 100644 --- a/Configuration/OneTimePassword.xcconfig +++ b/Configuration/OneTimePassword.xcconfig @@ -4,3 +4,4 @@ INFOPLIST_FILE = Sources/Info.plist; DEAD_CODE_STRIPPING = YES; SWIFT_INSTALL_OBJC_HEADER = NO; +DEFINES_MODULE = NO; diff --git a/OneTimePassword.xcodeproj/project.pbxproj b/OneTimePassword.xcodeproj/project.pbxproj index 7152e453..f843407c 100644 --- a/OneTimePassword.xcodeproj/project.pbxproj +++ b/OneTimePassword.xcodeproj/project.pbxproj @@ -26,15 +26,15 @@ 5B39F49F1DBD06F500CD2DAB /* Token+URL.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9DC7EC3196BD5DF00B50C82 /* Token+URL.swift */; }; 5B39F4A01DBD06F900CD2DAB /* PersistentToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = C95F9FB81C03D6BC00CEA286 /* PersistentToken.swift */; }; 5B39F4A11DBD06FC00CD2DAB /* Keychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9003417196F7046009733E8 /* Keychain.swift */; }; - 5B39F4A51DBD08A900CD2DAB /* Base32.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C944A55E1A7EDAE200E08B1E /* Base32.framework */; }; C9003418196F7046009733E8 /* Keychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9003417196F7046009733E8 /* Keychain.swift */; }; C9290C301947D104008AE4DE /* TokenSerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9290C2F1947D104008AE4DE /* TokenSerializationTests.swift */; }; C93A251A196B1BA400F86892 /* Token.swift in Sources */ = {isa = PBXBuildFile; fileRef = C93A2519196B1BA400F86892 /* Token.swift */; }; - C944A55F1A7EDAE200E08B1E /* Base32.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C944A55E1A7EDAE200E08B1E /* Base32.framework */; }; C94B2007197774A20014A202 /* TokenTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C94B2006197774A20014A202 /* TokenTests.swift */; }; C95B10CC196D22B9000840AA /* GeneratorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C95B10CB196D22B9000840AA /* GeneratorTests.swift */; }; C95F9FB91C03D6BC00CEA286 /* PersistentToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = C95F9FB81C03D6BC00CEA286 /* PersistentToken.swift */; }; C97C82441946E51D00FD9F4C /* OneTimePassword.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C97C82381946E51D00FD9F4C /* OneTimePassword.framework */; }; + C99262CC29558ABA00C96BDF /* Base32 in Frameworks */ = {isa = PBXBuildFile; productRef = C99262CB29558ABA00C96BDF /* Base32 */; }; + C99262CE29558AE600C96BDF /* Base32 in Frameworks */ = {isa = PBXBuildFile; productRef = C99262CD29558AE600C96BDF /* Base32 */; }; C9B2A19C199A7F1B00BC4A8A /* EquatableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9B2A19B199A7F1B00BC4A8A /* EquatableTests.swift */; }; C9B77D771C03078B00BAF6BF /* KeychainTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C93A2514196AFE1100F86892 /* KeychainTests.swift */; }; C9DC7EC4196BD5DF00B50C82 /* Token+URL.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9DC7EC3196BD5DF00B50C82 /* Token+URL.swift */; }; @@ -94,7 +94,6 @@ C93CC01C1DCBB875006255FA /* OneTimePasswordTests-iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "OneTimePasswordTests-iOS.xcconfig"; sourceTree = ""; }; C93CC01E1DCBBDE7006255FA /* OneTimePassword.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = OneTimePassword.xcconfig; sourceTree = ""; }; C93CC0211DCBC189006255FA /* OneTimePasswordTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = OneTimePasswordTests.xcconfig; sourceTree = ""; }; - C944A55E1A7EDAE200E08B1E /* Base32.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Base32.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C94765061C64587800C7527E /* Cartfile.private */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile.private; sourceTree = ""; }; C94B2006197774A20014A202 /* TokenTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenTests.swift; sourceTree = ""; }; C94B9BC81BD7270E0073D7C5 /* LICENSE.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = LICENSE.md; sourceTree = ""; }; @@ -114,7 +113,6 @@ C9B2A19B199A7F1B00BC4A8A /* EquatableTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EquatableTests.swift; sourceTree = ""; }; C9B84D1C1C015EC0002EE631 /* .hound.yml */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = text; path = .hound.yml; sourceTree = ""; }; C9B84D1D1C015EC0002EE631 /* .swiftlint.yml */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = text; path = .swiftlint.yml; sourceTree = ""; }; - C9B84D1F1C015EC8002EE631 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; C9DC7EC3196BD5DF00B50C82 /* Token+URL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Token+URL.swift"; sourceTree = ""; }; C9DC7EC7196BDF3B00B50C82 /* Generator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Generator.swift; sourceTree = ""; }; C9E829531C62DFDA003F5FC9 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = ""; }; @@ -132,7 +130,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 5B39F4A51DBD08A900CD2DAB /* Base32.framework in Frameworks */, + C99262CE29558AE600C96BDF /* Base32 in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -140,7 +138,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C944A55F1A7EDAE200E08B1E /* Base32.framework in Frameworks */, + C99262CC29558ABA00C96BDF /* Base32 in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -155,14 +153,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 746E7166AD60449882DD84C7 /* Frameworks */ = { - isa = PBXGroup; - children = ( - C944A55E1A7EDAE200E08B1E /* Base32.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; C9307A8619A8522F00609B02 /* Serialization */ = { isa = PBXGroup; children = ( @@ -202,7 +192,6 @@ children = ( C97C823A1946E51D00FD9F4C /* Sources */, C97C82471946E51D00FD9F4C /* Tests */, - 746E7166AD60449882DD84C7 /* Frameworks */, C996EC281A74D5830076B105 /* Configuration */, C97C82391946E51D00FD9F4C /* Products */, C9B84D1B1C015EA2002EE631 /* Tools */, @@ -299,7 +288,6 @@ isa = PBXGroup; children = ( 49403AEA23D3778400539BD3 /* Package.swift */, - C9B84D1F1C015EC8002EE631 /* Cartfile */, C94765061C64587800C7527E /* Cartfile.private */, C9619C5C1D73FB3500757587 /* .codecov.yml */, C9B84D1C1C015EC0002EE631 /* .hound.yml */, @@ -334,6 +322,9 @@ dependencies = ( ); name = "OneTimePassword (watchOS)"; + packageProductDependencies = ( + C99262CD29558AE600C96BDF /* Base32 */, + ); productName = "OneTimePassword (watchOS)"; productReference = 5B39F4941DBD06BA00CD2DAB /* OneTimePassword.framework */; productType = "com.apple.product-type.framework"; @@ -350,6 +341,9 @@ dependencies = ( ); name = "OneTimePassword (iOS)"; + packageProductDependencies = ( + C99262CB29558ABA00C96BDF /* Base32 */, + ); productName = "OneTimePassword (iOS)"; productReference = C97C82381946E51D00FD9F4C /* OneTimePassword.framework */; productType = "com.apple.product-type.framework"; @@ -436,6 +430,9 @@ Base, ); mainGroup = C97C822E1946E51D00FD9F4C; + packageReferences = ( + C99262CA29558ABA00C96BDF /* XCRemoteSwiftPackageReference "Base32" */, + ); productRefGroup = C97C82391946E51D00FD9F4C /* Products */; projectDirPath = ""; projectRoot = ""; @@ -700,6 +697,30 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + C99262CA29558ABA00C96BDF /* XCRemoteSwiftPackageReference "Base32" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/mattrubin/Base32.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.2.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + C99262CB29558ABA00C96BDF /* Base32 */ = { + isa = XCSwiftPackageProductDependency; + package = C99262CA29558ABA00C96BDF /* XCRemoteSwiftPackageReference "Base32" */; + productName = Base32; + }; + C99262CD29558AE600C96BDF /* Base32 */ = { + isa = XCSwiftPackageProductDependency; + package = C99262CA29558ABA00C96BDF /* XCRemoteSwiftPackageReference "Base32" */; + productName = Base32; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = C97C822F1946E51D00FD9F4C /* Project object */; } diff --git a/OneTimePassword.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/OneTimePassword.xcodeproj/project.xcworkspace/contents.xcworkspacedata index c935409a..919434a6 100644 --- a/OneTimePassword.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/OneTimePassword.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/OneTimePassword.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/OneTimePassword.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from OneTimePassword.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to OneTimePassword.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/OneTimePassword.xcodeproj/xcshareddata/xcschemes/OneTimePassword (iOS).xcscheme b/OneTimePassword.xcodeproj/xcshareddata/xcschemes/OneTimePassword (iOS).xcscheme index e1512062..7869e53c 100644 --- a/OneTimePassword.xcodeproj/xcshareddata/xcschemes/OneTimePassword (iOS).xcscheme +++ b/OneTimePassword.xcodeproj/xcshareddata/xcschemes/OneTimePassword (iOS).xcscheme @@ -1,6 +1,6 @@ - - - - - - diff --git a/Package.swift b/Package.swift index 71b69eae..aef688a4 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.1 +// swift-tools-version: 5.10 import PackageDescription let package = Package( @@ -14,7 +14,7 @@ let package = Package( targets: ["OneTimePassword"]), ], dependencies: [ - .package(url: "https://github.com/mattrubin/Base32.git", .upToNextMajor(from: "1.2.0")), + .package(url: "https://github.com/mattrubin/Base32.git", from: "1.2.0"), ], targets: [ .target( diff --git a/Sources/PersistentToken.swift b/Sources/PersistentToken.swift index c739aa43..18e1e380 100644 --- a/Sources/PersistentToken.swift +++ b/Sources/PersistentToken.swift @@ -34,12 +34,6 @@ public struct PersistentToken: Equatable, Hashable { /// The keychain's persistent identifier for the saved token. public let identifier: Data - /// Initializes a new `PersistentToken` with the given properties. - internal init(token: Token, identifier: Data) { - self.token = token - self.identifier = identifier - } - /// Hashes the persistent token's identifier into the given hasher, providing `Hashable` conformance. public func hash(into hasher: inout Hasher) { // Since we expect every `PersistentToken`s identifier to be unique, the identifier's hash diff --git a/Tests/EquatableTests.swift b/Tests/EquatableTests.swift index c99db3f1..49e9f5a7 100644 --- a/Tests/EquatableTests.swift +++ b/Tests/EquatableTests.swift @@ -56,7 +56,7 @@ class EquatableTests: XCTestCase { func testGeneratorEquality() throws { let generator = try Generator(factor: .counter(0), secret: Data(), algorithm: .sha1, digits: 6) - let badData = "0".data(using: String.Encoding.utf8)! + let badData = Data("0".utf8) XCTAssert(try generator == Generator(factor: .counter(0), secret: Data(), algorithm: .sha1, digits: 6)) XCTAssert(try generator != Generator(factor: .counter(1), secret: Data(), algorithm: .sha1, digits: 6)) diff --git a/Tests/KeychainTests.swift b/Tests/KeychainTests.swift index 080202b4..0059407d 100644 --- a/Tests/KeychainTests.swift +++ b/Tests/KeychainTests.swift @@ -257,7 +257,7 @@ class KeychainTests: XCTestCase { } func testBadData() throws { - let badData = " ".data(using: .utf8)! + let badData = Data(" ".utf8) let keychainAttributes: [String: AnyObject] = [ kSecAttrGeneric as String: badData as NSData, @@ -275,7 +275,7 @@ class KeychainTests: XCTestCase { } func testBadURL() throws { - let badData = "http://example.com".data(using: .utf8)! + let badData = Data("http://example.com".utf8) let keychainAttributes: [String: AnyObject] = [ kSecAttrGeneric as String: badData as NSData,