diff --git a/.github/workflows/carthage.yml b/.github/workflows/carthage.yml new file mode 100644 index 0000000..b74ebbd --- /dev/null +++ b/.github/workflows/carthage.yml @@ -0,0 +1,27 @@ +name: Carthage +on: push + +jobs: + build: + name: Build + runs-on: macOS-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Install Carthage + run: | + brew update + brew install carthage + + - name: Create Cartfile + run: | + # Delete all of the old tags (if any) and create a new tag for building + git tag | xargs git tag -d + git tag 1.0 + + echo "git \"file://$(pwd)\"" > ./Cartfile + + - name: Build + run: | + ./scripts/carthage.sh update diff --git a/.github/workflows/cocoapods.yml b/.github/workflows/cocoapods.yml index c92af65..0d45946 100644 --- a/.github/workflows/cocoapods.yml +++ b/.github/workflows/cocoapods.yml @@ -14,6 +14,10 @@ jobs: with: version: latest - - name: Lint + - name: Lint (Dynamic Library) run: | pod lib lint + + - name: Lint (Static Library) + run: | + pod lib lint --use-libraries diff --git a/.github/workflows/swift-pacakge.yml b/.github/workflows/swift-pacakge.yml index 5b81c39..7ec427d 100644 --- a/.github/workflows/swift-pacakge.yml +++ b/.github/workflows/swift-pacakge.yml @@ -1,4 +1,4 @@ -name: Build Swift Package +name: Swift Package on: push jobs: diff --git a/.github/workflows/xcodebuild.yml b/.github/workflows/xcodebuild.yml index 5f7b0e9..d0d7c0c 100644 --- a/.github/workflows/xcodebuild.yml +++ b/.github/workflows/xcodebuild.yml @@ -1,4 +1,4 @@ -name: Build Xcode Project +name: Xcode Project on: push jobs: @@ -12,11 +12,11 @@ jobs: - name: Build iOS run: | - xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphoneos -configuration Debug ONLY_ACTIVE_ARCH=YES + xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphoneos -configuration Debug - name: Build iOS Simulator run: | - xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphonesimulator -configuration Debug ONLY_ACTIVE_ARCH=YES + xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphonesimulator -configuration Debug - name: Test run: | @@ -32,7 +32,7 @@ jobs: - name: Build run: | - xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk macosx -configuration Debug ONLY_ACTIVE_ARCH=YES + xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk macosx -configuration Debug - name: Test run: | @@ -48,11 +48,11 @@ jobs: - name: Build run: | - xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug ONLY_ACTIVE_ARCH=YES + xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug - name: Test run: | - xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug ONLY_ACTIVE_ARCH=YES test + xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug test tvos: name: tvOS @@ -64,11 +64,11 @@ jobs: - name: Build tvOS run: | - xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvos -configuration Debug ONLY_ACTIVE_ARCH=YES + xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvos -configuration Debug - name: Build tvOS Simulator run: | - xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvsimulator -configuration Debug ONLY_ACTIVE_ARCH=YES + xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvsimulator -configuration Debug - name: Test run: | diff --git a/ProtocolProxy.xcodeproj/project.pbxproj b/ProtocolProxy.xcodeproj/project.pbxproj index 1ea4832..ae3a804 100644 --- a/ProtocolProxy.xcodeproj/project.pbxproj +++ b/ProtocolProxy.xcodeproj/project.pbxproj @@ -100,6 +100,7 @@ DDA15DEC25644F580036D007 /* ProtocolProxy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = "ProtocolProxy-Info.plist"; path = "Plists/ProtocolProxy-Info.plist"; sourceTree = SOURCE_ROOT; }; DDA15DED25644F580036D007 /* ProtocolProxyTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = "ProtocolProxyTests-Info.plist"; path = "Plists/ProtocolProxyTests-Info.plist"; sourceTree = SOURCE_ROOT; }; DDA15DEE25644F680036D007 /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = SOURCE_ROOT; }; + DD17A9F9257744BC00D30599 /* scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = scripts; sourceTree = ""; }; DDA26DBD256EA4D700E1C6D7 /* workflows */ = {isa = PBXFileReference; lastKnownFileType = folder; name = workflows; path = .github/workflows; sourceTree = ""; }; DDF7567322AA773D002E11D4 /* ProtocolProxy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ProtocolProxy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; DDF7567C22AA773D002E11D4 /* ProtocolProxyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ProtocolProxyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -314,6 +315,7 @@ DDF756A622AA77C1002E11D4 /* Supporting Files */ = { isa = PBXGroup; children = ( + DD17A9F9257744BC00D30599 /* scripts */, DDA26DBD256EA4D700E1C6D7 /* workflows */, DDF756A822AA77DE002E11D4 /* ProtocolProxy.podspec */, DDA15DEE25644F680036D007 /* Package.swift */, diff --git a/README.md b/README.md index 14d06b1..999c27e 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,13 @@ Flexible proxy for overriding and observing protocol method/property messages. [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/ProtocolProxy.svg)](https://cocoapods.org/pods/ProtocolProxy) [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Platform](https://img.shields.io/cocoapods/p/ProtocolProxy.svg)](https://cocoapods.org/pods/ProtocolProxy) -[![Build](https://travis-ci.com/SomeRandomiOSDev/ProtocolProxy.svg?branch=master)](https://travis-ci.com/SomeRandomiOSDev/ProtocolProxy) [![Code Coverage](https://codecov.io/gh/SomeRandomiOSDev/ProtocolProxy/branch/master/graph/badge.svg)](https://codecov.io/gh/SomeRandomiOSDev/ProtocolProxy) +![Swift Package](https://github.com/SomeRandomiOSDev/ProtocolProxy/workflows/Swift%20Package/badge.svg) +![Xcode Project](https://github.com/SomeRandomiOSDev/ProtocolProxy/workflows/Xcode%20Project/badge.svg) +![Cocoapods](https://github.com/SomeRandomiOSDev/ProtocolProxy/workflows/Cocoapods/badge.svg) +![Carthage](https://github.com/SomeRandomiOSDev/ProtocolProxy/workflows/Carthage/badge.svg) + ## Purpose The purpose of this library is to provide a lightweight class that serves as a stand-in for objects that are required to implement one or more protocols (e.g. delegates, data sources, etc.). Additionally, this proxy allows for the selective overriding of specific methods/properties from the adopted protocol(s) as well as the observation of any of the protocol methods/properties before and after they're called. diff --git a/scripts/carthage.sh b/scripts/carthage.sh new file mode 100755 index 0000000..21bd3b8 --- /dev/null +++ b/scripts/carthage.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Needed to circumvent a current issue with Carthage: https://github.com/Carthage/Carthage/issues/3019 +# +# 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. +for simulator in iphonesimulator appletvsimulator; do + echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_${simulator}__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig +done +echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(PLATFORM_NAME)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig + +export XCODE_XCCONFIG_FILE="$xcconfig" +cat $XCODE_XCCONFIG_FILE +carthage "$@"