Skip to content

Commit 852d099

Browse files
Merge pull request #2 from SomeRandomiOSDev/carthage
Minor updates to existing workflows/README; added a new workflow for build Carthage
2 parents b2ae793 + fb6e635 commit 852d099

File tree

7 files changed

+70
-11
lines changed

7 files changed

+70
-11
lines changed

.github/workflows/carthage.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Carthage
2+
on: push
3+
4+
jobs:
5+
build:
6+
name: Build
7+
runs-on: macOS-latest
8+
steps:
9+
- name: Checkout Code
10+
uses: actions/checkout@v2
11+
12+
- name: Install Carthage
13+
run: |
14+
brew update
15+
brew install carthage
16+
17+
- name: Create Cartfile
18+
run: |
19+
# Delete all of the old tags (if any) and create a new tag for building
20+
git tag | xargs git tag -d
21+
git tag 1.0
22+
23+
echo "git \"file://$(pwd)\"" > ./Cartfile
24+
25+
- name: Build
26+
run: |
27+
./scripts/carthage.sh update

.github/workflows/cocoapods.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ jobs:
1414
with:
1515
version: latest
1616

17-
- name: Lint
17+
- name: Lint (Dynamic Library)
1818
run: |
1919
pod lib lint
20+
21+
- name: Lint (Static Library)
22+
run: |
23+
pod lib lint --use-libraries

.github/workflows/swift-pacakge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Swift Package
1+
name: Swift Package
22
on: push
33

44
jobs:

.github/workflows/xcodebuild.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Xcode Project
1+
name: Xcode Project
22
on: push
33

44
jobs:
@@ -12,11 +12,11 @@ jobs:
1212

1313
- name: Build iOS
1414
run: |
15-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphoneos -configuration Debug ONLY_ACTIVE_ARCH=YES
15+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphoneos -configuration Debug
1616
1717
- name: Build iOS Simulator
1818
run: |
19-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphonesimulator -configuration Debug ONLY_ACTIVE_ARCH=YES
19+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphonesimulator -configuration Debug
2020
2121
- name: Test
2222
run: |
@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: Build
3434
run: |
35-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk macosx -configuration Debug ONLY_ACTIVE_ARCH=YES
35+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk macosx -configuration Debug
3636
3737
- name: Test
3838
run: |
@@ -48,11 +48,11 @@ jobs:
4848

4949
- name: Build
5050
run: |
51-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug ONLY_ACTIVE_ARCH=YES
51+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug
5252
5353
- name: Test
5454
run: |
55-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug ONLY_ACTIVE_ARCH=YES test
55+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug test
5656
5757
tvos:
5858
name: tvOS
@@ -64,11 +64,11 @@ jobs:
6464

6565
- name: Build tvOS
6666
run: |
67-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvos -configuration Debug ONLY_ACTIVE_ARCH=YES
67+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvos -configuration Debug
6868
6969
- name: Build tvOS Simulator
7070
run: |
71-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvsimulator -configuration Debug ONLY_ACTIVE_ARCH=YES
71+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvsimulator -configuration Debug
7272
7373
- name: Test
7474
run: |

ProtocolProxy.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
DDA15DEC25644F580036D007 /* ProtocolProxy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = "ProtocolProxy-Info.plist"; path = "Plists/ProtocolProxy-Info.plist"; sourceTree = SOURCE_ROOT; };
101101
DDA15DED25644F580036D007 /* ProtocolProxyTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = "ProtocolProxyTests-Info.plist"; path = "Plists/ProtocolProxyTests-Info.plist"; sourceTree = SOURCE_ROOT; };
102102
DDA15DEE25644F680036D007 /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = SOURCE_ROOT; };
103+
DD17A9F9257744BC00D30599 /* scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = scripts; sourceTree = "<group>"; };
103104
DDA26DBD256EA4D700E1C6D7 /* workflows */ = {isa = PBXFileReference; lastKnownFileType = folder; name = workflows; path = .github/workflows; sourceTree = "<group>"; };
104105
DDF7567322AA773D002E11D4 /* ProtocolProxy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ProtocolProxy.framework; sourceTree = BUILT_PRODUCTS_DIR; };
105106
DDF7567C22AA773D002E11D4 /* ProtocolProxyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ProtocolProxyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -314,6 +315,7 @@
314315
DDF756A622AA77C1002E11D4 /* Supporting Files */ = {
315316
isa = PBXGroup;
316317
children = (
318+
DD17A9F9257744BC00D30599 /* scripts */,
317319
DDA26DBD256EA4D700E1C6D7 /* workflows */,
318320
DDF756A822AA77DE002E11D4 /* ProtocolProxy.podspec */,
319321
DDA15DEE25644F680036D007 /* Package.swift */,

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ Flexible proxy for overriding and observing protocol method/property messages.
66
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/ProtocolProxy.svg)](https://cocoapods.org/pods/ProtocolProxy)
77
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
88
[![Platform](https://img.shields.io/cocoapods/p/ProtocolProxy.svg)](https://cocoapods.org/pods/ProtocolProxy)
9-
[![Build](https://travis-ci.com/SomeRandomiOSDev/ProtocolProxy.svg?branch=master)](https://travis-ci.com/SomeRandomiOSDev/ProtocolProxy)
109
[![Code Coverage](https://codecov.io/gh/SomeRandomiOSDev/ProtocolProxy/branch/master/graph/badge.svg)](https://codecov.io/gh/SomeRandomiOSDev/ProtocolProxy)
1110

11+
![Swift Package](https://github.com/SomeRandomiOSDev/ProtocolProxy/workflows/Swift%20Package/badge.svg)
12+
![Xcode Project](https://github.com/SomeRandomiOSDev/ProtocolProxy/workflows/Xcode%20Project/badge.svg)
13+
![Cocoapods](https://github.com/SomeRandomiOSDev/ProtocolProxy/workflows/Cocoapods/badge.svg)
14+
![Carthage](https://github.com/SomeRandomiOSDev/ProtocolProxy/workflows/Carthage/badge.svg)
15+
1216
## Purpose
1317

1418
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.

scripts/carthage.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
# Needed to circumvent a current issue with Carthage: https://github.com/Carthage/Carthage/issues/3019
4+
#
5+
# carthage.sh
6+
# Usage example: ./carthage.sh build --platform iOS
7+
8+
set -euo pipefail
9+
10+
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
11+
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
12+
13+
# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
14+
# the build will fail on lipo due to duplicate architectures.
15+
for simulator in iphonesimulator appletvsimulator; do
16+
echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_${simulator}__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig
17+
done
18+
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(PLATFORM_NAME)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig
19+
20+
export XCODE_XCCONFIG_FILE="$xcconfig"
21+
cat $XCODE_XCCONFIG_FILE
22+
carthage "$@"

0 commit comments

Comments
 (0)