From 0651dce776793d06d6676befb25daf9b7b02a734 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sun, 3 Dec 2017 22:39:01 -0500 Subject: [PATCH 1/9] Adds jazzy docs generation and gh-pages releases --- .gitignore | 1 + .jazzy.yaml | 3 +++ .travis.yml | 17 +++++++++++++++++ Gemfile | 1 + Gemfile.lock | 28 +++++++++++++++++++++++++++- 5 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .jazzy.yaml 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..eb90e105 --- /dev/null +++ b/.jazzy.yaml @@ -0,0 +1,3 @@ +module: "ParseLiveQuery" +xcodebuild_arguments: ["-scheme","ParseLiveQuery-iOS"] +theme: "fullwidth" diff --git a/.travis.yml b/.travis.yml index a050259a..7324982c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,8 @@ os: osx osx_image: xcode8 cache: - cocoapods + +stage: test env: matrix: - TEST_TYPE=iOS @@ -44,3 +46,18 @@ after_success: if [ "$TEST_TYPE" = iOS ] || [ "$TEST_TYPE" = OSX ]; then bash <(curl -s https://codecov.io/bash) fi + +jobs: + include: + - stage: docs + env: + before_script: skip + after_script: skip + 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 From 40fa2c2e36cbd7fb4bad93f8e5b630094622094a Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sun, 3 Dec 2017 22:42:53 -0500 Subject: [PATCH 2/9] Skip after success --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 7324982c..66a6299a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,7 @@ jobs: env: before_script: skip after_script: skip + after_success: skip script: bundle exec jazzy deploy: - provider: pages From e6171a9c501692228236ee834fff30c02b33fe6a Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sun, 3 Dec 2017 22:46:19 -0500 Subject: [PATCH 3/9] use jobs --- .travis.yml | 76 ++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/.travis.yml b/.travis.yml index 66a6299a..9548bc6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,48 +7,46 @@ osx_image: xcode8 cache: - cocoapods -stage: test -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 2>&1 || exit 1 + - pod lib lint ParseLiveQuery.podspec - stage: docs env: before_script: skip From 8f1f7bc5c0f0eae50bca658b5992ef73a1e06e36 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sun, 3 Dec 2017 22:47:00 -0500 Subject: [PATCH 4/9] nits --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9548bc6a..05c836d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,10 +43,10 @@ jobs: env: Carthage script: carthage build --no-skip-current - stage: distribution - env: CocoaPods - script: - - bundle exec pod repo update 2>&1 || exit 1 - - pod lib lint ParseLiveQuery.podspec + env: CocoaPods + script: + - bundle exec pod repo update 2>&1 || exit 1 + - pod lib lint ParseLiveQuery.podspec - stage: docs env: before_script: skip From bfaed73b51742dab84e5411ecbf361d544a6f948 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sun, 3 Dec 2017 23:11:43 -0500 Subject: [PATCH 5/9] Adds Cocoapods autopublish --- .travis.yml | 27 ++++++++++++++++----------- publish.sh | 4 ++++ 2 files changed, 20 insertions(+), 11 deletions(-) create mode 100755 publish.sh diff --git a/.travis.yml b/.travis.yml index 05c836d6..eadcf4fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ branches: only: - master + - /^v?[0-9]+.[0-9]+.[0-9]+(-.*)?$/ language: objective-c os: osx osx_image: xcode8 @@ -47,16 +48,20 @@ jobs: script: - bundle exec pod repo update 2>&1 || exit 1 - pod lib lint ParseLiveQuery.podspec - - stage: docs - env: - before_script: skip - after_script: skip - after_success: skip + 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 + 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/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 From 457bc7c85a46957577496a3426c40e929c7c212c Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sun, 3 Dec 2017 23:26:50 -0500 Subject: [PATCH 6/9] Better jazzy config --- .jazzy.yaml | 6 ++++++ .travis.yml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.jazzy.yaml b/.jazzy.yaml index eb90e105..2dcea0ec 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -1,3 +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 eadcf4fd..0e69dedb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ branches: - /^v?[0-9]+.[0-9]+.[0-9]+(-.*)?$/ language: objective-c os: osx -osx_image: xcode8 +osx_image: xcode8.3 cache: - cocoapods From 82491f69efab5b517d22c5f66ecd8a575eef576e Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Mon, 4 Dec 2017 00:25:50 -0500 Subject: [PATCH 7/9] Fixes warning appearing in 8.3.3 --- Sources/ParseLiveQuery/Internal/BoltsHelpers.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From cbb5fddcb6586a21d89e1fd90ca77c7d3c3dd070 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Mon, 4 Dec 2017 00:57:12 -0500 Subject: [PATCH 8/9] Makes pod repo update silent --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0e69dedb..6ce80842 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ jobs: - stage: distribution env: CocoaPods script: - - bundle exec pod repo update 2>&1 || exit 1 + - bundle exec pod repo update --silent - pod lib lint ParseLiveQuery.podspec deploy: provider: script From dd6fab8c966827d6669bea1eda44f1965c96a7e6 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Mon, 4 Dec 2017 01:07:49 -0500 Subject: [PATCH 9/9] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6ce80842..1f40db99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ branches: only: - master - - /^v?[0-9]+.[0-9]+.[0-9]+(-.*)?$/ + - /^v?[0-9]+\.[0-9]+\.[0-9]+(-.*)?$/ language: objective-c os: osx osx_image: xcode8.3