Merge pull request #170 from SDWebImage/update_travis

Update the Travis to use Xcode 12
This commit is contained in:
DreamPiggy 2021-02-24 18:26:11 +08:00 committed by GitHub
commit 532ca91191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 7 deletions

View File

@ -1,5 +1,5 @@
language: swift
osx_image: xcode11.4
osx_image: xcode12
env:
global:
@ -33,8 +33,8 @@ script:
- pod install --project-directory=Example
- xcodebuild build -workspace Example/SDWebImageSwiftUI.xcworkspace -scheme SDWebImageSwiftUIDemo -destination 'name=iPhone 11 Pro Max' -configuration Debug | xcpretty -c
- carthage update --configuration Debug
- xcodebuild build -project SDWebImageSwiftUI.xcodeproj -scheme 'SDWebImageSwiftUI' -sdk iphonesimulator -configuration Debug | xcpretty -c
- ./carthage.sh update --configuration Debug
- xcodebuild build -project SDWebImageSwiftUI.xcodeproj -scheme 'SDWebImageSwiftUI' -destination 'name=iPhone 11 Pro Max' -configuration Debug | xcpretty -c
- echo Clean DerivedData
- rm -rf ~/Library/Developer/Xcode/DerivedData/

View File

@ -162,10 +162,15 @@ class WebImageTests: XCTestCase {
let displayImage = try? imageView.inspect().group().image(0).nsImage()
XCTAssertNotNil(displayImage)
#else
let displayImage = try? imageView.inspect().group().image(0).cgImage()
let orientation = try! imageView.inspect().group().image(0).orientation()
XCTAssertNotNil(displayImage)
XCTAssertEqual(orientation, .leftMirrored)
if #available(iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
let displayImage = try? imageView.inspect().group().image(0).uiImage()
XCTAssertEqual(displayImage, image)
} else {
let displayImage = try? imageView.inspect().group().image(0).cgImage()
let orientation = try? imageView.inspect().group().image(0).orientation()
XCTAssertNotNil(displayImage)
XCTAssertEqual(orientation, .leftMirrored)
}
#endif
expectation.fulfill()
}.onFailure { error in

19
carthage.sh Executable file
View File

@ -0,0 +1,19 @@
# carthage.sh
# Usage example: ./carthage.sh build --platform iOS
set -euo pipefail
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)
echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig
export XCODE_XCCONFIG_FILE="$xcconfig"
carthage "$@"