From 374dc7f7b9e76c6aeb393f6a84590c6d387e1ecb Mon Sep 17 00:00:00 2001 From: ApolloZhu Date: Tue, 24 Nov 2020 22:46:57 -0500 Subject: [PATCH] Carthage "workaround" which doesn't quite work for me --- .github/workflows/carthage.yml | 2 +- README.md | 7 +++++-- carthage.sh | 20 ++++++++++++++++++++ swift_qrcodejs.xcodeproj/project.pbxproj | 4 ---- 4 files changed, 26 insertions(+), 7 deletions(-) create mode 100755 carthage.sh diff --git a/.github/workflows/carthage.yml b/.github/workflows/carthage.yml index 5d584f6..87c0caf 100644 --- a/.github/workflows/carthage.yml +++ b/.github/workflows/carthage.yml @@ -8,4 +8,4 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build - run: carthage build --no-skip-current --verbose + run: ./carthage.sh build --no-skip-current --verbose diff --git a/README.md b/README.md index 9ae69f3..e377f83 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Cross-platform QRCode generator written in pure Swift, aiming to solve the awkwa More details in the [Official Guide](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app), but in general: -1. Select in the menu bar of Xcode: `File` > `Swift Packages` > `Add Package Dependency`. +1. Select in the menu bar of Xcode: `File` > `Swift Packages` > `Add Package Dependency` 2. Enter https://github.com/ApolloZhu/swift_qrcodejs.git 2. Next, specify the version resolving rule as "Up to Next Major" 3. Finish with choosing `QRCodeSwift` library and add it to your app target. @@ -58,12 +58,15 @@ pod 'swift_qrcodejs', '~> 2.2.2'
Carthage -I assume you know what you are doing because I don't, but you probably need something like this: +I assume you know what you are doing (because I don't), but you probably need something like this: ```ruby github "ApolloZhu/swift_qrcodejs" ~> 2.2.2 ``` +Note that [Carthage doesn't work with Xcode 12](https://github.com/Carthage/Carthage/issues/3019) +(but here's a [workaround](https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md)). +
diff --git a/carthage.sh b/carthage.sh new file mode 100755 index 0000000..fa4631d --- /dev/null +++ b/carthage.sh @@ -0,0 +1,20 @@ +# carthage.sh +# Usage example: ./carthage.sh build --platform iOS +# Why? https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md + +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 "$@" diff --git a/swift_qrcodejs.xcodeproj/project.pbxproj b/swift_qrcodejs.xcodeproj/project.pbxproj index ade3f56..1df62a3 100644 --- a/swift_qrcodejs.xcodeproj/project.pbxproj +++ b/swift_qrcodejs.xcodeproj/project.pbxproj @@ -318,8 +318,6 @@ isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; - EXCLUDED_ARCHS = "$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))"; - EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = "arm64 arm64e armv7 armv7s armv6 armv8"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PLATFORM_DIR)/Developer/Library/Frameworks", @@ -348,8 +346,6 @@ isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; - EXCLUDED_ARCHS = "$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))"; - EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = "arm64 arm64e armv7 armv7s armv6 armv8"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PLATFORM_DIR)/Developer/Library/Frameworks",