Skip to content

Commit

Permalink
refactor: drop support for Swift 5.2 (#356)
Browse files Browse the repository at this point in the history
* refactor: drop support for Swift 5.2

* remove Xcode 11 from CI

* build ealiest supported in CI

* fix name

* set verifyPassword usingPost default to false

* update ci

* move carthage script to scripts folder

* Bump version
  • Loading branch information
cbaker6 authored Apr 17, 2022
1 parent 2cb662a commit c57fc2e
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 34 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
branches: '*'
env:
CI_XCODE_VER: '/Applications/Xcode_11.7.app/Contents/Developer'
CI_XCODE_VER: '/Applications/Xcode_12.5.1.app/Contents/Developer'
CI_XCODE_13: '/Applications/Xcode_13.3.app/Contents/Developer'

jobs:
Expand Down Expand Up @@ -165,11 +165,11 @@ jobs:
uses: codecov/codecov-action@v2
with:
files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}
env_vars: IOS5_2
env_vars: IOS_Earliest
fail_ci_if_error: true
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_VER }}

linux:
runs-on: ubuntu-18.04
steps:
Expand Down Expand Up @@ -239,6 +239,6 @@ jobs:
- name: Use multiple cores
run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
- name: Carthage
run: ./carthage.sh build --no-skip-current --use-xcframeworks
run: ./Scripts/carthage.sh build --no-skip-current --use-xcframeworks
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
release:
types: [published]
env:
CI_XCODE_VER: '/Applications/Xcode_11.7.app/Contents/Developer'
CI_XCODE_13: '/Applications/Xcode_13.3.app/Contents/Developer'

jobs:
Expand Down
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ excluded: # paths to ignore during linting. Takes precedence over `included`.
- Tests/ParseSwiftTests/ParseEncoderTests
- DerivedData
- .build
- .dependencies
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

### main

[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.3.1...main)
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.4.0...main)
* _Contributing to this repo? Add info about your change here to be included in the next release_

### 4.4.0
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.3.1...4.4.0)

__Improvements__
- Drop support for Swift 5.2 as App Store requires apps to be built in Xcode 12 ([#356](https://github.com/parse-community/Parse-Swift/pull/356)), thanks to [Corey Baker](https://github.com/cbaker6).

### 4.3.1
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.3.0...4.3.1)

Expand All @@ -15,7 +21,7 @@ __Fixes__
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.2.0...4.3.0)

