Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/carthage.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion .github/workflows/cocoapods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/swift-pacakge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Swift Package
name: Swift Package
on: push

jobs:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/xcodebuild.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Xcode Project
name: Xcode Project
on: push

jobs:
Expand All @@ -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: |
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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: |
Expand Down
2 changes: 2 additions & 0 deletions ProtocolProxy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<group>"; };
DDA26DBD256EA4D700E1C6D7 /* workflows */ = {isa = PBXFileReference; lastKnownFileType = folder; name = workflows; path = .github/workflows; sourceTree = "<group>"; };
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; };
Expand Down Expand Up @@ -314,6 +315,7 @@
DDF756A622AA77C1002E11D4 /* Supporting Files */ = {
isa = PBXGroup;
children = (
DD17A9F9257744BC00D30599 /* scripts */,
DDA26DBD256EA4D700E1C6D7 /* workflows */,
DDF756A822AA77DE002E11D4 /* ProtocolProxy.podspec */,
DDA15DEE25644F680036D007 /* Package.swift */,
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 22 additions & 0 deletions scripts/carthage.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"