From 6af8eccd6daf8d008cd209027662dccc5f9b2930 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Tue, 22 Mar 2022 10:19:56 -0400 Subject: [PATCH 01/17] docs: improve docs with respect to parse-server 5.0.0 release --- Sources/ParseSwift/Objects/ParseUser+async.swift | 4 ++-- Sources/ParseSwift/Objects/ParseUser+combine.swift | 4 ++-- Sources/ParseSwift/Objects/ParseUser.swift | 4 ++-- Sources/ParseSwift/Types/QueryConstraint.swift | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/ParseSwift/Objects/ParseUser+async.swift b/Sources/ParseSwift/Objects/ParseUser+async.swift index 9b99817fa..4360b51a1 100644 --- a/Sources/ParseSwift/Objects/ParseUser+async.swift +++ b/Sources/ParseSwift/Objects/ParseUser+async.swift @@ -148,8 +148,8 @@ public extension ParseUser { - 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: `usePost == true` requires Parse Server > 5.0.0. Othewise you should set - `userPost = false`. + - warning: `usingPost == true` requires Parse Server > 5.0.0. Othewise you should set + `usingPost = false`. */ static func verifyPassword(password: String, usingPost: Bool = true, diff --git a/Sources/ParseSwift/Objects/ParseUser+combine.swift b/Sources/ParseSwift/Objects/ParseUser+combine.swift index 0238e8e2c..278a9b984 100644 --- a/Sources/ParseSwift/Objects/ParseUser+combine.swift +++ b/Sources/ParseSwift/Objects/ParseUser+combine.swift @@ -137,8 +137,8 @@ public extension ParseUser { otherwise. Defaults to **true**. - 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: `usePost == true` requires Parse Server > 5.0.0. Othewise you should set - `userPost = false`. + - 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`. */ diff --git a/Sources/ParseSwift/Objects/ParseUser.swift b/Sources/ParseSwift/Objects/ParseUser.swift index 8e0629bf7..be9c648cf 100644 --- a/Sources/ParseSwift/Objects/ParseUser.swift +++ b/Sources/ParseSwift/Objects/ParseUser.swift @@ -484,8 +484,8 @@ extension ParseUser { - 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: `usePost == true` requires Parse Server > 5.0.0. Othewise you should set - `userPost = false`. + - warning: `usingPost == true` requires Parse Server > 5.0.0. Othewise you should set + `usingPost = false`. */ public static func verifyPassword(password: String, usingPost: Bool = true, diff --git a/Sources/ParseSwift/Types/QueryConstraint.swift b/Sources/ParseSwift/Types/QueryConstraint.swift index 147a3c21f..d7351bcc9 100644 --- a/Sources/ParseSwift/Types/QueryConstraint.swift +++ b/Sources/ParseSwift/Types/QueryConstraint.swift @@ -451,7 +451,7 @@ public func containedBy (key: String, array: [T]) throws -> QueryConstraint w - parameter constraint: The key to be constrained. Should be a Date field. The value is a reference time, e.g. "12 days ago". Currently only comparators supported are: <, <=, >, and >=. - returns: The same instance of `QueryConstraint` as the receiver. - - warning: Requires Parse Server 2.6.5+ for MongoDB and Parse Server 5.0.0+ for PostgreSQL. + - warning: Requires Parse Server 2.6.5+ for MongoDB and Parse Server 5.1.0+ for PostgreSQL. */ public func relative(_ constraint: QueryConstraint) -> QueryConstraint { QueryConstraint(key: constraint.key, From e9edf8adcf88d8b82021537f851d0121b8543130 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Tue, 29 Mar 2022 10:03:24 -0400 Subject: [PATCH 02/17] playground nits --- .../Contents.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ParseSwift.playground/Pages/12 - Roles and Relations.xcplaygroundpage/Contents.swift b/ParseSwift.playground/Pages/12 - Roles and Relations.xcplaygroundpage/Contents.swift index a5b994fcf..6402b7d0f 100644 --- a/ParseSwift.playground/Pages/12 - Roles and Relations.xcplaygroundpage/Contents.swift +++ b/ParseSwift.playground/Pages/12 - Roles and Relations.xcplaygroundpage/Contents.swift @@ -173,7 +173,7 @@ do { """) case .failure(let error): - print("Error saving role: \(error)") + print("Error querying role: \(error)") } } } catch { @@ -256,7 +256,7 @@ do { """) case .failure(let error): - print("Error saving role: \(error)") + print("Error querying role: \(error)") } } } catch { @@ -325,7 +325,7 @@ do { case .success(let scores): print("Found related scores: \(scores)") case .failure(let error): - print("Error finding scores: \(error)") + print("Error querying scores: \(error)") } } } catch { @@ -339,7 +339,7 @@ do { case .success(let scores): print("Found related scores from child: \(scores)") case .failure(let error): - print("Error finding scores from child: \(error)") + print("Error querying scores from child: \(error)") } } } catch { @@ -365,7 +365,7 @@ do { case .success(let scores): print("Found related scores from stored ParseRelation: \(scores)") case .failure(let error): - print("Error finding scores from stored ParseRelation: \(error)") + print("Error querying scores from stored ParseRelation: \(error)") } } } catch { From da57aa4f68ff6626e3085ea41d0c26f10ad875e8 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Tue, 29 Mar 2022 10:14:26 -0400 Subject: [PATCH 03/17] update ci to Xcode 13.3 --- .github/workflows/ci.yml | 18 +++++++++--------- .github/workflows/release.yml | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 834187ddc..93c922252 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,11 +6,11 @@ on: branches: '*' env: CI_XCODE_VER: '/Applications/Xcode_11.7.app/Contents/Developer' - CI_XCODE_13: '/Applications/Xcode_13.2.1.app/Contents/Developer' + CI_XCODE_13: '/Applications/Xcode_13.3.app/Contents/Developer' jobs: xcode-test-ios: - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v2 #- name: Use multiple cores @@ -37,7 +37,7 @@ jobs: DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} xcode-test-macos: - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v2 - name: Create and set the default keychain @@ -70,7 +70,7 @@ jobs: DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} xcode-test-tvos: - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v2 #- name: Use multiple cores @@ -97,7 +97,7 @@ jobs: DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} xcode-build-watchos: - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v2 #- name: Use multiple cores @@ -114,7 +114,7 @@ jobs: DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} spm-test: - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v2 - name: Create and set the default keychain @@ -205,7 +205,7 @@ jobs: docs: needs: xcode-build-watchos - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v2 #- name: Build @@ -230,7 +230,7 @@ jobs: cocoapods: needs: xcode-build-watchos - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v2 - name: Update Framework Version @@ -244,7 +244,7 @@ jobs: carthage: needs: xcode-build-watchos - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v2 - name: Carthage diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 297aa2f0a..ac7ddffb6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,11 +4,11 @@ on: types: [published] env: CI_XCODE_VER: '/Applications/Xcode_11.7.app/Contents/Developer' - CI_XCODE_13: '/Applications/Xcode_13.2.1.app/Contents/Developer' + CI_XCODE_13: '/Applications/Xcode_13.3.app/Contents/Developer' jobs: cocoapods: - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v2 - name: Get release version @@ -26,7 +26,7 @@ jobs: DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} docs: - runs-on: macos-latest + runs-on: macos-12 steps: - uses: actions/checkout@v2 - name: Cache Gems From 3b2d90fce3f2c4e5d4c56208a028a379d001978b Mon Sep 17 00:00:00 2001 From: Corey Date: Mon, 11 Apr 2022 12:15:03 -0400 Subject: [PATCH 04/17] enable multi-core builds --- .github/workflows/ci.yml | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93c922252..162951a1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,8 @@ jobs: runs-on: macos-12 steps: - uses: actions/checkout@v2 - #- name: Use multiple cores - # run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 + - name: Use multiple cores + run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 - name: Build-Test run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift\ \(iOS\) -destination platform\=iOS\ Simulator,name\=iPhone\ 12\ Pro\ Max -derivedDataPath DerivedData -test-iterations 10 -retry-tests-on-failure clean test | xcpretty env: @@ -46,8 +46,8 @@ jobs: security default-keychain -s temporary security unlock-keychain -p "" temporary security set-keychain-settings -lut 7200 temporary - #- name: Use multiple cores - # run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 + - name: Use multiple cores + run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 - name: Build-Test run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift\ \(macOS\) -destination platform\=macOS -derivedDataPath DerivedData -test-iterations 10 -retry-tests-on-failure clean test | xcpretty env: @@ -73,8 +73,8 @@ jobs: runs-on: macos-12 steps: - uses: actions/checkout@v2 - #- name: Use multiple cores - # run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 + - name: Use multiple cores + run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 - name: Build run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift\ \(tvOS\) -destination platform\=tvOS\ Simulator,name\=Apple\ TV -derivedDataPath DerivedData -test-iterations 10 -retry-tests-on-failure clean test | xcpretty env: @@ -100,8 +100,8 @@ jobs: runs-on: macos-12 steps: - uses: actions/checkout@v2 - #- name: Use multiple cores - # run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 + - name: Use multiple cores + run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 - name: Build run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -target ParseSwift\ \(watchOS\) | xcpretty env: @@ -208,22 +208,10 @@ jobs: runs-on: macos-12 steps: - uses: actions/checkout@v2 - #- name: Build - # run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild docbuild -scheme ParseSwift\ \(macOS\) -derivedDataPath DerivedData | xcpretty - - name: Cache Gems - id: cache-gems - uses: actions/cache@v2 - with: - path: vendor/bundle - key: ${{ runner.os }}-gem-v4-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gem-v4 - - name: Install Bundle - run: | - bundle config path vendor/bundle - bundle install - - name: Create Jazzy Docs - run: ./Scripts/jazzy.sh + - name: Use multiple cores + run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 + - name: Build + run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild docbuild -scheme ParseSwift\ \(macOS\) -derivedDataPath DerivedData | xcpretty env: BUILD_VERSION: '1.8.3' DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} @@ -233,6 +221,8 @@ jobs: runs-on: macos-12 steps: - uses: actions/checkout@v2 + - name: Use multiple cores + run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 - name: Update Framework Version run: ./Scripts/update_build env: @@ -247,6 +237,8 @@ jobs: runs-on: macos-12 steps: - uses: actions/checkout@v2 + - name: Use multiple cores + run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 - name: Carthage run: ./carthage.sh build --no-skip-current --use-xcframeworks env: From 4092223290b171efef8e935f57e8f49d64f91189 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Mon, 11 Apr 2022 13:01:28 -0400 Subject: [PATCH 05/17] use docc for docs --- .github/workflows/ci.yml | 5 +- .github/workflows/release.yml | 31 +++------ Gemfile | 3 - Gemfile.lock | 118 ---------------------------------- Package.resolved | 16 +++++ Package.swift | 3 + 6 files changed, 31 insertions(+), 145 deletions(-) delete mode 100644 Gemfile delete mode 100644 Gemfile.lock create mode 100644 Package.resolved diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 162951a1f..916a06442 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -210,10 +210,11 @@ jobs: - uses: actions/checkout@v2 - name: Use multiple cores run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 + - name: Create folders + run: mkdir ./docs - name: Build - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild docbuild -scheme ParseSwift\ \(macOS\) -derivedDataPath DerivedData | xcpretty + run: set -o pipefail && env NSUnbufferedIO=YES swift package --allow-writing-to-directory ./docs generate-documentation --target ParseSwift --disable-indexing --output-path ./docs --transform-for-static-hosting --hosting-base-path parse-swift env: - BUILD_VERSION: '1.8.3' DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} cocoapods: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac7ddffb6..b3045e277 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,8 +13,8 @@ jobs: - uses: actions/checkout@v2 - name: Get release version run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV -# - name: Use multiple cores -# run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 + - name: Use multiple cores + run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 - name: Update Framework Version run: ./Scripts/update_build env: @@ -29,30 +29,17 @@ jobs: runs-on: macos-12 steps: - uses: actions/checkout@v2 - - name: Cache Gems - id: cache-gems - uses: actions/cache@v2 - with: - path: vendor/bundle - key: ${{ runner.os }}-gem-v4-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gem-v4 - - name: Install Bundle - run: | - bundle config path vendor/bundle - bundle install - name: Get release version run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV - #- name: Build - # run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild docbuild -scheme ParseSwift\ \(macOS\) -derivedDataPath DerivedData | xcpretty - # - name: Use multiple cores - # run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 - - name: Create Jazzy Docs - run: ./Scripts/jazzy.sh + - name: Use multiple cores + run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 + - name: Create folders + run: mkdir ./docs + - name: Build + run: set -o pipefail && env NSUnbufferedIO=YES set -o pipefail && env NSUnbufferedIO=YES swift package --allow-writing-to-directory ./docs generate-documentation --target ParseSwift --disable-indexing --output-path ./docs --transform-for-static-hosting --hosting-base-path parse-swift env: - BUILD_VERSION: ${{ env.TAG }} DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} - - name: Deploy Jazzy Docs + - name: Deploy Docs uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Gemfile b/Gemfile deleted file mode 100644 index a4b88cf3f..000000000 --- a/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://rubygems.org' - -gem 'jazzy', '~> 0.14.1' diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 9f5b73828..000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,118 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.4) - rexml - activesupport (6.1.4.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - algoliasearch (1.27.5) - httpclient (~> 2.8, >= 2.8.3) - json (>= 1.5.1) - atomos (0.1.3) - claide (1.0.3) - cocoapods (1.11.2) - addressable (~> 2.8) - claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.2) - cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.4.0, < 2.0) - cocoapods-plugins (>= 1.0.0, < 2.0) - cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) - cocoapods-try (>= 1.1.0, < 2.0) - colored2 (~> 3.1) - escape (~> 0.0.4) - fourflusher (>= 2.3.0, < 3.0) - gh_inspector (~> 1.0) - molinillo (~> 0.8.0) - nap (~> 1.0) - ruby-macho (>= 1.0, < 3.0) - xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.11.2) - activesupport (>= 5.0, < 7) - addressable (~> 2.8) - algoliasearch (~> 1.0) - concurrent-ruby (~> 1.1) - fuzzy_match (~> 2.0.4) - nap (~> 1.0) - netrc (~> 0.11) - public_suffix (~> 4.0) - typhoeus (~> 1.0) - cocoapods-deintegrate (1.0.5) - cocoapods-downloader (1.5.1) - cocoapods-plugins (1.0.0) - nap - cocoapods-search (1.0.1) - cocoapods-trunk (1.6.0) - nap (>= 0.8, < 2.0) - netrc (~> 0.11) - cocoapods-try (1.2.0) - colored2 (3.1.2) - concurrent-ruby (1.1.9) - escape (0.0.4) - ethon (0.14.0) - ffi (>= 1.15.0) - ffi (1.15.4) - fourflusher (2.3.1) - fuzzy_match (2.0.4) - gh_inspector (1.1.3) - httpclient (2.8.3) - i18n (1.8.10) - concurrent-ruby (~> 1.0) - jazzy (0.14.1) - cocoapods (~> 1.5) - mustache (~> 1.1) - open4 (~> 1.3) - redcarpet (~> 3.4) - rexml (~> 3.2) - rouge (>= 2.0.6, < 4.0) - sassc (~> 2.1) - sqlite3 (~> 1.3) - xcinvoke (~> 0.3.0) - json (2.5.1) - liferaft (0.0.6) - minitest (5.14.4) - molinillo (0.8.0) - mustache (1.1.1) - nanaimo (0.3.0) - nap (1.1.0) - netrc (0.11.0) - open4 (1.3.4) - public_suffix (4.0.6) - redcarpet (3.5.1) - rexml (3.2.5) - rouge (3.26.1) - ruby-macho (2.5.1) - sassc (2.4.0) - ffi (~> 1.9) - sqlite3 (1.4.2) - typhoeus (1.4.0) - ethon (>= 0.9.0) - tzinfo (2.0.4) - concurrent-ruby (~> 1.0) - xcinvoke (0.3.0) - liferaft (~> 0.0.6) - xcodeproj (1.21.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (~> 3.2.4) - zeitwerk (2.4.2) - -PLATFORMS - ruby - universal-darwin-20 - -DEPENDENCIES - jazzy (~> 0.14.1) - -BUNDLED WITH - 2.2.2 diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 000000000..3b6d58b80 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "SwiftDocCPlugin", + "repositoryURL": "https://github.com/apple/swift-docc-plugin", + "state": { + "branch": null, + "revision": "3303b164430d9a7055ba484c8ead67a52f7b74f6", + "version": "1.0.0" + } + } + ] + }, + "version": 1 +} diff --git a/Package.swift b/Package.swift index 318d4464a..4c0e0717e 100644 --- a/Package.swift +++ b/Package.swift @@ -10,6 +10,9 @@ let package = Package( name: "ParseSwift", targets: ["ParseSwift"]) ], + dependencies: [ + .package(url: "https://github.com/apple/swift-docc-plugin", .upToNextMajor(from: "1.0.0")), + ], targets: [ .target( name: "ParseSwift", From df1b00f0e02b9c4745ddd5c140ee8fed4363510e Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Mon, 11 Apr 2022 13:18:17 -0400 Subject: [PATCH 06/17] add change log --- .swiftlint.yml | 1 + CHANGELOG.md | 8 +++++++- Package.swift | 2 +- Sources/ParseSwift/ParseConstants.swift | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 3311dd4ea..eeb9be32c 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -8,3 +8,4 @@ disabled_rules: excluded: # paths to ignore during linting. Takes precedence over `included`. - Tests/ParseSwiftTests/ParseEncoderTests - DerivedData + - .build diff --git a/CHANGELOG.md b/CHANGELOG.md index bdf2ef89f..0c40ad584 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,15 @@ ### main -[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.2.0...main) +[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.2.1...main) * _Contributing to this repo? Add info about your change here to be included in the next release_ +### 4.2.1 +[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.2.0...4.2.1) + +__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). + ### 4.2.0 [Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.1.0...4.2.0) diff --git a/Package.swift b/Package.swift index 4c0e0717e..7524237ba 100644 --- a/Package.swift +++ b/Package.swift @@ -11,7 +11,7 @@ let package = Package( targets: ["ParseSwift"]) ], dependencies: [ - .package(url: "https://github.com/apple/swift-docc-plugin", .upToNextMajor(from: "1.0.0")), + .package(url: "https://github.com/apple/swift-docc-plugin", .upToNextMajor(from: "1.0.0")) ], targets: [ .target( diff --git a/Sources/ParseSwift/ParseConstants.swift b/Sources/ParseSwift/ParseConstants.swift index 912745ece..1038596da 100644 --- a/Sources/ParseSwift/ParseConstants.swift +++ b/Sources/ParseSwift/ParseConstants.swift @@ -10,7 +10,7 @@ import Foundation enum ParseConstants { static let sdk = "swift" - static let version = "4.2.0" + static let version = "4.2.1" static let fileManagementDirectory = "parse/" static let fileManagementPrivateDocumentsDirectory = "Private Documents/" static let fileManagementLibraryDirectory = "Library/" From f3c1e7fcd19683a49fc8dc003c1b113d789f3779 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Mon, 11 Apr 2022 13:37:05 -0400 Subject: [PATCH 07/17] bump windows swift CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 916a06442..8d34b3178 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,7 +195,7 @@ jobs: - uses: actions/checkout@v2 - uses: MaxDesiatov/swift-windows-action@v1 with: - swift-version: "5.5.1" + swift-version: "5.6.1" shell-action: swift test --enable-test-discovery --enable-code-coverage -v - name: Upload coverage to Codecov uses: codecov/codecov-action@v2 From 64e9dc31896386b4262c17de97baf7fb39d4faba Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Mon, 11 Apr 2022 14:00:38 -0400 Subject: [PATCH 08/17] only build windows, don't test --- .github/workflows/ci.yml | 3 ++- CHANGELOG.md | 8 ++++---- Sources/ParseSwift/ParseConstants.swift | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d34b3178..16c4079bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,7 +196,8 @@ jobs: - uses: MaxDesiatov/swift-windows-action@v1 with: swift-version: "5.6.1" - shell-action: swift test --enable-test-discovery --enable-code-coverage -v + shell-action: swift build -v + #shell-action: swift test --enable-test-discovery --enable-code-coverage -v - name: Upload coverage to Codecov uses: codecov/codecov-action@v2 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c40ad584..c5fab06f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,14 @@ ### main -[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.2.1...main) +[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.3.0...main) * _Contributing to this repo? Add info about your change here to be included in the next release_ -### 4.2.1 -[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.2.0...4.2.1) +### 4.3.0 +[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. Need at least Swift 5.6 (Xcode 13.3) for version 4.3.0. Xctest using Swift 5.6.1 toolchain for Windows is currently broken, so the testsuite cannot be run. Will re-enable tests in the future ([#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) diff --git a/Sources/ParseSwift/ParseConstants.swift b/Sources/ParseSwift/ParseConstants.swift index 1038596da..186183788 100644 --- a/Sources/ParseSwift/ParseConstants.swift +++ b/Sources/ParseSwift/ParseConstants.swift @@ -10,7 +10,7 @@ import Foundation enum ParseConstants { static let sdk = "swift" - static let version = "4.2.1" + static let version = "4.3.0" static let fileManagementDirectory = "parse/" static let fileManagementPrivateDocumentsDirectory = "Private Documents/" static let fileManagementLibraryDirectory = "Library/" From 34d7b4335b005b3a10bc0674af66230a9f9cdfb9 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Mon, 11 Apr 2022 14:06:46 -0400 Subject: [PATCH 09/17] pause windows CI for now --- .github/workflows/ci.yml | 27 +++++++++++++-------------- CHANGELOG.md | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16c4079bc..03850c5b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -189,20 +189,19 @@ jobs: env_vars: LINUX fail_ci_if_error: true - windows: - runs-on: windows-2019 - steps: - - uses: actions/checkout@v2 - - uses: MaxDesiatov/swift-windows-action@v1 - with: - swift-version: "5.6.1" - shell-action: swift build -v - #shell-action: swift test --enable-test-discovery --enable-code-coverage -v - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 - with: - env_vars: WINDOWS - fail_ci_if_error: false +# windows: +# runs-on: windows-2019 +# steps: +# - uses: actions/checkout@v2 +# - uses: MaxDesiatov/swift-windows-action@v1 +# with: +# swift-version: "5.6.1" +# shell-action: swift test --enable-test-discovery --enable-code-coverage -v +# - name: Upload coverage to Codecov +# uses: codecov/codecov-action@v2 +# with: +# env_vars: WINDOWS +# fail_ci_if_error: false docs: needs: xcode-build-watchos diff --git a/CHANGELOG.md b/CHANGELOG.md index c5fab06f3..ddfd15282 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ [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. Need at least Swift 5.6 (Xcode 13.3) for version 4.3.0. Xctest using Swift 5.6.1 toolchain for Windows is currently broken, so the testsuite cannot be run. Will re-enable tests in the future ([#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. Need at least Swift 5.6 (Xcode 13.3) for version 4.3.0. Swift 5.6.1 toolchain for Windows is currently broken and building/testing is paused in the CI. Windows developers should use Parse-Swift <= 4.2.0. Will re-enable tests in the future ([#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) From 3309623641371531b23269f75e2f601b521576ce Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Tue, 12 Apr 2022 12:13:29 -0400 Subject: [PATCH 10/17] use DocC scripts and revert package --- .github/workflows/ci.yml | 32 ++-- .github/workflows/release.yml | 11 +- Package.resolved | 16 -- Package.swift | 3 - ParseSwift.xcodeproj/project.pbxproj | 2 + .../contents.xcworkspacedata | 2 +- Scripts/generate-documentation | 141 ++++++++++++++++++ Scripts/jazzy.sh | 12 -- Scripts/update-gh-pages-documentation-site | 78 ++++++++++ 9 files changed, 239 insertions(+), 58 deletions(-) delete mode 100644 Package.resolved create mode 100755 Scripts/generate-documentation delete mode 100755 Scripts/jazzy.sh create mode 100755 Scripts/update-gh-pages-documentation-site diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03850c5b6..52c92a2ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -189,19 +189,19 @@ jobs: env_vars: LINUX fail_ci_if_error: true -# windows: -# runs-on: windows-2019 -# steps: -# - uses: actions/checkout@v2 -# - uses: MaxDesiatov/swift-windows-action@v1 -# with: -# swift-version: "5.6.1" -# shell-action: swift test --enable-test-discovery --enable-code-coverage -v -# - name: Upload coverage to Codecov -# uses: codecov/codecov-action@v2 -# with: -# env_vars: WINDOWS -# fail_ci_if_error: false + windows: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + - uses: MaxDesiatov/swift-windows-action@v1 + with: + swift-version: "5.5.1" + shell-action: swift test --enable-test-discovery --enable-code-coverage -v + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + env_vars: WINDOWS + fail_ci_if_error: false docs: needs: xcode-build-watchos @@ -210,10 +210,8 @@ jobs: - uses: actions/checkout@v2 - name: Use multiple cores run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 - - name: Create folders - run: mkdir ./docs - - name: Build - run: set -o pipefail && env NSUnbufferedIO=YES swift package --allow-writing-to-directory ./docs generate-documentation --target ParseSwift --disable-indexing --output-path ./docs --transform-for-static-hosting --hosting-base-path parse-swift + - name: Generate Docs + run: set -o pipefail && env NSUnbufferedIO=YES Scripts/generate-documentation env: DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b3045e277..332911e39 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,14 +33,7 @@ jobs: run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV - name: Use multiple cores run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 - - name: Create folders - run: mkdir ./docs - - name: Build - run: set -o pipefail && env NSUnbufferedIO=YES set -o pipefail && env NSUnbufferedIO=YES swift package --allow-writing-to-directory ./docs generate-documentation --target ParseSwift --disable-indexing --output-path ./docs --transform-for-static-hosting --hosting-base-path parse-swift + - name: Build and Deploy Docs + run: set -o pipefail && env NSUnbufferedIO=YES Scripts/update-gh-pages-documentation-site env: DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} - - name: Deploy Docs - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs diff --git a/Package.resolved b/Package.resolved deleted file mode 100644 index 3b6d58b80..000000000 --- a/Package.resolved +++ /dev/null @@ -1,16 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "SwiftDocCPlugin", - "repositoryURL": "https://github.com/apple/swift-docc-plugin", - "state": { - "branch": null, - "revision": "3303b164430d9a7055ba484c8ead67a52f7b74f6", - "version": "1.0.0" - } - } - ] - }, - "version": 1 -} diff --git a/Package.swift b/Package.swift index 7524237ba..318d4464a 100644 --- a/Package.swift +++ b/Package.swift @@ -10,9 +10,6 @@ let package = Package( name: "ParseSwift", targets: ["ParseSwift"]) ], - dependencies: [ - .package(url: "https://github.com/apple/swift-docc-plugin", .upToNextMajor(from: "1.0.0")) - ], targets: [ .target( name: "ParseSwift", diff --git a/ParseSwift.xcodeproj/project.pbxproj b/ParseSwift.xcodeproj/project.pbxproj index baec42312..55ff7dbba 100644 --- a/ParseSwift.xcodeproj/project.pbxproj +++ b/ParseSwift.xcodeproj/project.pbxproj @@ -2024,6 +2024,8 @@ Base, ); mainGroup = 4AB8B4EA1F254AE10070F682; + packageReferences = ( + ); productRefGroup = 4AB8B4F51F254AE10070F682 /* Products */; projectDirPath = ""; projectRoot = ""; diff --git a/ParseSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ParseSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 7bf1865e5..919434a62 100644 --- a/ParseSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/ParseSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/Scripts/generate-documentation b/Scripts/generate-documentation new file mode 100755 index 000000000..25b5c1e90 --- /dev/null +++ b/Scripts/generate-documentation @@ -0,0 +1,141 @@ +#!/bin/bash +# +# Copyright (c) 2022, Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder(s) nor the names of any contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission. No license is granted to the trademarks of +# the copyright holders even if such marks are included in this software. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# A `realpath` alternative using the default C implementation. +filepath() { + [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" +} + +# First get the absolute path to this file so we can get the absolute file path to the Swift-DocC root source dir. +PROJECT_ROOT="$(dirname $(dirname $(filepath $0)))" +DOCS_DIR="$PROJECT_ROOT/.build/swift-docc" +SGFS_DIR="$DOCS_DIR/symbol-graph-files" +TEMP_WORKSPACE_DIR="$DOCS_DIR/temporary-workspace-holding-directory" + +DOCC_CMD=convert +OUTPUT_PATH="$DOCS_DIR/ParseSwift.doccarchive" +HOSTING_BASE_PATH="" +PUBLISH="NO" + +# Process command line arguments +OUTPUT_PATH_PROCESSED=0 +HOSTING_BASE_PATH_PROCESSED=0 +while test $# -gt 0; do + case "$1" in + --help) + echo "Usage: $(basename $0) [] [] [--preview] [--publish] [--help]" + echo + echo "Builds ParseSwift and generates or previews the Swift-DocC documentation." + echo + echo " --preview: Starts a preview server after generating documentation." + echo " --publish: Configures the documentation build for publishing on GitHub pages." + echo + exit 0 + ;; + --preview) + DOCC_CMD=preview + shift + ;; + --publish) + PUBLISH="YES" + shift + ;; + *) + if [ ${OUTPUT_PATH_PROCESSED} -eq 0 ]; then + OUTPUT_PATH="$1" + OUTPUT_PATH_PROCESSED=1 + elif [ ${HOSTING_BASE_PATH_PROCESSED} -eq 0 ]; then + HOSTING_BASE_PATH="$1" + HOSTING_BASE_PATH_PROCESSED=1 + else + echo "Unrecognised argument \"$1\"" + exit 1 + fi + ;; + esac + shift +done + +if [ "$PUBLISH" = "YES" ]; then + if [ ${HOSTING_BASE_PATH_PROCESSED} -eq 0 ]; then + echo "A hosting base path must be provided if the '--publish' flag is passed." + echo "See '--help' for details." + exit 1 + fi +fi + +# Create the output directory for the symbol graphs if needed. +mkdir -p "$DOCS_DIR" +mkdir -p "$SGFS_DIR" +rm -f $SGFS_DIR/*.* + +cd "$PROJECT_ROOT" + +# Temporarily move the Xcode workspace aside so that xcodebuild uses the Swift package directly +mkdir "$TEMP_WORKSPACE_DIR" +mv Parse.xcworkspace "$TEMP_WORKSPACE_DIR/Parse.xcworkspace" + +xcodebuild clean build -scheme ParseSwift\ \(iOS\) \ + -destination generic/platform=iOS \ + OTHER_SWIFT_FLAGS="-emit-symbol-graph -emit-symbol-graph-dir '$SGFS_DIR'" | xcpretty + +mv "$TEMP_WORKSPACE_DIR/Parse.xcworkspace" ./Parse.xcworkspace +rm -r "$TEMP_WORKSPACE_DIR" + +# Pretty print DocC JSON output so that it can be consistently diffed between commits +export DOCC_JSON_PRETTYPRINT="YES" + +# By default pass the --index flag so we produce a full DocC archive. +EXTRA_DOCC_FLAGS="--index" + +# If building for publishing, don't pass the --index flag but pass additional flags for +# static hosting configuration. +if [ "$PUBLISH" = "YES" ]; then + EXTRA_DOCC_FLAGS="--transform-for-static-hosting --hosting-base-path ParseSwift/$HOSTING_BASE_PATH" +fi + +# Handle the case where a DocC catalog does not exist in the ParseSwift repo +if [ -d Sources/ParseSwift/Documentation.docc ]; then + # The DocC catalog exists, so pass it to the docc invocation. + DOCC_CMD="$DOCC_CMD Sources/ParseSwift/Documentation.docc" +fi + +xcrun docc $DOCC_CMD \ + --additional-symbol-graph-dir "$SGFS_DIR" \ + --output-path "$OUTPUT_PATH" $EXTRA_DOCC_FLAGS \ + --fallback-display-name ParseSwift \ + --fallback-bundle-identifier edu.uky.cs.netreconlab.ParseSwift \ + --fallback-bundle-version 1.0.0 + +if [[ "$DOCC_CMD" == "convert"* ]]; then + echo + echo "Generated DocC archive at: $OUTPUT_PATH" +fi + diff --git a/Scripts/jazzy.sh b/Scripts/jazzy.sh deleted file mode 100755 index b6a5a6878..000000000 --- a/Scripts/jazzy.sh +++ /dev/null @@ -1,12 +0,0 @@ -bundle exec jazzy \ - --clean \ - --author "Parse Community" \ - --author_url http://parseplatform.org \ - --github_url https://github.com/parse-community/Parse-Swift \ - --root-url http://parseplatform.org/Parse-Swift/api/ \ - --module-version ${BUILD_VERSION} \ - --theme fullwidth \ - --skip-undocumented \ - --output ./docs/api \ - --build-tool-arguments -scheme,'ParseSwift (iOS)',-destination,'name=iPhone 12 Pro Max' \ - --module ParseSwift \ diff --git a/Scripts/update-gh-pages-documentation-site b/Scripts/update-gh-pages-documentation-site new file mode 100755 index 000000000..b4497dffc --- /dev/null +++ b/Scripts/update-gh-pages-documentation-site @@ -0,0 +1,78 @@ +#!/bin/bash +# +# Copyright (c) 2022, Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder(s) nor the names of any contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission. No license is granted to the trademarks of +# the copyright holders even if such marks are included in this software. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -eu + +# A `realpath` alternative using the default C implementation. +filepath() { + [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" +} + +PROJECT_ROOT="$(dirname $(dirname $(filepath $0)))" + +# Set current directory to the repository root +cd "$PROJECT_ROOT" + +# Use git worktree to checkout the gh-pages branch of this repository in a gh-pages sub-directory +git fetch +git worktree add --checkout gh-pages origin/gh-pages + +# Get the name of the current branch to use as the subdirectory for the deployment +CURRENT_BRANCH_NAME=`git rev-parse --abbrev-ref HEAD` + +# Replace any forward slashes in the current branch name with dashes +DEPLOYMENT_SUBDIRECTORY=${CURRENT_BRANCH_NAME//\//-} + +# Create a subdirectory for the current branch name if it doesn't exist +mkdir -p "./gh-pages/$DEPLOYMENT_SUBDIRECTORY" + +# Generate documentation output it +# to the /docs subdirectory in the gh-pages worktree directory. +./Scripts/generate-documentation "$PROJECT_ROOT/gh-pages/$DEPLOYMENT_SUBDIRECTORY" "$DEPLOYMENT_SUBDIRECTORY" --publish + +# Save the current commit we've just built documentation from in a variable +CURRENT_COMMIT_HASH=`git rev-parse --short HEAD` + +# Commit and push our changes to the gh-pages branch +cd gh-pages +git add "$DEPLOYMENT_SUBDIRECTORY" + +if [ -n "$(git status --porcelain)" ]; then + echo "Documentation changes found. Commiting the changes to the 'gh-pages' branch and pushing to origin." + git commit -m "Update documentation to $CURRENT_COMMIT_HASH on '$CURRENT_BRANCH_NAME'" + git push origin HEAD:gh-pages +else + # No changes found, nothing to commit. + echo "No documentation changes found." +fi + +# Delete the git worktree we created +cd .. +git worktree remove gh-pages \ No newline at end of file From 05b3a3cc6dc5c16f86419a0e76875debd989bc0f Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Tue, 12 Apr 2022 12:49:40 -0400 Subject: [PATCH 11/17] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddfd15282..1ca79aee2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ [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. Need at least Swift 5.6 (Xcode 13.3) for version 4.3.0. Swift 5.6.1 toolchain for Windows is currently broken and building/testing is paused in the CI. Windows developers should use Parse-Swift <= 4.2.0. Will re-enable tests in the future ([#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) From c7aeb13dc3439b01ba062658fb852e0d909e29ca Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Tue, 12 Apr 2022 15:52:29 -0400 Subject: [PATCH 12/17] name release folder for docs --- .github/workflows/release.yml | 1 + Scripts/update-gh-pages-documentation-site | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 332911e39..418ac379c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,4 +36,5 @@ jobs: - name: Build and Deploy Docs run: set -o pipefail && env NSUnbufferedIO=YES Scripts/update-gh-pages-documentation-site env: + CURRENT_BRANCH_NAME: release DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} diff --git a/Scripts/update-gh-pages-documentation-site b/Scripts/update-gh-pages-documentation-site index b4497dffc..ba5dbcddd 100755 --- a/Scripts/update-gh-pages-documentation-site +++ b/Scripts/update-gh-pages-documentation-site @@ -45,7 +45,9 @@ git fetch git worktree add --checkout gh-pages origin/gh-pages # Get the name of the current branch to use as the subdirectory for the deployment -CURRENT_BRANCH_NAME=`git rev-parse --abbrev-ref HEAD` +if [ -z "$CURRENT_BRANCH_NAME"]; then + CURRENT_BRANCH_NAME=`git rev-parse --abbrev-ref HEAD` +fi # Replace any forward slashes in the current branch name with dashes DEPLOYMENT_SUBDIRECTORY=${CURRENT_BRANCH_NAME//\//-} From f2b10f936d385831ba802dd3990eeaeb6cd63709 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Tue, 12 Apr 2022 16:10:01 -0400 Subject: [PATCH 13/17] fix script --- Scripts/update-gh-pages-documentation-site | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/update-gh-pages-documentation-site b/Scripts/update-gh-pages-documentation-site index ba5dbcddd..631cf06c3 100755 --- a/Scripts/update-gh-pages-documentation-site +++ b/Scripts/update-gh-pages-documentation-site @@ -45,7 +45,7 @@ git fetch git worktree add --checkout gh-pages origin/gh-pages # Get the name of the current branch to use as the subdirectory for the deployment -if [ -z "$CURRENT_BRANCH_NAME"]; then +if [[ -z ${CURRENT_BRANCH_NAME}]]; then CURRENT_BRANCH_NAME=`git rev-parse --abbrev-ref HEAD` fi From 3d28e7d1e8c1794bcf2968de591b395af3f3f7c2 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Tue, 12 Apr 2022 16:16:11 -0400 Subject: [PATCH 14/17] fix script --- Scripts/update-gh-pages-documentation-site | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/update-gh-pages-documentation-site b/Scripts/update-gh-pages-documentation-site index 631cf06c3..d938086c5 100755 --- a/Scripts/update-gh-pages-documentation-site +++ b/Scripts/update-gh-pages-documentation-site @@ -45,7 +45,7 @@ git fetch git worktree add --checkout gh-pages origin/gh-pages # Get the name of the current branch to use as the subdirectory for the deployment -if [[ -z ${CURRENT_BRANCH_NAME}]]; then +if [ -z ${CURRENT_BRANCH_NAME} ]; then CURRENT_BRANCH_NAME=`git rev-parse --abbrev-ref HEAD` fi From 808502ab031c24b2c4f596b4a61d4def2b19ad4e Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Tue, 12 Apr 2022 16:32:42 -0400 Subject: [PATCH 15/17] more fixes to scripts --- Scripts/update-gh-pages-documentation-site | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/update-gh-pages-documentation-site b/Scripts/update-gh-pages-documentation-site index d938086c5..8b80cc526 100755 --- a/Scripts/update-gh-pages-documentation-site +++ b/Scripts/update-gh-pages-documentation-site @@ -45,7 +45,7 @@ git fetch git worktree add --checkout gh-pages origin/gh-pages # Get the name of the current branch to use as the subdirectory for the deployment -if [ -z ${CURRENT_BRANCH_NAME} ]; then +if [ -z ${CURRENT_BRANCH_NAME+x} ]; then CURRENT_BRANCH_NAME=`git rev-parse --abbrev-ref HEAD` fi From d2a1493f251e3404c3c0ba861bdb74e4aca1f4c3 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Tue, 12 Apr 2022 16:59:57 -0400 Subject: [PATCH 16/17] fix README links --- README.md | 6 ++---- Sources/ParseSwift/Documentation.docc/ParseSwift.md | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 94509d781..7dee13705 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,12 @@ [![Build Status Release](https://github.com/parse-community/Parse-Swift/workflows/release/badge.svg)](https://github.com/parse-community/Parse-Swift/actions?query=workflow%3Arelease) [![Vulnerabilities](https://snyk.io/test/github/parse-community/Parse-Swift/badge.svg)](https://snyk.io/test/github/parse-community/Parse-Swift) [![Coverage](https://codecov.io/gh/parse-community/Parse-Swift/branch/main/graph/badge.svg)](https://codecov.io/gh/parse-community/Parse-Swift/branches) -[![Documentation](https://github.com/parse-community/Parse-Swift/blob/gh-pages/api/badge.svg)](http://parseplatform.org/Parse-Swift/api) +[![Pod](https://img.shields.io/cocoapods/v/ParseSwift.svg)](https://cocoapods.org/pods/ParseSwift) [![Swift Versions](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fparse-community%2FParse-Swift%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/parse-community/Parse-Swift) [![Platforms](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fparse-community%2FParse-Swift%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/parse-community/Parse-Swift) [![Carthage](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/carthage/carthage) -[![Pod](https://img.shields.io/cocoapods/v/ParseSwift.svg)](https://cocoapods.org/pods/ParseSwift) - [![Backers on Open Collective](https://opencollective.com/parse-server/backers/badge.svg)][open-collective-link] [![Sponsors on Open Collective](https://opencollective.com/parse-server/sponsors/badge.svg)][open-collective-link] [![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)][license-link] @@ -26,7 +24,7 @@ A pure Swift library that gives you access to the powerful Parse Server backend from your Swift applications. -For more information about the Parse Platform and its features, see the public [documentation][docs]. The ParseSwift SDK is not a port of the [Parse-SDK-iOS-OSX SDK](https://github.com/parse-community/Parse-SDK-iOS-OSX) and though some of it may feel familiar, it is not backwards compatible and is designed using [protocol oriented programming (POP) and value types](https://www.pluralsight.com/guides/protocol-oriented-programming-in-swift) instead of OOP and reference types. You can learn more about POP by watching [Protocol-Oriented Programming in Swift](https://developer.apple.com/videos/play/wwdc2015/408/) or [Protocol and Value Oriented Programming in UIKit Apps](https://developer.apple.com/videos/play/wwdc2016/419/) videos from previous WWDC's. For more details about ParseSwift, visit the [api documentation](http://parseplatform.org/Parse-Swift/api/). +For more information about the Parse Platform and its features, see the public [documentation][docs]. The ParseSwift SDK is not a port of the [Parse-SDK-iOS-OSX SDK](https://github.com/parse-community/Parse-SDK-iOS-OSX) and though some of it may feel familiar, it is not backwards compatible and is designed using [protocol oriented programming (POP) and value types](https://www.pluralsight.com/guides/protocol-oriented-programming-in-swift) instead of OOP and reference types. You can learn more about POP by watching [Protocol-Oriented Programming in Swift](https://developer.apple.com/videos/play/wwdc2015/408/) or [Protocol and Value Oriented Programming in UIKit Apps](https://developer.apple.com/videos/play/wwdc2016/419/) videos from previous WWDC's. For more details about ParseSwift, visit the [api documentation](http://parseplatform.org/Parse-Swift/release/documentation/parsecarekit/). To learn how to use or experiment with ParseSwift, you can run and edit the [ParseSwift.playground](https://github.com/parse-community/Parse-Swift/tree/main/ParseSwift.playground/Pages). You can use the parse-server in [this repo](https://github.com/netreconlab/parse-hipaa/tree/parse-swift) which has docker compose files (`docker-compose up` gives you a working server) configured to connect with the playground files, has [Parse Dashboard](https://github.com/parse-community/parse-dashboard), and can be used with MongoDB or PostgreSQL. You can also configure the Swift Playgrounds to work with your own Parse Server by editing the configuation in [Common.swift](https://github.com/parse-community/Parse-Swift/blob/e9ba846c399257100b285d25d2bd055628b13b4b/ParseSwift.playground/Sources/Common.swift#L4-L19). To learn more, check out [CONTRIBUTING.md](https://github.com/parse-community/Parse-Swift/blob/main/CONTRIBUTING.md#swift-playgrounds). diff --git a/Sources/ParseSwift/Documentation.docc/ParseSwift.md b/Sources/ParseSwift/Documentation.docc/ParseSwift.md index db0921d65..5552ee78c 100644 --- a/Sources/ParseSwift/Documentation.docc/ParseSwift.md +++ b/Sources/ParseSwift/Documentation.docc/ParseSwift.md @@ -3,7 +3,7 @@ A pure Swift library that gives you access to the powerful Parse Server backend ## Overview ![Parse logo](parse-swift.png) -For more information about the Parse Platform and its features, see the public [documentation](https://docs.parseplatform.org). The ParseSwift SDK is not a port of the [Parse-SDK-iOS-OSX SDK](https://github.com/parse-community/Parse-SDK-iOS-OSX) and though some of it may feel familiar, it is not backwards compatible and is designed using [protocol oriented programming (POP) and value types](https://www.pluralsight.com/guides/protocol-oriented-programming-in-swift) instead of OOP and reference types. You can learn more about POP by watching [Protocol-Oriented Programming in Swift](https://developer.apple.com/videos/play/wwdc2015/408/) or [Protocol and Value Oriented Programming in UIKit Apps](https://developer.apple.com/videos/play/wwdc2016/419/) videos from previous WWDC's. For more details about ParseSwift, visit the [api documentation](http://parseplatform.org/Parse-Swift/api/). +For more information about the Parse Platform and its features, see the public [documentation](https://docs.parseplatform.org). The ParseSwift SDK is not a port of the [Parse-SDK-iOS-OSX SDK](https://github.com/parse-community/Parse-SDK-iOS-OSX) and though some of it may feel familiar, it is not backwards compatible and is designed using [protocol oriented programming (POP) and value types](https://www.pluralsight.com/guides/protocol-oriented-programming-in-swift) instead of OOP and reference types. You can learn more about POP by watching [Protocol-Oriented Programming in Swift](https://developer.apple.com/videos/play/wwdc2015/408/) or [Protocol and Value Oriented Programming in UIKit Apps](https://developer.apple.com/videos/play/wwdc2016/419/) videos from previous WWDC's. For more details about ParseSwift, visit the [api documentation](http://parseplatform.org/Parse-Swift/release/documentation/parsecarekit/). To learn how to use or experiment with ParseSwift, you can run and edit the [ParseSwift.playground](https://github.com/parse-community/Parse-Swift/tree/main/ParseSwift.playground/Pages). You can use the parse-server in [this repo](https://github.com/netreconlab/parse-hipaa/tree/parse-swift) which has docker compose files (`docker-compose up` gives you a working server) configured to connect with the playground files, has [Parse Dashboard](https://github.com/parse-community/parse-dashboard), and can be used with MongoDB or PostgreSQL. You can also configure the Swift Playgrounds to work with your own Parse Server by editing the configuation in [Common.swift](https://github.com/parse-community/Parse-Swift/blob/e9ba846c399257100b285d25d2bd055628b13b4b/ParseSwift.playground/Sources/Common.swift#L4-L19). To learn more, check out [CONTRIBUTING.md](https://github.com/parse-community/Parse-Swift/blob/main/CONTRIBUTING.md#swift-playgrounds). From 57b181afa7e9d294276a95a16be37ebd1b75e777 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Tue, 12 Apr 2022 17:02:48 -0400 Subject: [PATCH 17/17] nits --- README.md | 2 +- Sources/ParseSwift/Documentation.docc/ParseSwift.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7dee13705..51d74c1fc 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ A pure Swift library that gives you access to the powerful Parse Server backend from your Swift applications. -For more information about the Parse Platform and its features, see the public [documentation][docs]. The ParseSwift SDK is not a port of the [Parse-SDK-iOS-OSX SDK](https://github.com/parse-community/Parse-SDK-iOS-OSX) and though some of it may feel familiar, it is not backwards compatible and is designed using [protocol oriented programming (POP) and value types](https://www.pluralsight.com/guides/protocol-oriented-programming-in-swift) instead of OOP and reference types. You can learn more about POP by watching [Protocol-Oriented Programming in Swift](https://developer.apple.com/videos/play/wwdc2015/408/) or [Protocol and Value Oriented Programming in UIKit Apps](https://developer.apple.com/videos/play/wwdc2016/419/) videos from previous WWDC's. For more details about ParseSwift, visit the [api documentation](http://parseplatform.org/Parse-Swift/release/documentation/parsecarekit/). +For more information about the Parse Platform and its features, see the public [documentation][docs]. The ParseSwift SDK is not a port of the [Parse-SDK-iOS-OSX SDK](https://github.com/parse-community/Parse-SDK-iOS-OSX) and though some of it may feel familiar, it is not backwards compatible and is designed using [protocol oriented programming (POP) and value types](https://www.pluralsight.com/guides/protocol-oriented-programming-in-swift) instead of OOP and reference types. You can learn more about POP by watching [Protocol-Oriented Programming in Swift](https://developer.apple.com/videos/play/wwdc2015/408/) or [Protocol and Value Oriented Programming in UIKit Apps](https://developer.apple.com/videos/play/wwdc2016/419/) videos from previous WWDC's. For more details about ParseSwift, visit the [api documentation](http://parseplatform.org/Parse-Swift/release/documentation/parseswift/). To learn how to use or experiment with ParseSwift, you can run and edit the [ParseSwift.playground](https://github.com/parse-community/Parse-Swift/tree/main/ParseSwift.playground/Pages). You can use the parse-server in [this repo](https://github.com/netreconlab/parse-hipaa/tree/parse-swift) which has docker compose files (`docker-compose up` gives you a working server) configured to connect with the playground files, has [Parse Dashboard](https://github.com/parse-community/parse-dashboard), and can be used with MongoDB or PostgreSQL. You can also configure the Swift Playgrounds to work with your own Parse Server by editing the configuation in [Common.swift](https://github.com/parse-community/Parse-Swift/blob/e9ba846c399257100b285d25d2bd055628b13b4b/ParseSwift.playground/Sources/Common.swift#L4-L19). To learn more, check out [CONTRIBUTING.md](https://github.com/parse-community/Parse-Swift/blob/main/CONTRIBUTING.md#swift-playgrounds). diff --git a/Sources/ParseSwift/Documentation.docc/ParseSwift.md b/Sources/ParseSwift/Documentation.docc/ParseSwift.md index 5552ee78c..fde13adc7 100644 --- a/Sources/ParseSwift/Documentation.docc/ParseSwift.md +++ b/Sources/ParseSwift/Documentation.docc/ParseSwift.md @@ -3,7 +3,7 @@ A pure Swift library that gives you access to the powerful Parse Server backend ## Overview ![Parse logo](parse-swift.png) -For more information about the Parse Platform and its features, see the public [documentation](https://docs.parseplatform.org). The ParseSwift SDK is not a port of the [Parse-SDK-iOS-OSX SDK](https://github.com/parse-community/Parse-SDK-iOS-OSX) and though some of it may feel familiar, it is not backwards compatible and is designed using [protocol oriented programming (POP) and value types](https://www.pluralsight.com/guides/protocol-oriented-programming-in-swift) instead of OOP and reference types. You can learn more about POP by watching [Protocol-Oriented Programming in Swift](https://developer.apple.com/videos/play/wwdc2015/408/) or [Protocol and Value Oriented Programming in UIKit Apps](https://developer.apple.com/videos/play/wwdc2016/419/) videos from previous WWDC's. For more details about ParseSwift, visit the [api documentation](http://parseplatform.org/Parse-Swift/release/documentation/parsecarekit/). +For more information about the Parse Platform and its features, see the public [documentation](https://docs.parseplatform.org). The ParseSwift SDK is not a port of the [Parse-SDK-iOS-OSX SDK](https://github.com/parse-community/Parse-SDK-iOS-OSX) and though some of it may feel familiar, it is not backwards compatible and is designed using [protocol oriented programming (POP) and value types](https://www.pluralsight.com/guides/protocol-oriented-programming-in-swift) instead of OOP and reference types. You can learn more about POP by watching [Protocol-Oriented Programming in Swift](https://developer.apple.com/videos/play/wwdc2015/408/) or [Protocol and Value Oriented Programming in UIKit Apps](https://developer.apple.com/videos/play/wwdc2016/419/) videos from previous WWDC's. For more details about ParseSwift, visit the [api documentation](http://parseplatform.org/Parse-Swift/release/documentation/parseswift/). To learn how to use or experiment with ParseSwift, you can run and edit the [ParseSwift.playground](https://github.com/parse-community/Parse-Swift/tree/main/ParseSwift.playground/Pages). You can use the parse-server in [this repo](https://github.com/netreconlab/parse-hipaa/tree/parse-swift) which has docker compose files (`docker-compose up` gives you a working server) configured to connect with the playground files, has [Parse Dashboard](https://github.com/parse-community/parse-dashboard), and can be used with MongoDB or PostgreSQL. You can also configure the Swift Playgrounds to work with your own Parse Server by editing the configuation in [Common.swift](https://github.com/parse-community/Parse-Swift/blob/e9ba846c399257100b285d25d2bd055628b13b4b/ParseSwift.playground/Sources/Common.swift#L4-L19). To learn more, check out [CONTRIBUTING.md](https://github.com/parse-community/Parse-Swift/blob/main/CONTRIBUTING.md#swift-playgrounds).