__Improvements__
- Use DocC for documentation instead of jazzy. Improved documentation. ([#350](https://github.com/parse-community/Parse-Swift/pull/350)), thanks to [Corey Baker](https://github.com/cbaker6).
- Use DocC for documentation instead of jazzy. Improved documentation ([#350](https://github.com/parse-community/Parse-Swift/pull/350)), thanks to [Corey Baker](https://github.com/cbaker6).

### 4.2.0
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.1.0...4.2.0)
Expand Down
4 changes: 2 additions & 2 deletions ParseSwift.podtemplate
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Pod::Spec.new do |s|
s.osx.deployment_target = "10.15"
s.tvos.deployment_target = "13.0"
s.watchos.deployment_target = "6.0"
s.swift_versions = ['5.1', '5.2', '5.3', '5.4', '5.5']
s.swift_versions = ['5.3', '5.4', '5.5', '5.6']
s.source_files = "Sources/ParseSwift/**/*.swift"
s.license = {
:type => "MIT",
:text => <<-LICENSE
Copyright (c) 2021 parse-community
Copyright (c) 2022 parse-community
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@Tutorial(time: 15) {
@Tutorial(time: 1) {
@Intro(title: "Your First Object") {

}
Expand Down
11 changes: 0 additions & 11 deletions Sources/ParseSwift/Extensions/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ internal extension Data {

func hexEncodedString(options: HexEncodingOptions = []) -> String {
let hexDigits = options.contains(.upperCase) ? "0123456789ABCDEF" : "0123456789abcdef"
#if swift(>=5.3)
if #available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
let utf8Digits = Array(hexDigits.utf8)
return String(unsafeUninitializedCapacity: 2 * count) { (ptr) -> Int in
Expand All @@ -39,15 +38,5 @@ internal extension Data {
}
return String(utf16CodeUnits: chars, count: chars.count)
}
#else
let utf16Digits = Array(hexDigits.utf16)
var chars: [unichar] = []
chars.reserveCapacity(2 * count)
for byte in self {
chars.append(utf16Digits[Int(byte / 16)])
chars.append(utf16Digits[Int(byte % 16)])
}
return String(utf16CodeUnits: chars, count: chars.count)
#endif
}
}
9 changes: 5 additions & 4 deletions Sources/ParseSwift/Objects/ParseUser+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,17 @@ public extension ParseUser {
- parameter password: The password to be verified.
- parameter usingPost: Set to **true** to use **POST** for sending. Will use **GET**
otherwise. Defaults to **true**.
otherwise. Defaults to **false**.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- throws: An error of type `ParseError`.
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
desires a different policy, it should be inserted in `options`.
- warning: `usingPost == true` requires Parse Server > 5.0.0. Othewise you should set
`usingPost = false`.
- warning: `usingPost == true` requires the
[issue](https://github.com/parse-community/parse-server/issues/7784) to be addressed on
the Parse Server, othewise you should set `usingPost = false`.
*/
static func verifyPassword(password: String,
usingPost: Bool = true,
usingPost: Bool = false,
options: API.Options = []) async throws -> Self {
try await withCheckedThrowingContinuation { continuation in
Self.verifyPassword(password: password,
Expand Down
9 changes: 5 additions & 4 deletions Sources/ParseSwift/Objects/ParseUser+combine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,17 @@ public extension ParseUser {
Publishes when complete.
- parameter password: The password to be verified.
- parameter usingPost: Set to **true** to use **POST** for sending. Will use **GET**
otherwise. Defaults to **true**.
otherwise. Defaults to **false**.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- returns: A publisher that eventually produces a single value and then finishes or fails.
- warning: `usingPost == true` requires Parse Server > 5.0.0. Othewise you should set
`usingPost = false`.
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
desires a different policy, it should be inserted in `options`.
- warning: `usingPost == true` requires the
[issue](https://github.com/parse-community/parse-server/issues/7784) to be addressed on
the Parse Server, othewise you should set `usingPost = false`.
*/
static func verifyPasswordPublisher(password: String,
usingPost: Bool = true,
usingPost: Bool = false,
options: API.Options = []) -> Future<Self, ParseError> {
Future { promise in
Self.verifyPassword(password: password,
Expand Down
9 changes: 5 additions & 4 deletions Sources/ParseSwift/Objects/ParseUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -478,17 +478,18 @@ extension ParseUser {
Verifies *asynchronously* whether the specified password associated with the user account is valid.
- parameter password: The password to be verified.
- parameter usingPost: Set to **true** to use **POST** for sending. Will use **GET**
otherwise. Defaults to **true**.
otherwise. Defaults to **false**.
- parameter options: A set of header options sent to the server. Defaults to an empty set.
- parameter callbackQueue: The queue to return to after completion. Default value of .main.
- parameter completion: A block that will be called when the verification request completes or fails.
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
desires a different policy, it should be inserted in `options`.
- warning: `usingPost == true` requires Parse Server > 5.0.0. Othewise you should set
`usingPost = false`.
- warning: `usingPost == true` requires the
[issue](https://github.com/parse-community/parse-server/issues/7784) to be addressed on
the Parse Server, othewise you should set `usingPost = false`.
*/
public static func verifyPassword(password: String,
usingPost: Bool = true,
usingPost: Bool = false,
options: API.Options = [],
callbackQueue: DispatchQueue = .main,
completion: @escaping (Result<Self, ParseError>) -> Void) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/ParseConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation

enum ParseConstants {
static let sdk = "swift"
static let version = "4.3.1"
static let version = "4.4.0"
static let fileManagementDirectory = "parse/"
static let fileManagementPrivateDocumentsDirectory = "Private Documents/"
static let fileManagementLibraryDirectory = "Library/"
Expand Down

0 comments on commit c57fc2e

Please sign in to comment.