Skip to content

Commit d546f11

Browse files
Regenerated project using the latest from [ProjectTemplate](https://github.com/SomeRandomiOSDev/ProjectTemplate)
1 parent eafb011 commit d546f11

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

+1877
-737
lines changed

.github/workflows/carthage.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
name: Carthage
2-
on: [push, workflow_dispatch]
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags-ignore:
6+
- **
7+
paths-ignore:
8+
- .gitignore
9+
- LICENSE
10+
- README.md
311

412
jobs:
513
build:

.github/workflows/cocoapods.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
name: Cocoapods
2-
on: [push, workflow_dispatch]
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags-ignore:
6+
- **
7+
paths-ignore:
8+
- .gitignore
9+
- LICENSE
10+
- README.md
311

412
jobs:
513
lint:
14+
strategy:
15+
matrix:
16+
linttype: [Dynamic, Static]
17+
618
name: Lint
719
runs-on: macOS-latest
20+
env:
21+
LINT_TYPE: ${{ matrix.linttype }}
22+
823
steps:
924
- name: Checkout Code
1025
uses: actions/checkout@v2
@@ -14,10 +29,10 @@ jobs:
1429
with:
1530
version: latest
1631

17-
- name: Lint (Dynamic Library)
18-
run: |
19-
pod lib lint --skip-tests
20-
21-
- name: Lint (Static Library)
32+
- name: Lint
2233
run: |
23-
pod lib lint --use-libraries --skip-tests
34+
if [ "$LINT_TYPE" == "Dynamic" ]; then
35+
pod lib lint
36+
else
37+
pod lib lint --use-libraries
38+
fi
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish CocoaPods
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish:
8+
name: Publish CocoaPods
9+
runs-on: macOS-latest
10+
env:
11+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
12+
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v2
16+
17+
- name: Setup CocoaPods
18+
uses: maxim-lobanov/setup-cocoapods@v1
19+
with:
20+
version: latest
21+
22+
- name: Publish CocoaPod
23+
run: |
24+
pod trunk push KeyValueObservation.podspec

.github/workflows/upload-assets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
- name: Build
1818
run: |
19-
./scripts/xcframework.sh -output ${TMPDIR}/KeyValueObservation.xcframework
19+
./scripts/xcframework.sh --output ${TMPDIR}/KeyValueObservation.xcframework
2020
2121
- name: Create Zip
2222
run: |

.github/workflows/xcframework.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
name: XCFramework
2-
on: [push, workflow_dispatch]
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags-ignore:
6+
- **
7+
paths-ignore:
8+
- .gitignore
9+
- LICENSE
10+
- README.md
311

412
jobs:
513
build:
@@ -14,4 +22,4 @@ jobs:
1422

1523
- name: Build
1624
run: |
17-
./scripts/xcframework.sh -output ${TMPDIR}/KeyValueObservation.xcframework
25+
./scripts/xcframework.sh --output ${TMPDIR}/KeyValueObservation.xcframework

.github/workflows/xcodebuild.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
name: Xcode Project
2-
on: [push, workflow_dispatch]
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags-ignore:
6+
- **
7+
paths-ignore:
8+
- .gitignore
9+
- LICENSE
10+
- README.md
311

412
jobs:
513
ios:
@@ -20,7 +28,12 @@ jobs:
2028
2129
- name: Test
2230
run: |
23-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -testPlan "KeyValueObservationTests" -destination "platform=iOS Simulator,name=iPhone 12 Pro Max" -configuration Debug ONLY_ACTIVE_ARCH=YES test
31+
IOS_SIM="$(xcrun simctl list devices available | grep "iPhone [0-9]" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
32+
if [ "${#IOS_SIM}" == "0" ]; then
33+
IOS_SIM = "iPhone 12 Pro" # Fallback Simulator
34+
fi
35+
36+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -testPlan "KeyValueObservationTests" -destination "platform=iOS Simulator,name=$IOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test
2437
2538
maccatalyst:
2639
name: Mac Catalyst
@@ -52,13 +65,21 @@ jobs:
5265
5366
- name: Test
5467
run: |
55-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation macOS" -testPlan "KeyValueObservation macOS Tests" -configuration Debug -enableCodeCoverage YES test
68+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation macOS" -testPlan "KeyValueObservation macOS Tests" -derivedDataPath ".xcodebuild" -configuration Debug ONLY_ACTIVE_ARCH=YES test
69+
70+
- name: Generate Code Coverage File
71+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
72+
run: |
73+
PROFDATA_FILE="$(find .xcodebuild -name "*.profdata")"
74+
75+
xcrun llvm-cov export --format=lcov --instr-profile="$PROFDATA_FILE" ".xcodebuild/Build/Products/Debug/KeyValueObservationTests.xctest/Contents/MacOS/KeyValueObservationTests" > "./codecov.lcov"
5676
5777
- name: Upload Code Coverage
5878
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
5979
uses: codecov/codecov-action@v2
6080
with:
6181
token: ${{ secrets.CODECOV_TOKEN }}
82+
file: ./codecov.lcov
6283
verbose: true
6384

6485
tvos:
@@ -79,7 +100,12 @@ jobs:
79100
80101
- name: Test
81102
run: |
82-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -testPlan "KeyValueObservation tvOS Tests" -destination "platform=tvOS Simulator,name=Apple TV 4K" -configuration Debug ONLY_ACTIVE_ARCH=YES test
103+
TVOS_SIM="$(xcrun simctl list devices available | grep "Apple TV" | sort -V | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
104+
if [ "${#TVOS_SIM}" == "0" ]; then
105+
TVOS_SIM = "Apple TV" # Fallback Simulator
106+
fi
107+
108+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -testPlan "KeyValueObservation tvOS Tests" -destination "platform=tvOS Simulator,name=$TVOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test
83109
84110
watchos:
85111
name: watchOS
@@ -99,4 +125,9 @@ jobs:
99125
100126
- name: Test
101127
run: |
102-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -testPlan "KeyValueObservation watchOS Tests" -destination "platform=watchOS Simulator,name=Apple Watch Series 6 - 44mm" -configuration Debug ONLY_ACTIVE_ARCH=YES test
128+
WATCHOS_SIM="$(xcrun simctl list devices available | grep "Apple Watch" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
129+
if [ "${#WATCHOS_SIM}" == "0" ]; then
130+
WATCHOS_SIM = "Apple Watch Series 6 - 44mm" # Fallback Simulator
131+
fi
132+
133+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -testPlan "KeyValueObservation watchOS Tests" -destination "platform=watchOS Simulator,name=$WATCHOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
KeyValueObservation.xcodeproj/project.xcworkspace
22
KeyValueObservation.xcodeproj/xcuserdata
3+
4+
.xcodebuild
5+
scripts/build

KeyValueObservation.modulemap

Lines changed: 0 additions & 6 deletions
This file was deleted.

KeyValueObservation.podspec

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
Pod::Spec.new do |s|
2-
3-
s.name = "KeyValueObservation"
4-
s.version = "1.0.4"
5-
s.summary = "A small KVO helper library"
6-
s.description = <<-DESC
7-
A small KVO helper library that provides a NSObject and a NSArray category for observing key value changes using blocks
8-
DESC
9-
10-
s.homepage = "https://github.com/SomeRandomiOSDev/KeyValueObservation"
11-
s.license = "MIT"
12-
s.author = { "Joe Newton" => "somerandomiosdev@gmail.com" }
2+
3+
s.name = "KeyValueObservation"
4+
s.version = "1.0.5"
5+
s.summary = "A small KVO helper library"
6+
s.description = <<-DESC
7+
A small KVO helper library that provides a NSObject and a NSArray category for observing key value changes using blocks
8+
DESC
9+
10+
s.homepage = "https://github.com/SomeRandomiOSDev/KeyValueObservation"
11+
s.license = "MIT"
12+
s.author = { "Joe Newton" => "somerandomiosdev@gmail.com" }
13+
s.source = { :git => "https://github.com/SomeRandomiOSDev/KeyValueObservation.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/KeyValueObservation.git", :tag => s.version.to_s }
20+
s.source_files = 'Sources/KeyValueObservation/**/*.{h,m}'
21+
s.public_header_files = 'Sources/KeyValueObservation/include/*.h'
2022

21-
s.test_spec do |ts|
22-
ts.source_files = 'Tests/KeyValueObservationTests/*.m'
23-
end
23+
s.test_spec 'Tests' do |ts|
24+
ts.ios.deployment_target = '9.0'
25+
ts.macos.deployment_target = '10.10'
26+
ts.tvos.deployment_target = '9.0'
27+
ts.watchos.deployment_target = '2.0'
2428

25-
s.public_header_files = 'Sources/KeyValueObservation/NSObject+KeyValueObservation.h', 'Sources/KeyValueObservation/NSArray+KeyValueObservation.h', 'Sources/KeyValueObservation/SRDKeyValueObservation.h', 'Sources/KeyValueObservation/SRDKeyValueObservedChange.h', 'Sources/KeyValueObservation/SRDKVOInfo.h'
26-
s.source_files = 'Sources/KeyValueObservation/**/*.{h,m}'
27-
s.frameworks = 'Foundation'
28-
s.requires_arc = true
29+
ts.pod_target_xcconfig = { 'HEADER_SEARCH_PATHS' => '${PODS_TARGET_SRCROOT}/Sources/KeyValueObservation/include' }
30+
ts.preserve_paths = 'Sources/KeyValueObservation/include/*.modulemap'
31+
ts.source_files = 'Tests/KeyValueObservationTests/*.m'
32+
end
2933

3034
end

0 commit comments

Comments
 (0)