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
2 changes: 1 addition & 1 deletion .github/workflows/carthage.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Carthage
on: push
on: [push, workflow_dispatch]

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cocoapods.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Cocoapods
on: push
on: [push, workflow_dispatch]

jobs:
lint:
name: Lint
runs-on: macOS-latest
runs-on: macOS-11
steps:
- name: Checkout Code
uses: actions/checkout@v2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/swift-pacakge.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Swift Package
on: push
on: [push, workflow_dispatch]

jobs:
build:
Expand Down Expand Up @@ -31,12 +31,12 @@ jobs:
- name: Generate Code Coverage File
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
xcrun llvm-cov export --instr-profile=.build/x86_64-apple-macosx/debug/codecov/default.profdata .build/x86_64-apple-macosx/debug/ProtocolProxyPackageTests.xctest/Contents/MacOS/ProtocolProxyPackageTests > ./info.lcov
xcrun llvm-cov export --format=lcov --instr-profile=.build/debug/codecov/default.profdata .build/debug/ProtocolProxyPackageTests.xctest/Contents/MacOS/ProtocolProxyPackageTests > ./codecov.lcov

- name: Upload Code Coverage
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./info.lcov
files: ./codecov.lcov
verbose: true
15 changes: 15 additions & 0 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: SwiftLint
on: [push, workflow_dispatch]

jobs:
build:
name: Run SwiftLint
runs-on: macOS-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Run SwiftLint
run: |
swiftlint lint --reporter github-actions-logging
2 changes: 1 addition & 1 deletion .github/workflows/xcframework.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: XCFramework
on: push
on: [push, workflow_dispatch]

jobs:
build:
Expand Down
47 changes: 33 additions & 14 deletions .github/workflows/xcodebuild.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Xcode Project
on: push
on: [push, workflow_dispatch]

jobs:
ios:
Expand All @@ -12,15 +12,20 @@ jobs:

- name: Build iOS
run: |
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphoneos -configuration Debug
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "generic/platform=iOS" -configuration Debug

- name: Build iOS Simulator
run: |
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphonesimulator -configuration Debug
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "generic/platform=iOS Simulator" -configuration Debug

- name: Test
run: |
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "platform=iOS Simulator,name=iPhone 11 Pro Max" -configuration Debug ONLY_ACTIVE_ARCH=YES test
IOS_SIM="$(xcrun simctl list devices available | grep "iPhone [0-9]" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
if [ "${#IOS_SIM}" == "0" ]; then
IOS_SIM = "iPhone 12 Pro" # Fallback Simulator
fi

xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -testPlan "ProtocolProxyTests" -destination "platform=iOS Simulator,name=$IOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test

maccatalyst:
name: Mac Catalyst
Expand All @@ -32,11 +37,11 @@ jobs:

- name: Build
run: |
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk macosx -configuration Debug
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug

- name: Test
run: |
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "platform=macOS" -configuration Debug ONLY_ACTIVE_ARCH=YES test
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -testPlan "ProtocolProxyTests" -destination "platform=macOS,variant=Mac Catalyst" -configuration Debug ONLY_ACTIVE_ARCH=YES test

macos:
name: macOS
Expand All @@ -48,11 +53,11 @@ jobs:

- name: Build
run: |
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -destination "generic/platform=macOS" -configuration Debug

- name: Test
run: |
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug test
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -testPlan "ProtocolProxy macOS Tests" -configuration Debug ONLY_ACTIVE_ARCH=YES test

tvos:
name: tvOS
Expand All @@ -64,28 +69,42 @@ jobs:

- name: Build tvOS
run: |
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvos -configuration Debug
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -destination "generic/platform=tvOS" -configuration Debug

- name: Build tvOS Simulator
run: |
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvsimulator -configuration Debug
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug

- name: Test
run: |
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -destination "platform=tvOS Simulator,name=Apple TV 4K" -configuration Debug ONLY_ACTIVE_ARCH=YES test
TVOS_SIM="$(xcrun simctl list devices available | grep "Apple TV" | sort -V | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
if [ "${#TVOS_SIM}" == "0" ]; then
TVOS_SIM = "Apple TV" # Fallback Simulator
fi

xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -testPlan "ProtocolProxy tvOS Tests" -destination "platform=tvOS Simulator,name=$TVOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test

watchos:
name: watchOS
runs-on: macOS-latest
runs-on: macOS-11

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Build watchOS
run: |
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -sdk watchos -configuration Debug
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -destination "generic/platform=watchOS" -configuration Debug

- name: Build watchOS Simulator
run: |
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -sdk watchsimulator -configuration Debug
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug

- name: Test
run: |
WATCHOS_SIM="$(xcrun simctl list devices available | grep "Apple Watch" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
if [ "${#WATCHOS_SIM}" == "0" ]; then
WATCHOS_SIM = "Apple Watch Series 6 - 44mm" # Fallback Simulator
fi

xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -testPlan "ProtocolProxy watchOS Tests" -destination "platform=watchOS Simulator,name=$WATCHOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test
66 changes: 66 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
disabled_rules:
- file_length
- line_length
- cyclomatic_complexity
- type_body_length
- type_name

