Skip to content

Commit

Permalink
Cross platform compatability (#7)
Browse files Browse the repository at this point in the history
* Add tvOS, macOS, & watchOS Support & Add Tests
* Update watchOS and Example Scheme to Public
* Update Deployment Targets to Match Podsepc
* Fix Tests for configuration type & Update Travis
* Update Example project target to iOS 9
* Add .circle.yml
* Update travis device list to 64-bit only devices
  • Loading branch information
RudyB committed Oct 29, 2017
1 parent 3762a0e commit dab7d9d
Show file tree
Hide file tree
Showing 13 changed files with 1,282 additions and 126 deletions.
64 changes: 60 additions & 4 deletions .travis.yml
@@ -1,10 +1,66 @@
osx_image: xcode9
language: objective-c
env:
global:
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8
- PROJECT=Houston.xcodeproj
- IOS_FRAMEWORK_SCHEME="Houston iOS"
- MACOS_FRAMEWORK_SCHEME="Houston macOS"
- TVOS_FRAMEWORK_SCHEME="Houston tvOS"
- WATCHOS_FRAMEWORK_SCHEME="Houston watchOS"
- EXAMPLE_SCHEME="Example"
matrix:
- DESTINATION="OS=4.0,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" ENABLE_CODE_COV="NO"
- DESTINATION="OS=3.2,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" ENABLE_CODE_COV="NO"
- DESTINATION="OS=2.0,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" ENABLE_CODE_COV="NO"

- DESTINATION="OS=11.0,name=iPhone X" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="YES" ENABLE_CODE_COV="YES"
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" ENABLE_CODE_COV="NO"
- DESTINATION="OS=9.0,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" ENABLE_CODE_COV="NO"
- DESTINATION="OS=8.1,name=iPhone 5S" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" ENABLE_CODE_COV="NO"

- DESTINATION="OS=11.0,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" ENABLE_CODE_COV="NO"
- DESTINATION="OS=10.2,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" ENABLE_CODE_COV="NO"
- DESTINATION="OS=9.0,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" ENABLE_CODE_COV="NO"

- DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" ENABLE_CODE_COV="NO"
before_install:
- gem install cocoapods
- gem install cocoapods --quiet
- gem install slather
script:
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -project Houston.xcodeproj/ -scheme Houston -destination "platform=iOS Simulator,name=iPhone 7,OS=11.0" -derivedDataPath ~/Library/Developer/Xcode/DerivedData CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -configuration Debug ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
- set -o pipefail

# Build Framework in Debug and Run Tests if specified
- if [ $RUN_TESTS == "YES" ]; then
xcodebuild -project "$PROJECT" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
else
xcodebuild -project "$PROJECT" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
fi

# Build Framework in Release and Run Tests if specified
- if [ $RUN_TESTS == "YES" ]; then
xcodebuild -project "$PROJECT" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
else
xcodebuild -project "$PROJECT" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty;
fi

# Build Example in Debug if specified
- if [ $BUILD_EXAMPLE == "YES" ]; then
xcodebuild -project "$PROJECT" -scheme "$EXAMPLE_SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
fi

# Run `pod lib lint` if specified
- if [ $POD_LINT == "YES" ]; then
pod lib lint;
fi

- if [ $ENABLE_CODE_COV == "YES" ]; then
xcodebuild -project "$PROJECT" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=YES ENABLE_TESTABILITY=YES -enableCodeCoverage "$ENABLE_CODE_COV" test | xcpretty;
slather coverage --coveralls --scheme "$IOS_FRAMEWORK_SCHEME" --binary-basename Houston --build-directory ~/Library/Developer/Xcode/DerivedData --configuration Debug "$PROJECT";
fi

after_success:
- slather coverage --coveralls --scheme Houston --binary-basename Houston --build-directory ~/Library/Developer/Xcode/DerivedData --configuration Debug Houston.xcodeproj
- if [ $ENABLE_CODE_COV == "YES" ]; then
slather coverage --coveralls --scheme "$IOS_FRAMEWORK_SCHEME" --binary-basename Houston --build-directory ~/Library/Developer/Xcode/DerivedData --configuration Debug "$PROJECT";
fi
4 changes: 3 additions & 1 deletion Houston.podspec
Expand Up @@ -13,7 +13,9 @@ Houston is a lightweight logger in Swift.
s.social_media_url = 'https://twitter.com/RudyB__'

s.ios.deployment_target = '8.0'

s.watchos.deployment_target = "2.0"
s.tvos.deployment_target = "9.0"
s.osx.deployment_target = "10.10"
s.source_files = 'Source/*.swift'

end

0 comments on commit dab7d9d

Please sign in to comment.