diff --git a/.travis.yml b/.travis.yml index 580f689..8225a80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,3 @@ -# references: -# * http://www.objc.io/issue-6/travis-ci.html -# * https://github.com/supermarin/xcpretty#usage - +osx_image: xcode7.3 language: objective-c -# cache: cocoapods -# podfile: Example/Podfile -# before_install: -# - gem install cocoapods # Since Travis is not always on latest version -# - pod install --project-directory=Example -script: -- set -o pipefail && xcodebuild test -workspace Example/StringScore_Swift.xcworkspace -scheme StringScore_Swift-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -- pod lib lint +script: ci diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..2a8fb3e --- /dev/null +++ b/Rakefile @@ -0,0 +1,38 @@ +XCODEBUILD_OPTS = "-project StringScore.xcodeproj -derivedDataPath DerivedData" +IOS = "-scheme StringScore_Swift -sdk iphonesimulator9.3 -destination 'platform=iOS Simulator,name=iPhone 6'" +MACOSX = "-scheme StringScore_Swift -destination 'generic/platform=OS X'" + +def xcpretty(cmd) + sh "set -o pipefail; #{cmd} | xcpretty -c" +end + +task default: %w[test] + +task ci: %w[test:ios] + +desc "Run all tests" +task test: %w[test:ios test:macosx] + +namespace :test do + desc "Test on iOS" + task :ios do + xcpretty "xcodebuild test #{XCODEBUILD_OPTS} #{IOS}" + end + + desc "Test on Mac OS X" + task :macosx do + xcpretty "xcodebuild test #{XCODEBUILD_OPTS} #{MACOSX}" + end +end + +namespace :podspec do + desc "Validate the podspec" + task :lint do + sh "pod lib lint" + end +end + +desc "Clean the default scheme" +task :clean do + rm_rf "DerivedData" +end diff --git a/StringScore.xcodeproj/xcshareddata/xcschemes/StringScoreTests.xcscheme b/StringScore.xcodeproj/xcshareddata/xcschemes/StringScoreTests.xcscheme new file mode 100644 index 0000000..72d18e3 --- /dev/null +++ b/StringScore.xcodeproj/xcshareddata/xcschemes/StringScoreTests.xcscheme @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + +