我正在使用Travis CI进行iOS项目的构建。我的.travis.yml文件如下所示。
language: objective-c
osx_image: xcode9.2
cache:
directories:
- Carthage
env:
#environment variables
global:
- LANG=en_US.UTF-8
- LC_ALL=en_US.UTF-8
- PROJECT_NAME="MyProject.xcodeproj"
- SCHEME_IOS_FRAMEWORK="Framework_iOS"
- SCHEME_TVOS_FRAMEWORK="Framework_tvOS"
- IOS_SDK=iphonesimulator11.2
- TVOS_SDK=appletvsimulator11.2
matrix:
- DESTINATION="OS=11.2,name=iPhone X" SCHEME="$SCHEME_IOS_FRAMEWORK" SDK="$IOS_SDK"
- DESTINATION="OS=11.0,name=Apple TV 1080p" SCHEME="$SCHEME_TVOS_FRAMEWORK" SDK="$TVOS_SDK"
before_install:
- brew install carthage || true
- brew outdated carthage || brew upgrade carthage
- gem install xcpretty-travis-formatter --no-rdoc --no-ri --no-document --quiet
before_script:
# bootstrap the dependencies for the project
- carthage bootstrap --platform iOS --no-use-binaries --cache-builds
- carthage bootstrap --platform tvOS --no-use-binaries --cache-builds
script:
- set -o pipefail
- xcodebuild clean test -project "$PROJECT_NAME" -scheme "$SCHEME" -destination "$DESTINATION" -sdk "$SDK" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO | xcpretty -f `xcpretty-travis-formatter`
我有两个方案,一个是iOS,另一个是tvOS。Travis中的构建通过了,但需要18-20分钟。以下内容来自Travis日志:
![enter image description here](https://istack.dev59.com/8l2rS.webp)