Skip to content

Commit 615f044

Browse files
authored
Merge pull request #283 from drmohundro/feat/swift-6-support
feat: Swift 6 support
2 parents 2981c34 + eb46122 commit 615f044

38 files changed

+908
-1054
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v4
1313
- name: SwiftLint
1414
uses: norio-nomura/[email protected]
1515
with:

.github/workflows/main.yml

Lines changed: 109 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,139 @@ on: [push, pull_request]
55
jobs:
66
mac-test:
77
name: Mac Test
8-
runs-on: macOS-latest
8+
runs-on: macos-latest
9+
strategy:
10+
matrix:
11+
include:
12+
- platform: macOS
13+
scheme: "SWXMLHash OSX"
14+
action: "build-for-testing test-without-building"
915

16+
- platform: iOS
17+
scheme: "SWXMLHash iOS"
18+
action: "build-for-testing test-without-building"
19+
sdk-and-dest: '-sdk iphonesimulator -destination "OS=17.2,name=iPhone 15"'
20+
21+
- platform: tvOS
22+
scheme: "SWXMLHash tvOS"
23+
sdk-and-dest: '-sdk appletvsimulator -destination "name=Apple TV"'
24+
25+
- platform: watchOS
26+
scheme: "SWXMLHash watchOS"
27+
action: "build-for-testing test-without-building"
28+
sdk-and-dest: "-sdk watchsimulator"
1029
steps:
1130
- name: Checkout
12-
uses: actions/checkout@master
13-
- name: Build and test
31+
uses: actions/checkout@v4
32+
33+
- uses: maxim-lobanov/setup-xcode@v1
34+
with:
35+
xcode-version: "16.0"
36+
37+
- name: Build and Test
1438
env:
1539
WORKSPACE: "-workspace SWXMLHash.xcworkspace"
16-
ACTION: "build-for-testing test-without-building"
1740
run: |
18-
set -o pipefail
19-
xcodebuild $ACTION $WORKSPACE -scheme "SWXMLHash OSX" | xcpretty
20-
xcodebuild $ACTION $WORKSPACE -scheme "SWXMLHash iOS" -sdk iphonesimulator -destination "OS=17.2,name=iPhone 15" | xcpretty
21-
xcodebuild $ACTION $WORKSPACE -scheme "SWXMLHash tvOS" -sdk appletvsimulator -destination "name=Apple TV" | xcpretty
22-
xcodebuild build $WORKSPACE -scheme "SWXMLHash watchOS" -sdk watchsimulator | xcpretty
23-
bash <(curl -s https://codecov.io/bash) -t ${{secrets.CODECOV_TOKEN}}
41+
xcodebuild ${{ matrix.action }} $WORKSPACE -scheme ${{ matrix.scheme }} ${{ matrix.sdk-and-dest }} | xcpretty
42+
43+
# TODO: I'd like to use this action instead of the above xcodebuild command, but I'm getting a destination error:
44+
# xcodebuild: error: Unable to find a destination matching the provided destination specifier:
45+
# { id:D918798E-6DEE-48F7-850A-A4C0D9328F0A }
46+
#
47+
# - uses: mxcl/[email protected]
48+
# with:
49+
# platform: ${{ matrix.platform }}
50+
# workspace: "SWXMLHash.xcworkspace"
2451

2552
linux-test:
2653
name: Linux Test
2754
runs-on: ubuntu-latest
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
include:
59+
- image: swift:5.8-focal
60+
skip-testing: true
61+
62+
- image: swift:5.8-jammy
63+
skip-testing: true
64+
65+
- image: swift:5.8-rhel-ubi9
66+
skip-testing: true
67+
68+
- image: swift:5.9-focal
69+
skip-testing: true
70+
71+
- image: swift:5.9-jammy
72+
skip-testing: true
73+
74+
- image: swift:5.9-rhel-ubi9
75+
skip-testing: true
2876

77+
- image: swift:5.10-focal
78+
skip-testing: true
79+
80+
- image: swift:5.10-jammy
81+
skip-testing: true
82+
83+
- image: swift:5.10-rhel-ubi9
84+
skip-testing: true
85+
86+
- image: swift:6.0-focal
87+
perform-testing: true
88+
89+
- image: swift:6.0-jammy
90+
perform-testing: true
91+
92+
- image: swift:6.0-rhel-ubi9
93+
perform-testing: true
94+
container:
95+
image: ${{ matrix.image }}
96+
timeout-minutes: 10
2997
steps:
3098
- name: Checkout
31-
uses: actions/checkout@master
99+
uses: actions/checkout@v4
100+
- name: Build
101+
if: ${{ matrix.skip-testing }}
102+
run: |
103+
swift build
32104
- name: Build and test
105+
if: ${{ matrix.perform-testing }}
33106
run: |
34-
eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
107+
swift build --build-tests
35108
swift test
36109
37110
windows-test:
38111
name: Windows Test
39112
runs-on: windows-latest
113+
timeout-minutes: 10
114+
strategy:
115+
fail-fast: false
116+
matrix:
117+
include:
118+
- branch: swift-5.10-release
119+
tag: 5.10-RELEASE
120+
skip-testing: true
121+
122+
- branch: swift-6.0-release
123+
tag: 6.0-RELEASE
124+
perform-testing: true
40125

41126
steps:
42127
- name: Install Swift
43128
uses: compnerd/gha-setup-swift@main
44129
with:
45-
branch: swift-5.8-release
46-
tag: 5.8-RELEASE
130+
branch: ${{ matrix.branch}}
131+
tag: ${{ matrix.tag }}
132+
47133
- name: Checkout
48-
uses: actions/checkout@master
134+
uses: actions/checkout@v4
135+
- name: Build
136+
if: ${{ matrix.skip-testing }}
137+
run: |
138+
swift build
49139
- name: Build and test
50-
run: swift test
140+
if: ${{ matrix.perform-testing }}
141+
run: |
142+
swift build --build-tests
143+
swift test

.swiftlint.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ included:
33
- Tests
44
- ./Package.swift
55
opt_in_rules:
6-
- anyobject_protocol
76
- array_init
87
- attributes
98
- closure_end_indentation

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v8.0.0 (September 17, 2024)
2+
3+
- Added Swift 6.0 support (via [#283](https://github.com/drmohundro/SWXMLHash/pull/283))
4+
- The tests are now all using swift-testing
5+
- Prior deprecations have been removed
6+
17
## v7.0.2 (May 9, 2023)
28

39
- Added Windows support (via [#273](https://github.com/drmohundro/SWXMLHash/pull/273))

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM swift:5.1
1+
FROM swiftlang/swift:nightly-6.0-focal
22

33
ENV APP_HOME ./app
44
RUN mkdir $APP_HOME

Package.swift

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.3
1+
// swift-tools-version:6.0
22

33
//
44
// Package.swift
@@ -35,6 +35,9 @@ let package = Package(
3535
targets: ["SWXMLHash"]
3636
)
3737
],
38+
dependencies: [
39+
.package(url: "https://github.com/apple/swift-testing.git", from: "0.10.0")
40+
],
3841
targets: [
3942
.target(
4043
name: "SWXMLHash",
@@ -43,11 +46,14 @@ let package = Package(
4346
),
4447
.testTarget(
4548
name: "SWXMLHashTests",
46-
dependencies: ["SWXMLHash"],
49+
dependencies: [
50+
"SWXMLHash",
51+
.product(name: "Testing", package: "swift-testing")
52+
],
4753
exclude: ["Info.plist", "test.xml"]
4854
)
4955
],
50-
swiftLanguageVersions: [
51-
.v5
56+
swiftLanguageModes: [
57+
.v6
5258
]
5359
)
Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
// swift-tools-version:5.10
2+
13
//
2-
// TypesConversionBasicTests.swift
4+
35
// SWXMLHash
46
//
5-
// Copyright (c) 2016 Norio Nomura
6-
7+
// Copyright (c) 2024 David Mohundro
78
//
89
// Permission is hereby granted, free of charge, to any person obtaining a copy
910
// of this software and associated documentation files (the "Software"), to deal
@@ -24,19 +25,29 @@
2425
// THE SOFTWARE.
2526
//
2627

27-
@testable import SWXMLHashTests
28-
import XCTest
28+
import PackageDescription
2929

30-
XCTMain([
31-
testCase(LazyTypesConversionTests.allTests),
32-
testCase(LazyWhiteSpaceParsingTests.allTests),
33-
testCase(LazyXMLParsingTests.allTests),
34-
testCase(MixedTextWithXMLElementsTests.allTests),
35-
testCase(XMLHashConfigTests.allTests),
36-
testCase(TypeConversionArrayOfNonPrimitiveTypesTests.allTests),
37-
testCase(TypeConversionBasicTypesTests.allTests),
38-
testCase(TypeConversionComplexTypesTests.allTests),
39-
testCase(TypeConversionPrimitiveTypesTests.allTests),
40-
testCase(WhiteSpaceParsingTests.allTests),
41-
testCase(XMLParsingTests.allTests)
42-
])
30+
let package = Package(
31+
name: "SWXMLHash",
32+
products: [
33+
.library(
34+
name: "SWXMLHash",
35+
targets: ["SWXMLHash"]
36+
)
37+
],
38+
targets: [
39+
.target(
40+
name: "SWXMLHash",
41+
path: "Source",
42+
exclude: ["Info.plist"]
43+
),
44+
.testTarget(
45+
name: "SWXMLHashTests",
46+
dependencies: ["SWXMLHash"],
47+
exclude: ["Info.plist", "test.xml"]
48+
)
49+
],
50+
swiftLanguageVersions: [
51+
.v5
52+
]
53+
)
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
// swift-tools-version:5.1
1+
// swift-tools-version:5.8
2+
23
//
3-
// SWXMLHash.swift
4+
45
// SWXMLHash
56
//
6-
// Copyright (c) 2014 David Mohundro
7+
// Copyright (c) 2024 David Mohundro
78
//
89
// Permission is hereby granted, free of charge, to any person obtaining a copy
910
// of this software and associated documentation files (the "Software"), to deal
@@ -23,6 +24,7 @@
2324
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2425
// THE SOFTWARE.
2526
//
27+
2628
import PackageDescription
2729

2830
let package = Package(
@@ -36,11 +38,13 @@ let package = Package(
3638
targets: [
3739
.target(
3840
name: "SWXMLHash",
39-
path: "Source"
41+
path: "Source",
42+
exclude: ["Info.plist"]
4043
),
4144
.testTarget(
4245
name: "SWXMLHashTests",
43-
dependencies: ["SWXMLHash"]
46+
dependencies: ["SWXMLHash"],
47+
exclude: ["Info.plist", "test.xml"]
4448
)
4549
],
4650
swiftLanguageVersions: [
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// swift-tools-version:4.2
1+
// swift-tools-version:5.9
22

33
//
4-
// SWXMLHash.swift
4+
55
// SWXMLHash
66
//
7-
// Copyright (c) 2014 David Mohundro
7+
// Copyright (c) 2024 David Mohundro
88
//
99
// Permission is hereby granted, free of charge, to any person obtaining a copy
1010
// of this software and associated documentation files (the "Software"), to deal
@@ -38,12 +38,16 @@ let package = Package(
3838
targets: [
3939
.target(
4040
name: "SWXMLHash",
41-
path: "Source"
41+
path: "Source",
42+
exclude: ["Info.plist"]
4243
),
4344
.testTarget(
4445
name: "SWXMLHashTests",
45-
dependencies: ["SWXMLHash"]
46+
dependencies: ["SWXMLHash"],
47+
exclude: ["Info.plist", "test.xml"]
4648
)
4749
],
48-
swiftLanguageVersions: [.v3, .v4, .v4_2]
50+
swiftLanguageVersions: [
51+
.v5
52+
]
4953
)

0 commit comments

Comments
 (0)