Using xcpretty on travis

This commit is contained in:
Flávio Caetano 2017-04-18 16:07:48 -03:00
parent 9114f4e091
commit d5922386d5
2 changed files with 22 additions and 10 deletions

View File

@ -1,4 +1,4 @@
osx_image: xcode8.2
osx_image: xcode8.3
language: objective-c
podfile: Example/Podfile
@ -6,15 +6,26 @@ podfile: Example/Podfile
before_install:
- gem install cocoapods -v '1.2.1'
- pod --version
- pod repo update
- pod repo update --silent
# install:
# - if [[ ! $(which xcpretty) ]]; then gem install xcpretty --user-install; fi;
install:
- pushd Example; pod install; popd
- if [[ ! $(which xcpretty) ]]; then gem install xcpretty --user-install; fi;
env:
matrix:
- DESTINATION="platform=iOS Simulator,OS=10.3,name=iPhone 7" POD_LINT="YES"
- DESTINATION="platform=iOS Simulator,OS=9.0,name=iPhone 6" POD_LINT="NO"
- DESTINATION="platform=iOS Simulator,OS=8.3,name=iPhone 4S" POD_LINT="NO"
script:
- xcodebuild -workspace Example/ReCaptcha.xcworkspace -scheme ReCaptcha-Example -destination 'platform=iOS Simulator,name=iPhone 7,OS=10.2' build
- xcodebuild -workspace Example/ReCaptcha.xcworkspace -scheme ReCaptcha-Example -destination 'platform=iOS Simulator,name=iPhone 7,OS=10.2' test
- pod lib lint --no-clean --quick
- xcodebuild -workspace Example/ReCaptcha.xcworkspace -scheme ReCaptcha-Example -destination '$DESTINATION' build | xcpretty
- xcodebuild -workspace Example/ReCaptcha.xcworkspace -scheme ReCaptcha-Example -destination '$DESTINATION' test | xcpretty
# Run `pod lib lint` if specified
- if [ $POD_LINT == "YES" ]; then
pod lib lint --verbose;
fi
after_success:
- bash <(curl -s https://codecov.io/bash) -J 'ReCaptcha'

View File

@ -20,6 +20,8 @@ ReCaptcha is available through [CocoaPods](http://cocoapods.org). To install it,
Podfile:
``` ruby
pod "ReCaptcha"
# or
pod "ReCaptcha/RxSwift"
```
@ -33,15 +35,14 @@ let recaptcha = try? ReCaptcha()
override func viewDidLoad() {
super.viewDidLoad()
recaptcha?.configureWebView { [weak self] (webview: WKWebView) in
// Add constraints and configure it for display
recaptcha?.configureWebView { [weak self] webview in
webview.frame = self?.view.bounds ?? CGRect.zero
}
}
func validate() {
recaptcha?.validate(on: view) { [weak self] (result: Result<String, NSError>) in
recaptcha?.validate(on: view) { [weak self] result in
print(try? result.dematerialize())
}
}