diff --git a/.gitignore b/.gitignore index e02fd3eb..ad7ed255 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ Temporary Items ## Build generated build/ DerivedData +docs/ ## Various settings *.pbxuser diff --git a/.jazzy.yaml b/.jazzy.yaml new file mode 100644 index 00000000..2dcea0ec --- /dev/null +++ b/.jazzy.yaml @@ -0,0 +1,9 @@ +module: "ParseLiveQuery" +xcodebuild_arguments: ["-scheme","ParseLiveQuery-iOS"] +theme: "fullwidth" +skip_undocumented: true +clean: true +author_url: "http://parseplatform.org" +github_url: "https://github.com/parse-community/ParseLiveQuery-iOS-OSX" +root_url: "http://parseplatform.org/ParseLiveQuery-iOS-OSX/" +author: "Parse Community" diff --git a/.travis.yml b/.travis.yml index a050259a..1f40db99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,46 +1,67 @@ branches: only: - master + - /^v?[0-9]+\.[0-9]+\.[0-9]+(-.*)?$/ language: objective-c os: osx -osx_image: xcode8 +osx_image: xcode8.3 cache: - cocoapods -env: - matrix: - - TEST_TYPE=iOS - - TEST_TYPE=OSX - - TEST_TYPE=OSXDemoSwift - - TEST_TYPE=OSXDemoObjC - - TEST_TYPE=CocoaPods - - TEST_TYPE=Carthage -install: -- | - bundle install -script: -- | - if [ "$TEST_TYPE" = iOS ]; then - set -o pipefail - xcodebuild build -workspace ParseLiveQuery.xcworkspace -sdk iphonesimulator -scheme ParseLiveQuery-iOS -configuration Debug -destination "platform=iOS Simulator,name=iPhone 4s" -destination "platform=iOS Simulator,name=iPhone 6 Plus" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c - elif [ "$TEST_TYPE" = OSX ]; then - set -o pipefail - xcodebuild build -workspace ParseLiveQuery.xcworkspace -sdk macosx -scheme ParseLiveQuery-OSX -configuration Debug GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c - elif [ "$TEST_TYPE" = OSXDemoSwift ]; then - set -o pipefail - xcodebuild clean -workspace ParseLiveQuery.xcworkspace -scheme LiveQueryDemo | xcpretty -c - xcodebuild build -workspace ParseLiveQuery.xcworkspace -scheme LiveQueryDemo -configuration Debug | xcpretty -c - elif [ "$TEST_TYPE" = OSXDemoObjC ]; then - set -o pipefail - xcodebuild clean -workspace ParseLiveQuery.xcworkspace -scheme LiveQueryDemo-ObjC | xcpretty -c - xcodebuild build -workspace ParseLiveQuery.xcworkspace -scheme LiveQueryDemo-ObjC -configuration Debug | xcpretty -c - elif [ "$TEST_TYPE" = CocoaPods ]; then - bundle exec pod repo update 2>&1 > /dev/null || exit 1 - pod lib lint ParseLiveQuery.podspec - elif [ "$TEST_TYPE" = Carthage ]; then - carthage build --no-skip-current - fi -after_success: -- | - if [ "$TEST_TYPE" = iOS ] || [ "$TEST_TYPE" = OSX ]; then - bash <(curl -s https://codecov.io/bash) - fi + +install: bundle install + +jobs: + include: + - stage: test + env: iOS + script: + - | + set -o pipefail + xcodebuild build -workspace ParseLiveQuery.xcworkspace -sdk iphonesimulator -scheme ParseLiveQuery-iOS -configuration Debug -destination "platform=iOS Simulator,name=iPhone 4s" -destination "platform=iOS Simulator,name=iPhone 6 Plus" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c + after_success: bash <(curl -s https://codecov.io/bash) + - stage: test + env: OSX + script: + - | + set -o pipefail + xcodebuild build -workspace ParseLiveQuery.xcworkspace -sdk macosx -scheme ParseLiveQuery-OSX -configuration Debug GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c + after_success: bash <(curl -s https://codecov.io/bash) + - stage: demo + env: OSX-Swift + script: + - | + set -o pipefail + xcodebuild clean -workspace ParseLiveQuery.xcworkspace -scheme LiveQueryDemo | xcpretty -c + xcodebuild build -workspace ParseLiveQuery.xcworkspace -scheme LiveQueryDemo -configuration Debug | xcpretty -c + - stage: demo + env: OSX-ObjC + script: + - | + set -o pipefail + xcodebuild clean -workspace ParseLiveQuery.xcworkspace -scheme LiveQueryDemo-ObjC | xcpretty -c + xcodebuild build -workspace ParseLiveQuery.xcworkspace -scheme LiveQueryDemo-ObjC -configuration Debug | xcpretty -c + - stage: distribution + env: Carthage + script: carthage build --no-skip-current + - stage: distribution + env: CocoaPods + script: + - bundle exec pod repo update --silent + - pod lib lint ParseLiveQuery.podspec + deploy: + provider: script + skip_cleanup: true + script: ./publish.sh + on: + tags: true + all_branches: true + - stage: distribution + env: Docs + script: bundle exec jazzy + deploy: + provider: pages + skip_cleanup: true + github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard + local_dir: docs/ + on: + all_branches: true diff --git a/Gemfile b/Gemfile index 1ad78d9f..480f360c 100644 --- a/Gemfile +++ b/Gemfile @@ -3,3 +3,4 @@ source 'https://rubygems.org' gem 'xcpretty' # xcode8 compat gem 'cocoapods', '1.1.1' +gem 'jazzy' diff --git a/Gemfile.lock b/Gemfile.lock index 69b9a19b..de42b3d8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,20 +43,45 @@ GEM cocoapods-try (1.1.0) colored (1.2) escape (0.0.4) + ffi (1.9.18) fourflusher (2.0.1) fuzzy_match (2.0.4) gh_inspector (1.0.2) i18n (0.7.0) + jazzy (0.9.0) + cocoapods (~> 1.0) + mustache (~> 0.99) + open4 + redcarpet (~> 3.2) + rouge (~> 1.5) + sass (~> 3.4) + sqlite3 (~> 1.3) + xcinvoke (~> 0.3.0) json (1.8.3) + liferaft (0.0.6) minitest (5.9.0) molinillo (0.5.5) + mustache (0.99.8) nanaimo (0.2.3) nap (1.1.0) netrc (0.7.8) + open4 (1.3.4) + rb-fsevent (0.10.2) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) + redcarpet (3.4.0) rouge (1.11.1) + sass (3.5.3) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sqlite3 (1.3.13) thread_safe (0.3.5) tzinfo (1.2.2) thread_safe (~> 0.1) + xcinvoke (0.3.0) + liferaft (~> 0.0.6) xcodeproj (1.4.2) CFPropertyList (~> 2.3.3) activesupport (>= 3) @@ -71,7 +96,8 @@ PLATFORMS DEPENDENCIES cocoapods (= 1.1.1) + jazzy xcpretty BUNDLED WITH - 1.13.1 + 1.16.0 diff --git a/Sources/ParseLiveQuery/Internal/BoltsHelpers.swift b/Sources/ParseLiveQuery/Internal/BoltsHelpers.swift index b57c6d5b..523ad9b0 100644 --- a/Sources/ParseLiveQuery/Internal/BoltsHelpers.swift +++ b/Sources/ParseLiveQuery/Internal/BoltsHelpers.swift @@ -18,7 +18,7 @@ func objcTask(_ task: Task) -> BFTask where T: AnyObject { if task.cancelled { taskCompletionSource.trySetCancelled() } else if task.faulted { - let error = task.error as? NSError ?? NSError(domain: unknownDomain, code: -1, userInfo: nil) + let error = (task.error as NSError?) ?? NSError(domain: unknownDomain, code: -1, userInfo: nil) taskCompletionSource.trySetError(error) } else { taskCompletionSource.trySetResult(task.result) diff --git a/publish.sh b/publish.sh new file mode 100755 index 00000000..ecaf0b28 --- /dev/null +++ b/publish.sh @@ -0,0 +1,4 @@ +#!/bin/sh -e +gem install bundler +bundle install +bundle exec pod trunk push ParseLiveQuery.podspec