Skip to content

Commit 83460e3

Browse files
Merge pull request #8 from SomeRandomiOSDev/Modernize
Modernized the project
2 parents ab4d727 + fce9165 commit 83460e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2620
-1524
lines changed

.github/workflows/carthage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Carthage
2-
on: push
2+
on: [push, workflow_dispatch]
33

44
jobs:
55
build:

.github/workflows/cocoapods.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: Cocoapods
2-
on: push
2+
on: [push, workflow_dispatch]
33

44
jobs:
55
lint:
66
name: Lint
7-
runs-on: macOS-latest
7+
runs-on: macOS-11
88
steps:
99
- name: Checkout Code
1010
uses: actions/checkout@v2

.github/workflows/swift-pacakge.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Swift Package
2-
on: push
2+
on: [push, workflow_dispatch]
33

44
jobs:
55
build:
@@ -31,12 +31,12 @@ jobs:
3131
- name: Generate Code Coverage File
3232
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
3333
run: |
34-
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
34+
xcrun llvm-cov export --format=lcov --instr-profile=.build/debug/codecov/default.profdata .build/debug/ProtocolProxyPackageTests.xctest/Contents/MacOS/ProtocolProxyPackageTests > ./codecov.lcov
3535
3636
- name: Upload Code Coverage
3737
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
38-
uses: codecov/codecov-action@v1
38+
uses: codecov/codecov-action@v2
3939
with:
4040
token: ${{ secrets.CODECOV_TOKEN }}
41-
file: ./info.lcov
41+
files: ./codecov.lcov
4242
verbose: true

.github/workflows/swiftlint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: SwiftLint
2+
on: [push, workflow_dispatch]
3+
4+
jobs:
5+
build:
6+
name: Run SwiftLint
7+
runs-on: macOS-latest
8+
9+
steps:
10+
- name: Checkout Code
11+
uses: actions/checkout@v2
12+
13+
- name: Run SwiftLint
14+
run: |
15+
swiftlint lint --reporter github-actions-logging

.github/workflows/xcframework.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: XCFramework
2-
on: push
2+
on: [push, workflow_dispatch]
33

44
jobs:
55
build:

.github/workflows/xcodebuild.yml

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Xcode Project
2-
on: push
2+
on: [push, workflow_dispatch]
33

44
jobs:
55
ios:
@@ -12,15 +12,20 @@ jobs:
1212

1313
- name: Build iOS
1414
run: |
15-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphoneos -configuration Debug
15+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "generic/platform=iOS" -configuration Debug
1616
1717
- name: Build iOS Simulator
1818
run: |
19-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphonesimulator -configuration Debug
19+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "generic/platform=iOS Simulator" -configuration Debug
2020
2121
- name: Test
2222
run: |
23-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "platform=iOS Simulator,name=iPhone 11 Pro Max" -configuration Debug ONLY_ACTIVE_ARCH=YES test
23+
IOS_SIM="$(xcrun simctl list devices available | grep "iPhone [0-9]" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
24+
if [ "${#IOS_SIM}" == "0" ]; then
25+
IOS_SIM = "iPhone 12 Pro" # Fallback Simulator
26+
fi
27+
28+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -testPlan "ProtocolProxyTests" -destination "platform=iOS Simulator,name=$IOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test
2429
2530
maccatalyst:
2631
name: Mac Catalyst
@@ -32,11 +37,11 @@ jobs:
3237

3338
- name: Build
3439
run: |
35-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk macosx -configuration Debug
40+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug
3641
3742
- name: Test
3843
run: |
39-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "platform=macOS" -configuration Debug ONLY_ACTIVE_ARCH=YES test
44+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -testPlan "ProtocolProxyTests" -destination "platform=macOS,variant=Mac Catalyst" -configuration Debug ONLY_ACTIVE_ARCH=YES test
4045
4146
macos:
4247
name: macOS
@@ -48,11 +53,11 @@ jobs:
4853

4954
- name: Build
5055
run: |
51-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug
56+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -destination "generic/platform=macOS" -configuration Debug
5257
5358
- name: Test
5459
run: |
55-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug test
60+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -testPlan "ProtocolProxy macOS Tests" -configuration Debug ONLY_ACTIVE_ARCH=YES test
5661
5762
tvos:
5863
name: tvOS
@@ -64,28 +69,42 @@ jobs:
6469