opt_in_rules:
- anyobject_protocol
- array_init
- closure_end_indentation
- closure_spacing
- contains_over_first_not_nil
- discouraged_optional_boolean
- discouraged_optional_collection
- empty_count
- empty_string
- empty_xctest_method
- explicit_init
- fallthrough
- first_where
- force_unwrapping
- function_default_parameter_at_end
- inert_defer
- no_extension_access_modifier
- overridden_super_call
- prohibited_super_call
- redundant_nil_coalescing
- vertical_parameter_alignment_on_call
- pattern_matching_keywords
- fatal_error_message
- implicitly_unwrapped_optional
- joined_default_parameter
- let_var_whitespace
- literal_expression_end_indentation
- lower_acl_than_parent
- modifier_order
- multiline_arguments
- multiline_function_chains
- multiline_parameters
- multiple_closures_with_trailing_closure
- nesting
- notification_center_detachment
- number_separator
- object_literal
- operator_usage_whitespace
- override_in_extension
- private_action
- private_outlet
- redundant_type_annotation
- single_test_class
- sorted_imports
- sorted_first_last
- trailing_closure
- unavailable_function
- unneeded_parentheses_in_closure_argument
- yoda_condition

reporter: "xcode"

function_body_length:
- 60 #warning

identifier_name:
excluded:
- i
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2020 Joseph Newton <somerandomiosdev@gmail.com>
Copyright (c) 2021 Joe Newton <somerandomiosdev@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 4 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let package = Package(
],

products: [
.library(name: "ProtocolProxy", targets: ["ProtocolProxy", "ProtocolProxySwift"]),
.library(name: "ProtocolProxy", targets: ["ProtocolProxy", "ProtocolProxySwift"])
],

targets: [
Expand All @@ -22,5 +22,7 @@ let package = Package(
.target(name: "ProtocolProxyTestsBase", path: "Tests/ProtocolProxyTestsBase"),
.testTarget(name: "ProtocolProxyObjCTests", dependencies: ["ProtocolProxy", "ProtocolProxySwift", "ProtocolProxyTestsBase"]),
.testTarget(name: "ProtocolProxySwiftTests", dependencies: ["ProtocolProxy", "ProtocolProxySwift", "ProtocolProxyTestsBase"])
]
],

swiftLanguageVersions: [.version("5")]
)
2 changes: 1 addition & 1 deletion Plists/ProtocolProxy-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
Expand Down
10 changes: 5 additions & 5 deletions Plists/ProtocolProxyTests-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
44 changes: 27 additions & 17 deletions ProtocolProxy.podspec
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
Pod::Spec.new do |s|

s.name = "ProtocolProxy"
s.version = "0.1.0"
s.summary = "Flexible proxy for overriding and observing protocol method/property messages"
s.description = <<-DESC
A small helper library that provides a proxy class for overriding and observing method and property messages from one or more protocols
DESC

s.homepage = "https://github.com/SomeRandomiOSDev/ProtocolProxy"
s.license = "MIT"
s.author = { "Joseph Newton" => "somerandomiosdev@gmail.com" }

s.name = "ProtocolProxy"
s.version = "0.1.1"
s.summary = "Flexible proxy for overriding and observing protocol method/property messages"
s.description = <<-DESC
A small helper library that provides a proxy class for overriding and observing method and property messages from one or more protocols
DESC

s.homepage = "https://github.com/SomeRandomiOSDev/ProtocolProxy"
s.license = "MIT"
s.author = { "Joe Newton" => "somerandomiosdev@gmail.com" }
s.source = { :git => "https://github.com/SomeRandomiOSDev/ProtocolProxy.git", :tag => s.version.to_s }

s.ios.deployment_target = '9.0'
s.macos.deployment_target = '10.10'
s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0'

s.source = { :git => "https://github.com/SomeRandomiOSDev/ProtocolProxy.git", :tag => s.version.to_s }

s.public_header_files = 'Sources/ProtocolProxy/include/ProtocolProxy.h'
s.source_files = 'Sources/ProtocolProxy/**/*.{h,m,swift}', 'Sources/ProtocolProxySwift/**/*.swift'
s.frameworks = 'Foundation'
s.requires_arc = true

s.source_files = 'Sources/ProtocolProxy/**/*.{h,m}', 'Sources/ProtocolProxySwift/*.swift'
s.swift_versions = ['5.0']
s.cocoapods_version = '>= 1.7.3'

s.test_spec 'Tests' do |ts|
ts.ios.deployment_target = '9.0'
ts.macos.deployment_target = '10.10'
ts.tvos.deployment_target = '9.0'
ts.watchos.deployment_target = '2.0'

ts.pod_target_xcconfig = { 'SWIFT_INCLUDE_PATHS' => '$PODS_TARGET_SRCROOT/Tests/ProtocolProxyTestsBase/include',
'HEADER_SEARCH_PATHS' => '$PODS_TARGET_SRCROOT/Tests/ProtocolProxyTestsBase/include' }
ts.preserve_paths = 'Tests/ProtocolProxyTestsBase/include/module.modulemap'
ts.source_files = 'Tests/ProtocolProxyObjCTests/*.m',
'Tests/ProtocolProxySwiftTests/*.swift',
'Tests/ProtocolProxyTestsBase/**/*{h,m}'
end

end
Loading