Skip to content

Commit 8525685

Browse files
authored
Update CocoaPods, support new Xcode, drop iOS 11 support (#22)
* Update CocoaPods version * Change minimum deployment targets and remove tvOS and watchOS support from CocoaPods * Update CI to use Xcode 14 and 15 * Update Example project to support Xcode 15/iOS 17 * Update Dependabot to run monthly and add GitHub actions support * Remove xcpretty
1 parent 10acef5 commit 8525685

File tree

8 files changed

+144
-87
lines changed

8 files changed

+144
-87
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
version: 2
22
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: monthly
37
- package-ecosystem: bundler
48
directory: "/"
59
schedule:
6-
interval: weekly
7-
time: "10:00"
8-
timezone: Europe/London
9-
open-pull-requests-limit: 10
10-
reviewers:
11-
- liamnichols
10+
interval: monthly
1211
versioning-strategy: lockfile-only
1312
insecure-external-code-execution: allow

.github/workflows/ci.yml

Lines changed: 97 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,113 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
env:
10+
SCHEME: "swift-user-defaults"
11+
XCODEBUILD: set -o pipefail && env NSUnbufferedIO=YES xcodebuild
12+
913
jobs:
10-
build:
11-
name: Checks (Xcode ${{ matrix.xcode_version }})
12-
runs-on: macos-11
14+
test-macos:
15+
name: Test (macOS, Xcode ${{ matrix.xcode }})
16+
runs-on: ${{ matrix.macos }}
1317
env:
14-
SCHEME: "swift-user-defaults"
15-
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer'
18+
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer'
19+
strategy:
20+
matrix:
21+
xcode: [ 14.3.1, 15.2 ]
22+
include:
23+
- xcode: 14.3.1
24+
macos: macos-14
25+
- xcode: 15.2
26+
macos: macos-14
27+
steps:
28+
- name: Checkout Repo
29+
uses: actions/checkout@v4
30+
- name: Test
31+
run: ${{ env.XCODEBUILD }} -scheme "${{ env.SCHEME }}" -destination "platform=macOS" clean test | xcbeautify
1632

33+
test-ios:
34+
name: Test (iOS, Xcode ${{ matrix.xcode }})
35+
runs-on: ${{ matrix.macos }}
36+
env:
37+
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer'
1738
strategy:
1839
matrix:
19-
xcode_version: ['12.5', '13.1']
40+
xcode: [ 14.3.1, 15.2 ]
2041
include:
21-
- xcode_version: '12.5'
22-
destination_ios: 'OS=14.5,name=iPhone 12'
23-
destination_macos: 'platform=macOS'
24-
destination_watchos: 'OS=7.4,name=Apple Watch Series 6 - 44mm'
25-
destination_tvos: 'OS=14.5,name=Apple TV'
26-
- xcode_version: '13.1'
27-
destination_ios: 'OS=15.0,name=iPhone 13'
28-
destination_macos: 'platform=macOS'
29-
destination_watchos: 'OS=8.0,name=Apple Watch Series 7 - 45mm'
30-
destination_tvos: 'OS=15.0,name=Apple TV'
42+
- xcode: 14.3.1
43+
macos: macos-14
44+
destination: "platform=iOS Simulator,name=iPhone 14,OS=16.4"
45+
- xcode: 15.2
46+
macos: macos-14
47+
destination: "platform=iOS Simulator,name=iPhone 14,OS=17.2"
48+
steps:
49+
- name: Checkout Repo
50+
uses: actions/checkout@v4
51+
- name: Test
52+
run: ${{ env.XCODEBUILD }} -scheme "${{ env.SCHEME }}" -destination "${{ matrix.destination }}" clean test | xcbeautify
3153

54+
test-tvos:
55+
name: Test (tvOS, Xcode ${{ matrix.xcode }})
56+
runs-on: ${{ matrix.macos }}
57+
strategy:
58+
matrix:
59+
xcode: [ 14.3.1, 15.2 ]
60+
include:
61+
- xcode: 14.3.1
62+
macos: macos-14
63+
destination: "platform=tvOS Simulator,name=Apple TV,OS=16.4"
64+
- xcode: 15.2
65+
macos: macos-14
66+
destination: "platform=tvOS Simulator,name=Apple TV,OS=17.2"
67+
env:
68+
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer'
3269
steps:
33-
- uses: actions/checkout@v2
70+
- name: Checkout Repo
71+
uses: actions/checkout@v4
72+
- name: Test
73+
run: ${{ env.XCODEBUILD }} -scheme "${{ env.SCHEME }}" -destination "${{ matrix.destination }}" clean test | xcbeautify
3474

35-
# Setup Ruby and Bundler
75+
test-watchos:
76+
name: Test (watchOS, Xcode ${{ matrix.xcode }})
77+
runs-on: ${{ matrix.macos }}
78+
strategy:
79+
matrix:
80+
xcode: [ 14.3.1, 15.2 ]
81+
include:
82+
- xcode: 14.3.1
83+
macos: macos-14
84+
destination: "platform=watchOS Simulator,name=Apple Watch Series 8 (41mm),OS=9.4"
85+
- xcode: 15.2
86+
macos: macos-14
87+
destination: "platform=watchOS Simulator,name=Apple Watch Series 9 (41mm),OS=10.2"
88+
env:
89+
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer'
90+
steps:
91+
- name: Checkout Repo
92+
uses: actions/checkout@v4
93+
- name: Test
94+
run: ${{ env.XCODEBUILD }} -scheme "${{ env.SCHEME }}" -destination "${{ matrix.destination }}" clean test | xcbeautify
95+
96+
example:
97+
name: Example Project
98+
runs-on: macos-14
99+
env:
100+
DEVELOPER_DIR: '/Applications/Xcode_15.2.app/Contents/Developer'
101+
steps:
102+
- name: Checkout Repo
103+
uses: actions/checkout@v4
104+
- name: UI Test
105+
run: ${{ env.XCODEBUILD }} -workspace "Example/Example.xcworkspace" -scheme "Example" -destination "platform=iOS Simulator,name=iPhone 14,OS=17.2" clean test | xcbeautify
106+
107+
cocoapods:
108+
name: CocoaPods
109+
runs-on: macos-14
110+
steps:
111+
- name: Checkout Repo
112+
uses: actions/checkout@v4
36113
- name: Setup Ruby
37114
uses: ruby/setup-ruby@v1
38115
with:
39116
bundler-cache: true
40-
41-
# Build library & Run Unit-Tests (MacOS)
42-
- name: Build & Unit-Test Library (MacOS)
43-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme $SCHEME -destination "${{ matrix.destination_macos }}" clean test | bundle exec xcpretty
44-
45-
# Build library & Run Unit-Tests (iOS)
46-
- name: Build & Unit-Test Library (iOS)
47-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme $SCHEME -destination "${{ matrix.destination_ios }}" clean test | bundle exec xcpretty
48-
49-
# Build library & Run Unit-Tests (watchOS)
50-
- name: Build & Unit-Test Library (watchOS)
51-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme $SCHEME -destination "${{ matrix.destination_watchos }}" clean test | bundle exec xcpretty
52-
53-
# Build library & Run Unit-Tests (tvOS)
54-
- name: Build & Unit-Test Library (tvOS)
55-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme $SCHEME -destination "${{ matrix.destination_tvos }}" clean test | bundle exec xcpretty
56-
57-
# Build Example Project & Run UI-Tests (iOS)
58-
- name: Build & UI-Test Example Project (iOS)
59-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Example/Example.xcworkspace" -scheme "Example" -destination "${{ matrix.destination_ios }}" clean test | bundle exec xcpretty
60-
61-
# Verify CocoaPods
62-
- name: Verify CocoaPods
63-
run: bundle exec pod lib lint
117+
- name: Lint
118+
run: make lint

Example/ExampleUITests/ExampleUITests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class ExampleUITests: XCTestCase {
4141
// Type `Locale` doesn't match how we want to represent the `AppleLocale` UserDefault so we'll encode it manually
4242
var container = UserDefaults.ValueContainer()
4343
container.set(deviceLocale.identifier, forKey: UserDefaults.Key("AppleLocale"))
44+
container.set(deviceLocale.identifier, forKey: UserDefaults.Key("AppleLanguages"))
4445

4546
return container.launchArguments
4647
}

Gemfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@ source "https://rubygems.org"
22

33
# Cocoapods for iOS dependency management
44
gem 'cocoapods'
5-
6-
# XCPretty gem for ci workflow output formatting
7-
gem 'xcpretty'

Gemfile.lock

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,49 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.5)
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
57
rexml
6-
activesupport (6.1.5)
8+
activesupport (7.1.3.2)
9+
base64
10+
bigdecimal
711
concurrent-ruby (~> 1.0, >= 1.0.2)
12+
connection_pool (>= 2.2.5)
13+
drb
814
i18n (>= 1.6, < 2)
915
minitest (>= 5.1)
16+
mutex_m
1017
tzinfo (~> 2.0)
11-
zeitwerk (~> 2.3)
12-
addressable (2.8.0)
13-
public_suffix (>= 2.0.2, < 5.0)
18+
addressable (2.8.6)
19+
public_suffix (>= 2.0.2, < 6.0)
1420
algoliasearch (1.27.5)
1521
httpclient (~> 2.8, >= 2.8.3)
1622
json (>= 1.5.1)
1723
atomos (0.1.3)
24+
base64 (0.2.0)
25+
bigdecimal (3.1.7)
1826
claide (1.1.0)
19-
cocoapods (1.11.3)
27+
cocoapods (1.15.2)
2028
addressable (~> 2.8)
2129
claide (>= 1.0.2, < 2.0)
22-
cocoapods-core (= 1.11.3)
30+
cocoapods-core (= 1.15.2)
2331
cocoapods-deintegrate (>= 1.0.3, < 2.0)
24-
cocoapods-downloader (>= 1.4.0, < 2.0)
32+
cocoapods-downloader (>= 2.1, < 3.0)
2533
cocoapods-plugins (>= 1.0.0, < 2.0)
2634
cocoapods-search (>= 1.0.0, < 2.0)
27-
cocoapods-trunk (>= 1.4.0, < 2.0)
35+
cocoapods-trunk (>= 1.6.0, < 2.0)
2836
cocoapods-try (>= 1.1.0, < 2.0)
2937
colored2 (~> 3.1)
3038
escape (~> 0.0.4)
3139
fourflusher (>= 2.3.0, < 3.0)
3240
gh_inspector (~> 1.0)
3341
molinillo (~> 0.8.0)
3442
nap (~> 1.0)
35-
ruby-macho (>= 1.0, < 3.0)
36-
xcodeproj (>= 1.21.0, < 2.0)
37-
cocoapods-core (1.11.3)
38-
activesupport (>= 5.0, < 7)
43+
ruby-macho (>= 2.3.0, < 3.0)
44+
xcodeproj (>= 1.23.0, < 2.0)
45+
cocoapods-core (1.15.2)
46+
activesupport (>= 5.0, < 8)
3947
addressable (~> 2.8)
4048
algoliasearch (~> 1.0)
4149
concurrent-ruby (~> 1.1)
@@ -45,7 +53,7 @@ GEM
4553
public_suffix (~> 4.0)
4654
typhoeus (~> 1.0)
4755
cocoapods-deintegrate (1.0.5)
48-
cocoapods-downloader (1.6.3)
56+
cocoapods-downloader (2.1)
4957
cocoapods-plugins (1.0.0)
5058
nap
5159
cocoapods-search (1.0.1)
@@ -54,41 +62,41 @@ GEM
5462
netrc (~> 0.11)
5563
cocoapods-try (1.2.0)
5664
colored2 (3.1.2)
57-
concurrent-ruby (1.1.10)
65+
concurrent-ruby (1.2.3)
66+
connection_pool (2.4.1)
67+
drb (2.2.1)
5868
escape (0.0.4)
59-
ethon (0.15.0)
69+
ethon (0.16.0)
6070
ffi (>= 1.15.0)
61-
ffi (1.15.5)
71+
ffi (1.16.3)
6272
fourflusher (2.3.1)
6373
fuzzy_match (2.0.4)
6474
gh_inspector (1.1.3)
6575
httpclient (2.8.3)
66-
i18n (1.10.0)
76+
i18n (1.14.4)
6777
concurrent-ruby (~> 1.0)
68-
json (2.6.1)
69-
minitest (5.15.0)
78+
json (2.7.1)
79+
minitest (5.22.3)
7080
molinillo (0.8.0)
81+
mutex_m (0.2.0)
7182
nanaimo (0.3.0)
7283
nap (1.1.0)
7384
netrc (0.11.0)
74-
public_suffix (4.0.6)
75-
rexml (3.2.5)
76-
rouge (2.0.7)
85+
nkf (0.2.0)
86+
public_suffix (4.0.7)
87+
rexml (3.2.6)
7788
ruby-macho (2.5.1)
78-
typhoeus (1.4.0)
89+
typhoeus (1.4.1)
7990
ethon (>= 0.9.0)
80-
tzinfo (2.0.4)
91+
tzinfo (2.0.6)
8192
concurrent-ruby (~> 1.0)
82-
xcodeproj (1.21.0)
93+
xcodeproj (1.24.0)
8394
CFPropertyList (>= 2.3.3, < 4.0)
8495
atomos (~> 0.1.3)
8596
claide (>= 1.0.2, < 2.0)
8697
colored2 (~> 3.1)
8798
nanaimo (~> 0.3.0)
8899
rexml (~> 3.2.4)
89-
xcpretty (0.3.0)
90-
rouge (~> 2.0.7)
91-
zeitwerk (2.5.4)
92100

