Skip to content

Commit 09c5524

Browse files
committed
Added the Xcode 12 carthage workaround script for Travis
1 parent 9916805 commit 09c5524

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ script:
3333
- pod install --project-directory=Example
3434
- xcodebuild build -workspace Example/SDWebImageSwiftUI.xcworkspace -scheme SDWebImageSwiftUIDemo -destination 'name=iPhone 11 Pro Max' -configuration Debug | xcpretty -c
3535

36-
- carthage update --configuration Debug
37-
- xcodebuild build -project SDWebImageSwiftUI.xcodeproj -scheme 'SDWebImageSwiftUI' -sdk iphonesimulator -configuration Debug | xcpretty -c
36+
- ./carthage.sh update --configuration Debug
37+
- xcodebuild build -project SDWebImageSwiftUI.xcodeproj -scheme 'SDWebImageSwiftUI' -destination 'name=iPhone 11 Pro Max' -configuration Debug | xcpretty -c
3838

3939
- echo Clean DerivedData
4040
- rm -rf ~/Library/Developer/Xcode/DerivedData/

carthage.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# carthage.sh
2+
# Usage example: ./carthage.sh build --platform iOS
3+
4+
set -euo pipefail
5+
6+
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
7+
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
8+
9+
# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
10+
# the build will fail on lipo due to duplicate architectures.
11+
12+
CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)
13+
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
14+
15+
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
16+
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
17+
18+
export XCODE_XCCONFIG_FILE="$xcconfig"
19+
carthage "$@"

0 commit comments

Comments
 (0)