6570
- name: Build tvOS
6671
run: |
67-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvos -configuration Debug
72+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -destination "generic/platform=tvOS" -configuration Debug
6873
6974
- name: Build tvOS Simulator
7075
run: |
71-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvsimulator -configuration Debug
76+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug
7277
7378
- name: Test
7479
run: |
75-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -destination "platform=tvOS Simulator,name=Apple TV 4K" -configuration Debug ONLY_ACTIVE_ARCH=YES test
80+
TVOS_SIM="$(xcrun simctl list devices available | grep "Apple TV" | sort -V | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
81+
if [ "${#TVOS_SIM}" == "0" ]; then
82+
TVOS_SIM = "Apple TV" # Fallback Simulator
83+
fi
84+
85+
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
7686
7787
watchos:
7888
name: watchOS
79-
runs-on: macOS-latest
89+
runs-on: macOS-11
8090

8191
steps:
8292
- name: Checkout Code
8393
uses: actions/checkout@v2
8494

8595
- name: Build watchOS
8696
run: |
87-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -sdk watchos -configuration Debug
97+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -destination "generic/platform=watchOS" -configuration Debug
8898
8999
- name: Build watchOS Simulator
90100
run: |
91-
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -sdk watchsimulator -configuration Debug
101+
xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug
102+
103+
- name: Test
104+
run: |
105+
WATCHOS_SIM="$(xcrun simctl list devices available | grep "Apple Watch" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
106+
if [ "${#WATCHOS_SIM}" == "0" ]; then
107+
WATCHOS_SIM = "Apple Watch Series 6 - 44mm" # Fallback Simulator
108+
fi
109+
110+
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

.swiftlint.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
disabled_rules:
2+
- file_length
3+
- line_length
4+
- cyclomatic_complexity
5+
- type_body_length
6+
- type_name
7+
8+
opt_in_rules:
9+
- anyobject_protocol
10+
- array_init
11+
- closure_end_indentation
12+
- closure_spacing
13+
- contains_over_first_not_nil
14+
- discouraged_optional_boolean
15+
- discouraged_optional_collection
16+
- empty_count
17+
- empty_string
18+
- empty_xctest_method
19+
- explicit_init
20+
- fallthrough
21+
- first_where
22+
- force_unwrapping
23+
- function_default_parameter_at_end
24+
- inert_defer
25+
- no_extension_access_modifier
26+
- overridden_super_call
27+
- prohibited_super_call
28+
- redundant_nil_coalescing
29+
- vertical_parameter_alignment_on_call
30+
- pattern_matching_keywords
31+
- fatal_error_message
32+
- implicitly_unwrapped_optional
33+
- joined_default_parameter
34+
- let_var_whitespace
35+
- literal_expression_end_indentation
36+
- lower_acl_than_parent
37+
- modifier_order
38+
- multiline_arguments
39+
- multiline_function_chains
40+
- multiline_parameters
41+
- multiple_closures_with_trailing_closure
42+
- nesting
43+
- notification_center_detachment
44+
- number_separator
45+
- object_literal
46+
- operator_usage_whitespace
47+
- override_in_extension
48+
- private_action
49+
- private_outlet
50+
- redundant_type_annotation
51+
- single_test_class
52+
- sorted_imports
53+
- sorted_first_last
54+
- trailing_closure
55+
- unavailable_function
56+
- unneeded_parentheses_in_closure_argument
57+
- yoda_condition
58+
59+
reporter: "xcode"
60+
61+
function_body_length:
62+
- 60 #warning
63+
64+
identifier_name:
65+
excluded:
66+
- i

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2020 Joseph Newton <[email protected]>
1+
Copyright (c) 2021 Joe Newton <[email protected]>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

Package.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let package = Package(
1212
],
1313

1414
products: [
15-
.library(name: "ProtocolProxy", targets: ["ProtocolProxy", "ProtocolProxySwift"]),
15+
.library(name: "ProtocolProxy", targets: ["ProtocolProxy", "ProtocolProxySwift"])
1616
],
1717

1818
targets: [
@@ -22,5 +22,7 @@ let package = Package(
2222
.target(name: "ProtocolProxyTestsBase", path: "Tests/ProtocolProxyTestsBase"),
2323
.testTarget(name: "ProtocolProxyObjCTests", dependencies: ["ProtocolProxy", "ProtocolProxySwift", "ProtocolProxyTestsBase"]),
2424
.testTarget(name: "ProtocolProxySwiftTests", dependencies: ["ProtocolProxy", "ProtocolProxySwift", "ProtocolProxyTestsBase"])
25-
]
25+
],
26+
27+
swiftLanguageVersions: [.version("5")]
2628
)