93101
PLATFORMS
94102
arm64-darwin
@@ -97,7 +105,6 @@ PLATFORMS
97105

98106
DEPENDENCIES
99107
cocoapods
100-
xcpretty
101108

102109
BUNDLED WITH
103110
2.2.22

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
setup:
2-
bundle install
2+
bundle check || bundle install
33

44
lint: setup
55
bundle exec pod lib lint --allow-warnings

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ let package = Package(
77
name: "swift-user-defaults",
88
platforms: [
99
.macOS(.v10_13),
10-
.iOS(.v11),
10+
.iOS(.v12),
1111
.watchOS(.v7),
12-
.tvOS(.v11)
12+
.tvOS(.v12)
1313
],
1414
products: [
1515
.library(name: "SwiftUserDefaults", targets: ["SwiftUserDefaults"]),

swift-user-defaults.podspec

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ Pod::Spec.new do |s|
1111
s.resource_bundles = {'SwiftUserDefaults' => ['Sources/SwiftUserDefaults/PrivacyInfo.xcprivacy']}
1212
s.swift_version = "5.3"
1313

14-
s.ios.deployment_target = '11.0'
14+
s.ios.deployment_target = '12.0'
1515
s.osx.deployment_target = '10.13'
16-
s.tvos.deployment_target = '11.0'
17-
s.watchos.deployment_target = '7'
1816

1917
# Run Unit Tests
2018
s.test_spec 'Tests' do |test_spec|

0 commit comments

Comments
 (0)