Skip to content

Commit eafb011

Browse files
Merge pull request #5 from SomeRandomiOSDev/Modernize
Moderized the project, updated copyrights and other miscellaneous pieces, migrated to test plans, and added support for watchOS unit tests
2 parents c3d10a3 + 5aa132d commit eafb011

Some content is hidden

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

41 files changed

+968
-211
lines changed

.github/workflows/carthage.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Carthage
2+
on: [push, workflow_dispatch]
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

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Cocoapods
2+
on: [push, workflow_dispatch]
3+
4+
jobs:
5+
lint:
6+
name: Lint
7+
runs-on: macOS-latest
8+
steps:
9+
- name: Checkout Code
10+
uses: actions/checkout@v2
11+
12+
- name: Setup Cocoapods
13+
uses: maxim-lobanov/setup-cocoapods@v1
14+
with:
15+
version: latest
16+
17+
- name: Lint (Dynamic Library)
18+
run: |
19+
pod lib lint --skip-tests
20+
21+
- name: Lint (Static Library)
22+
run: |
23+
pod lib lint --use-libraries --skip-tests

.github/workflows/upload-assets.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Upload Assets
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
build:
8+
name: Upload Assets
9+
runs-on: macOS-latest
10+
env:
11+
TMPDIR: /tmp/.keyvalueobservation.xcframework.build
12+
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v2
16+
17+
- name: Build
18+
run: |
19+
./scripts/xcframework.sh -output ${TMPDIR}/KeyValueObservation.xcframework
20+
21+
- name: Create Zip
22+
run: |
23+
cd ${TMPDIR}
24+
zip -rX KeyValueObservation.xcframework.zip KeyValueObservation.xcframework
25+
26+
- name: Upload Zip
27+
uses: actions/upload-release-asset@v1
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
with:
31+
upload_url: ${{ github.event.release.upload_url }}
32+
asset_path: ${{ env.TMPDIR }}/KeyValueObservation.xcframework.zip
33+
asset_name: KeyValueObservation.xcframework.zip
34+
asset_content_type: application/zip
35+
36+
- name: Create Tar
37+
run: |
38+
cd ${TMPDIR}
39+
tar -zcvf KeyValueObservation.xcframework.tar.gz KeyValueObservation.xcframework
40+
41+
- name: Upload Tar
42+
uses: actions/upload-release-asset@v1
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
with:
46+
upload_url: ${{ github.event.release.upload_url }}
47+
asset_path: ${{ env.TMPDIR }}/KeyValueObservation.xcframework.tar.gz
48+
asset_name: KeyValueObservation.xcframework.tar.gz
49+
asset_content_type: application/gzip

.github/workflows/xcframework.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: XCFramework
2+
on: [push, workflow_dispatch]
3+
4+
jobs:
5+
build:
6+
name: Build
7+
runs-on: macOS-latest
8+
env:
9+
TMPDIR: /tmp/.keyvalueobservation.xcframework.build
10+
11+
steps:
12+
- name: Checkout Code
13+
uses: actions/checkout@v2
14+
15+
- name: Build
16+
run: |
17+
./scripts/xcframework.sh -output ${TMPDIR}/KeyValueObservation.xcframework

.github/workflows/xcodebuild.yml

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Xcode Project
2+
on: [push, workflow_dispatch]
3+
4+
jobs:
5+
ios:
6+
name: iOS
7+
runs-on: macOS-latest
8+
9+
steps:
10+
- name: Checkout Code
11+
uses: actions/checkout@v2
12+
13+
- name: Build iOS
14+
run: |
15+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=iOS" -configuration Debug
16+
17+
- name: Build iOS Simulator
18+
run: |
19+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=iOS Simulator" -configuration Debug
20+
21+
- name: Test
22+
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
24+
25+
maccatalyst:
26+
name: Mac Catalyst
27+
runs-on: macOS-latest
28+
29+
steps:
30+
- name: Checkout Code
31+
uses: actions/checkout@v2
32+
33+
- name: Build
34+
run: |
35+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug
36+
37+
- name: Test
38+
run: |
39+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -testPlan "KeyValueObservationTests" -destination "platform=macOS,variant=Mac Catalyst" -configuration Debug ONLY_ACTIVE_ARCH=YES test
40+
41+
macos:
42+
name: macOS
43+
runs-on: macOS-latest
44+
45+
steps:
46+
- name: Checkout Code
47+
uses: actions/checkout@v2
48+
49+
- name: Build
50+
run: |
51+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation macOS" -destination "generic/platform=macOS" -configuration Debug
52+
53+
- name: Test
54+
run: |
55+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation macOS" -testPlan "KeyValueObservation macOS Tests" -configuration Debug -enableCodeCoverage YES test
56+
57+
- name: Upload Code Coverage
58+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
59+
uses: codecov/codecov-action@v2
60+
with:
61+
token: ${{ secrets.CODECOV_TOKEN }}
62+
verbose: true
63+
64+
tvos:
65+
name: tvOS
66+
runs-on: macOS-latest
67+
68+
steps:
69+
- name: Checkout Code
70+
uses: actions/checkout@v2
71+
72+
- name: Build tvOS
73+
run: |
74+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -destination "generic/platform=tvOS" -configuration Debug
75+
76+
- name: Build tvOS Simulator
77+
run: |
78+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug
79+
80+
- name: Test
81+
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
83+
84+
watchos:
85+
name: watchOS
86+
runs-on: macOS-11
87+
88+
steps:
89+
- name: Checkout Code
90+
uses: actions/checkout@v2
91+
92+
- name: Build watchOS
93+
run: |
94+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -destination "generic/platform=watchOS" -configuration Debug
95+
96+
- name: Build watchOS Simulator
97+
run: |
98+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug
99+
100+
- name: Test
101+
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

.travis.yml

-17
This file was deleted.

KeyValueObservation.podspec

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
Pod::Spec.new do |s|
22

33
s.name = "KeyValueObservation"
4-
s.version = "1.0.3"
4+
s.version = "1.0.4"
55
s.summary = "A small KVO helper library"
66
s.description = <<-DESC
77
A small KVO helper library that provides a NSObject and a NSArray category for observing key value changes using blocks
88
DESC
99

1010
s.homepage = "https://github.com/SomeRandomiOSDev/KeyValueObservation"
1111
s.license = "MIT"
12-
s.author = { "Joseph Newton" => "[email protected]" }
12+
s.author = { "Joe Newton" => "[email protected]" }
1313

14-
s.ios.deployment_target = '8.0'
14+
s.ios.deployment_target = '9.0'
1515
s.macos.deployment_target = '10.10'
1616
s.tvos.deployment_target = '9.0'
1717
s.watchos.deployment_target = '2.0'
1818

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

21-
s.public_header_files = 'KeyValueObservation/NSObject+KeyValueObservation.h', 'KeyValueObservation/NSArray+KeyValueObservation.h', 'KeyValueObservation/SRDKeyValueObservation.h', 'KeyValueObservation/SRDKeyValueObservedChange.h', 'KeyValueObservation/SRDKVOInfo.h'
22-
s.source_files = 'KeyValueObservation/**/*.{h,m}'
21+
s.test_spec do |ts|
22+
ts.source_files = 'Tests/KeyValueObservationTests/*.m'
23+
end
24+
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}'
2327
s.frameworks = 'Foundation'
2428
s.requires_arc = true
2529

0 commit comments

Comments
 (0)