diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 834187ddc..52c92a2ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,15 +6,15 @@ 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 - # 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: @@ -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 @@ -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: @@ -70,11 +70,11 @@ 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 - # 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: @@ -97,11 +97,11 @@ 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 - # 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: @@ -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,34 +205,23 @@ jobs: docs: needs: xcode-build-watchos - runs-on: macos-latest + 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: Generate Docs + run: set -o pipefail && env NSUnbufferedIO=YES Scripts/generate-documentation env: - BUILD_VERSION: '1.8.3' DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} cocoapods: needs: xcode-build-watchos - runs-on: macos-latest + 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: @@ -244,9 +233,11 @@ jobs: carthage: needs: xcode-build-watchos - runs-on: macos-latest + 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: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 297aa2f0a..418ac379c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,17 +4,17 @@ 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 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: @@ -26,34 +26,15 @@ jobs: DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} docs: - runs-on: macos-latest + 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: Build and Deploy Docs + run: set -o pipefail && env NSUnbufferedIO=YES Scripts/update-gh-pages-documentation-site env: - BUILD_VERSION: ${{ env.TAG }} + CURRENT_BRANCH_NAME: release DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} - - name: Deploy Jazzy Docs - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs 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..1ca79aee2 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.3.0...main) * _Contributing to this repo? Add info about your change here to be included in the next release_ +### 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). + ### 4.2.0 [Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.1.0...4.2.0) 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 1880db145..000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,118 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.5) - rexml - activesupport (6.1.5) - 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.1.0) - cocoapods (1.11.3) - addressable (~> 2.8) - claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.3) - 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.3) - 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.6.3) - 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.10) - escape (0.0.4) - ethon (0.15.0) - ffi (>= 1.15.0) - ffi (1.15.5) - fourflusher (2.3.1) - fuzzy_match (2.0.4) - gh_inspector (1.1.3) - httpclient (2.8.3) - i18n (1.10.0) - concurrent-ruby (~> 1.0) - jazzy (0.14.2) - 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.6.1) - liferaft (0.0.6) - minitest (5.15.0) - 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.28.0) - 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.5.4) - -PLATFORMS - ruby - universal-darwin-20 - -DEPENDENCIES - jazzy (~> 0.14.1) - -BUNDLED WITH - 2.1.4 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 { 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/README.md b/README.md index 94509d781..51d74c1fc 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/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/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..8b80cc526 --- /dev/null +++ b/Scripts/update-gh-pages-documentation-site @@ -0,0 +1,80 @@ +#!/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 +if [ -z ${CURRENT_BRANCH_NAME+x} ]; 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//\//-} + +# 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 diff --git a/Sources/ParseSwift/Documentation.docc/ParseSwift.md b/Sources/ParseSwift/Documentation.docc/ParseSwift.md index db0921d65..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/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/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/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/ParseConstants.swift b/Sources/ParseSwift/ParseConstants.swift index 912745ece..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.0" + static let version = "4.3.0" static let fileManagementDirectory = "parse/" static let fileManagementPrivateDocumentsDirectory = "Private Documents/" static let fileManagementLibraryDirectory = "Library/" diff --git a/Sources/ParseSwift/Types/QueryConstraint.swift b/Sources/ParseSwift/Types/QueryConstraint.swift index a4b09ebc1..39239befb 100644 --- a/Sources/ParseSwift/Types/QueryConstraint.swift +++ b/Sources/ParseSwift/Types/QueryConstraint.swift @@ -484,7 +484,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,