diff --git a/.travis.yml b/.travis.yml index 2cb8a5fa28..2b7982d701 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ language: objective-c +cache: + - bundler + - cocoapods osx_image: xcode7.3 git: depth: 10 @@ -6,7 +9,7 @@ before_install: - brew update - brew outdated xctool || brew upgrade xctool - brew outdated carthage || brew upgrade carthage - - gem install cocoapods -v 0.38.2 + - gem install cocoapods -v 1.0.1 - gem install xcpretty - gem install xcpretty-travis-formatter # - gem install slather @@ -14,7 +17,9 @@ before_install: install: echo "<3" env: - MODE=tests - - MODE=examples + - MODE=examples-pt1 + - MODE=examples-pt2 + - MODE=examples-pt3 - MODE=life-without-cocoapods - MODE=framework script: ./build.sh $MODE diff --git a/build.sh b/build.sh index a32640bb07..02a2ddb4ab 100755 --- a/build.sh +++ b/build.sh @@ -36,21 +36,102 @@ if [ "$MODE" = "tests" ]; then exit 0 fi -if [ "$MODE" = "examples" ]; then +if [ "$MODE" = "examples-pt1" ]; then echo "Verifying that all AsyncDisplayKit examples compile." - for example in examples/*/; do - echo "Building $example." + for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -6 | head); do + echo "Building (examples-pt1) $example." if [ -f "${example}/Podfile" ]; then echo "Using CocoaPods" pod install --project-directory=$example set -o pipefail && xcodebuild \ - -workspace "${example}Sample.xcworkspace" \ + -workspace "${example}/Sample.xcworkspace" \ -scheme Sample \ -sdk "$SDK" \ -destination "$PLATFORM" \ + -derivedDataPath ~/ \ + build | xcpretty $FORMATTER + elif [ -f "${example}/Cartfile" ]; then + echo "Using Carthage" + local_repo=`pwd` + current_branch=`git rev-parse --abbrev-ref HEAD` + cd $example + + echo "git \"file://${local_repo}\" \"${current_branch}\"" > "Cartfile" + carthage update --platform iOS + + set -o pipefail && xcodebuild \ + -project "Sample.xcodeproj" \ + -scheme Sample \ + -sdk "$SDK" \ + -destination "$PLATFORM" \ + build | xcpretty $FORMATTER + + cd ../.. + fi + done + trap - EXIT + exit 0 +fi + +if [ "$MODE" = "examples-pt2" ]; then + echo "Verifying that all AsyncDisplayKit examples compile." + + for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -12 | tail -6 | head); do + echo "Building $example (examples-pt2)." + + if [ -f "${example}/Podfile" ]; then + echo "Using CocoaPods" + pod install --project-directory=$example + + set -o pipefail && xcodebuild \ + -workspace "${example}/Sample.xcworkspace" \ + -scheme Sample \ + -sdk "$SDK" \ + -destination "$PLATFORM" \ + -derivedDataPath ~/ \ + build | xcpretty $FORMATTER + elif [ -f "${example}/Cartfile" ]; then + echo "Using Carthage" + local_repo=`pwd` + current_branch=`git rev-parse --abbrev-ref HEAD` + cd $example + + echo "git \"file://${local_repo}\" \"${current_branch}\"" > "Cartfile" + carthage update --platform iOS + + set -o pipefail && xcodebuild \ + -project "Sample.xcodeproj" \ + -scheme Sample \ + -sdk "$SDK" \ + -destination "$PLATFORM" \ + build | xcpretty $FORMATTER + + cd ../.. + fi + done + trap - EXIT + exit 0 +fi + +if [ "$MODE" = "examples-pt3" ]; then + echo "Verifying that all AsyncDisplayKit examples compile." + + for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -7 | head); do + echo "Building $example (examples-pt3)." + + if [ -f "${example}/Podfile" ]; then + echo "Using CocoaPods" + pod install --project-directory=$example + + set -o pipefail && xcodebuild \ + -workspace "${example}/Sample.xcworkspace" \ + -scheme Sample \ + -sdk "$SDK" \ + -destination "$PLATFORM" \ + -derivedDataPath ~/ \ build | xcpretty $FORMATTER elif [ -f "${example}/Cartfile" ]; then echo "Using Carthage"