Plists/ProtocolProxy-Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleName</key>
1414
<string>$(PRODUCT_NAME)</string>
1515
<key>CFBundlePackageType</key>
16-
<string>FMWK</string>
16+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1717
<key>CFBundleShortVersionString</key>
1818
<string>1.0</string>
1919
<key>CFBundleVersion</key>

Plists/ProtocolProxyTests-Info.plist

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleDevelopmentRegion</key>
6-
<string>en</string>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
77
<key>CFBundleExecutable</key>
8-
<string>${EXECUTABLE_NAME}</string>
8+
<string>$(EXECUTABLE_NAME)</string>
99
<key>CFBundleIdentifier</key>
1010
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
1315
<key>CFBundlePackageType</key>
14-
<string>BNDL</string>
16+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1517
<key>CFBundleShortVersionString</key>
1618
<string>1.0</string>
17-
<key>CFBundleSignature</key>
18-
<string>????</string>
1919
<key>CFBundleVersion</key>
2020
<string>1</string>
2121
</dict>

ProtocolProxy.podspec

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,39 @@
11
Pod::Spec.new do |s|
2-
3-
s.name = "ProtocolProxy"
4-
s.version = "0.1.0"
5-
s.summary = "Flexible proxy for overriding and observing protocol method/property messages"
6-
s.description = <<-DESC
7-
A small helper library that provides a proxy class for overriding and observing method and property messages from one or more protocols
8-
DESC
9-
10-
s.homepage = "https://github.com/SomeRandomiOSDev/ProtocolProxy"
11-
s.license = "MIT"
12-
s.author = { "Joseph Newton" => "[email protected]" }
2+
3+
s.name = "ProtocolProxy"
4+
s.version = "0.1.1"
5+
s.summary = "Flexible proxy for overriding and observing protocol method/property messages"
6+
s.description = <<-DESC
7+
A small helper library that provides a proxy class for overriding and observing method and property messages from one or more protocols
8+
DESC
9+
10+
s.homepage = "https://github.com/SomeRandomiOSDev/ProtocolProxy"
11+
s.license = "MIT"
12+
s.author = { "Joe Newton" => "[email protected]" }
13+
s.source = { :git => "https://github.com/SomeRandomiOSDev/ProtocolProxy.git", :tag => s.version.to_s }
1314

1415
s.ios.deployment_target = '9.0'
1516
s.macos.deployment_target = '10.10'
1617
s.tvos.deployment_target = '9.0'
1718
s.watchos.deployment_target = '2.0'
1819

19-
s.source = { :git => "https://github.com/SomeRandomiOSDev/ProtocolProxy.git", :tag => s.version.to_s }
20-
2120
s.public_header_files = 'Sources/ProtocolProxy/include/ProtocolProxy.h'
22-
s.source_files = 'Sources/ProtocolProxy/**/*.{h,m,swift}', 'Sources/ProtocolProxySwift/**/*.swift'
23-
s.frameworks = 'Foundation'
24-
s.requires_arc = true
25-
21+
s.source_files = 'Sources/ProtocolProxy/**/*.{h,m}', 'Sources/ProtocolProxySwift/*.swift'
2622
s.swift_versions = ['5.0']
2723
s.cocoapods_version = '>= 1.7.3'
24+
25+
s.test_spec 'Tests' do |ts|
26+
ts.ios.deployment_target = '9.0'
27+
ts.macos.deployment_target = '10.10'
28+
ts.tvos.deployment_target = '9.0'
29+
ts.watchos.deployment_target = '2.0'
30+
31+
ts.pod_target_xcconfig = { 'SWIFT_INCLUDE_PATHS' => '$PODS_TARGET_SRCROOT/Tests/ProtocolProxyTestsBase/include',
32+
'HEADER_SEARCH_PATHS' => '$PODS_TARGET_SRCROOT/Tests/ProtocolProxyTestsBase/include' }
33+
ts.preserve_paths = 'Tests/ProtocolProxyTestsBase/include/module.modulemap'
34+
ts.source_files = 'Tests/ProtocolProxyObjCTests/*.m',
35+
'Tests/ProtocolProxySwiftTests/*.swift',
36+
'Tests/ProtocolProxyTestsBase/**/*{h,m}'
37+
end
2838

2939
end

0 commit comments

Comments
 (0)