Skip to content

Commit b8fa7fe

Browse files
authored
Bump version to 0.12.0, update CHANGELOG.md (#210)
* Bump version to 0.12.0, update `CHANGELOG.md` * Fix formatting and shuffled tuple fields warning * Remove broken Danger workflow * Add an Ubuntu Swift 5.3.2 job to Azure Pipelines
1 parent 8a07649 commit b8fa7fe

21 files changed

+174
-164
lines changed

.github/workflows/danger.yml

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

.github/workflows/main.yml

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,6 @@ on:
1212

1313
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1414
jobs:
15-
xcode-11_0:
16-
# The type of runner that the job will run on
17-
runs-on: macOS-10.15
18-
19-
# Steps represent a sequence of tasks that will be executed as part of the job
20-
steps:
21-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22-
- uses: actions/checkout@v2
23-
24-
- name: Build with Xcode 11.0
25-
run: ./test_xcodebuild.sh Xcode_11
26-
env:
27-
IOS_DEVICE: "platform=iOS Simulator,OS=13.0,name=iPhone 8"
28-
TVOS_DEVICE: "platform=tvOS Simulator,OS=13.0,name=Apple TV 4K"
29-
30-
xcode-11_1:
31-
runs-on: macOS-10.15
32-
33-
steps:
34-
- uses: actions/checkout@v2
35-
36-
- name: Build with Xcode 11.1
37-
run: ./test_xcodebuild.sh Xcode_11.1
38-
env:
39-
IOS_DEVICE: "platform=iOS Simulator,OS=13.1,name=iPhone 8"
40-
TVOS_DEVICE: "platform=tvOS Simulator,OS=13.0,name=Apple TV 4K"
41-
4215
xcode-11_2:
4316
runs-on: macOS-10.15
4417

@@ -72,7 +45,7 @@ jobs:
7245
- name: Build with Xcode 11.4
7346
run: ./test_xcodebuild.sh Xcode_11.4
7447
env:
75-
IOS_DEVICE: "platform=iOS Simulator,OS=13.4,name=iPhone 8"
48+
IOS_DEVICE: "platform=iOS Simulator,OS=13.4.1,name=iPhone 8"
7649
TVOS_DEVICE: "platform=tvOS Simulator,OS=13.4,name=Apple TV 4K"
7750

7851
xcode-11_5:
@@ -86,6 +59,18 @@ jobs:
8659
env:
8760
IOS_DEVICE: "platform=iOS Simulator,OS=13.5,name=iPhone 8"
8861
TVOS_DEVICE: "platform=tvOS Simulator,OS=13.4,name=Apple TV 4K"
62+
63+
xcode-12_3:
64+
runs-on: macOS-10.15
65+
66+
steps:
67+
- uses: actions/checkout@v2
68+
69+
- name: Build with Xcode 12.3
70+
run: ./test_xcodebuild.sh Xcode_12.3
71+
env:
72+
IOS_DEVICE: "platform=iOS Simulator,OS=14.3,name=iPhone 8"
73+
TVOS_DEVICE: "platform=tvOS Simulator,OS=14.3,name=Apple TV 4K"
8974
CODECOV_JOB: "true"
9075
CODECOV_TOKEN: ${{ secrets.codecovToken }}
9176

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
# 0.12.0 (26 January 2021)
2+
3+
This release adds a few new features. Namely:
4+
5+
- New `charactersEscapedInAttributes` and `charactersEscapedInElements` properties on `XMLEncoder`
6+
that allow customizing how certain characters are escaped.
7+
- You can now override the implementation of `TopLevelEncoder` Combine protocol conformance when
8+
subclassing `XMLEncoder`.
9+
- New `prettyPrintIndentation` property on `XMLEncoder`, which can take `XMLEncoder.PrettyPrintIndentation` values such as `.tabs(1)` or `.spaces(2)`.
10+
11+
Thanks to [Kenta Kubo](https://github.com/kkk669) for the contribution!
12+
13+
**Closed issues:**
14+
15+
- How to decode `<itunes:episode>` tags ([#201](https://github.com/MaxDesiatov/XMLCoder/issues/201))
16+
- Fail to build in Xcode 12 beta ([#196](https://github.com/MaxDesiatov/XMLCoder/issues/196))
17+
- Changing the root node name ? ([#191](https://github.com/MaxDesiatov/XMLCoder/issues/191))
18+
- " in XML element may not always be escaping ([#187](https://github.com/MaxDesiatov/XMLCoder/issues/187))
19+
- `&#10;` in XML attributes ([#185](https://github.com/MaxDesiatov/XMLCoder/issues/185))
20+
- " and `&quot;` are not decoded equally ([#184](https://github.com/MaxDesiatov/XMLCoder/issues/184))
21+
- Use 2 spaces instead of 4 when .prettyPrinted ([#183](https://github.com/MaxDesiatov/XMLCoder/issues/183))
22+
- (Help using) How to decode this XML? ([#180](https://github.com/MaxDesiatov/XMLCoder/issues/180))
23+
24+
**Merged pull requests:**
25+
26+
- Test `DynamicNodeEncoding` for root elements ([#195](https://github.com/MaxDesiatov/XMLCoder/pull/195)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
27+
- Make character escaping customizable in `XMLEncoder` ([#188](https://github.com/MaxDesiatov/XMLCoder/pull/188)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
28+
- Add `prettyPrintIndentation` property on `XMLEncoder` ([#186](https://github.com/MaxDesiatov/XMLCoder/pull/186)) via [@MaxDesiatov](https://github.com/MaxDesiatov)
29+
- Make `TopLevelEncoder` implementation overridable ([#182](https://github.com/MaxDesiatov/XMLCoder/pull/182)) via [@kkk669](https://github.com/kkk669)
30+
131
# 0.11.1 (3 May 2020)
232

333
This release fixes an issue, where non-string values used CDATA encoding.

Dangerfile.swift

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

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ easy as adding it to the `dependencies` value of your `Package.swift`.
374374

375375
```swift
376376
dependencies: [
377-
.package(url: "https://github.com/MaxDesiatov/XMLCoder.git", from: "0.11.1")
377+
.package(url: "https://github.com/MaxDesiatov/XMLCoder.git", from: "0.12.0")
378378
]
379379
```
380380

@@ -409,7 +409,7 @@ target 'YourApp' do
409409
use_frameworks!
410410

411411
# Pods for YourApp
412-
pod 'XMLCoder', '~> 0.11.1'
412+
pod 'XMLCoder', '~> 0.12.0'
413413
end
414414
```
415415

@@ -438,7 +438,7 @@ $ brew install carthage
438438
Inside of your `Cartfile`, add GitHub path to `XMLCoder`:
439439

440440
```ogdl
441-
github "MaxDesiatov/XMLCoder" ~> 0.11.1
441+
github "MaxDesiatov/XMLCoder" ~> 0.12.0
442442
```
443443

444444
Then, run the following command to build the framework:

Sources/XMLCoder/Auxiliaries/Box/KeyedBox.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ struct KeyedBox {
3232
extension KeyedBox {
3333
init<E, A>(elements: E, attributes: A)
3434
where E: Sequence, E.Element == (Key, Element),
35-
A: Sequence, A.Element == (Key, Attribute) {
35+
A: Sequence, A.Element == (Key, Attribute)
36+
{
3637
let elements = Elements(elements)
3738
let attributes = Attributes(attributes)
3839
self.init(elements: elements, attributes: attributes)

Sources/XMLCoder/Auxiliaries/XMLStackParser.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ extension XMLStackParser: XMLParserDelegate {
128128
didStartElement elementName: String,
129129
namespaceURI: String?,
130130
qualifiedName: String?,
131-
attributes attributeDict: [String: String] = [:]) {
131+
attributes attributeDict: [String: String] = [:])
132+
{
132133
#if os(Linux) && !compiler(>=5.1)
133134
// For some reason, element names on linux are coming out with the namespace after the name
134135
// https://bugs.swift.org/browse/SR-11191
@@ -144,7 +145,8 @@ extension XMLStackParser: XMLParserDelegate {
144145
func parser(_: XMLParser,
145146
didEndElement _: String,
146147
namespaceURI _: String?,
147-
qualifiedName _: String?) {
148+
qualifiedName _: String?)
149+
{
148150
guard let element = stack.popLast() else {
149151
return
150152
}

Sources/XMLCoder/Decoder/XMLDecoder.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ open class XMLDecoder {
5050
}
5151

5252
guard let container = try? decoder.singleValueContainer(),
53-
let text = try? container.decode(String.self) else {
53+
let text = try? container.decode(String.self)
54+
else {
5455
throw DecodingError.dataCorrupted(DecodingError.Context(
5556
codingPath: decoder.codingPath,
5657
debugDescription: "Could not decode date text"
@@ -100,7 +101,8 @@ open class XMLDecoder {
100101
}
101102

102103
guard let container = try? decoder.singleValueContainer(),
103-
let text = try? container.decode(String.self) else {
104+
let text = try? container.decode(String.self)
105+
else {
104106
throw DecodingError.dataCorrupted(DecodingError.Context(
105107
codingPath: decoder.codingPath,
106108
debugDescription: "Could not decode date text"

Sources/XMLCoder/Decoder/XMLDecoderImplementation.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class XMLDecoderImplementation: Decoder {
1212
// MARK: Properties
1313

1414
/// The decoder's storage.
15-
var storage: XMLDecodingStorage = XMLDecodingStorage()
15+
var storage = XMLDecodingStorage()
1616

1717
/// Options set on the top-level decoder.
1818
let options: XMLDecoder.Options
@@ -442,7 +442,8 @@ extension XMLDecoderImplementation {
442442
decoded = decimal as? T
443443
} else if
444444
type == String.self || type == NSString.self,
445-
let value = (try unbox(box) as String) as? T {
445+
let value = (try unbox(box) as String) as? T
446+
{
446447
decoded = value
447448
} else {
448449
storage.push(container: box)
@@ -454,8 +455,9 @@ extension XMLDecoderImplementation {
454455
decoded = try type.init(from: self)
455456
} catch {
456457
guard case DecodingError.valueNotFound = error,
457-
let type = type as? AnyOptional.Type,
458-
let result = type.init() as? T else {
458+
let type = type as? AnyOptional.Type,
459+
let result = type.init() as? T
460+
else {
459461
throw error
460462
}
461463

Sources/XMLCoder/Decoder/XMLKeyedDecodingContainer.swift

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ struct XMLKeyedDecodingContainer<K: CodingKey>: KeyedDecodingContainerProtocol {
9898
}
9999

100100
if let type = type as? AnySequence.Type,
101-
!attributeFound,
102-
!elementFound,
103-
let result = type.init() as? T {
101+
!attributeFound,
102+
!elementFound,
103+
let result = type.init() as? T
104+
{
104105
return result
105106
}
106107

@@ -207,19 +208,22 @@ extension XMLKeyedDecodingContainer {
207208

208209
private func decodeSignedInteger<T>(_ type: T.Type,
209210
forKey key: Key) throws -> T
210-
where T: BinaryInteger & SignedInteger & Decodable {
211+
where T: BinaryInteger & SignedInteger & Decodable
212+
{
211213
return try decodeConcrete(type, forKey: key)
212214
}
213215

214216
private func decodeUnsignedInteger<T>(_ type: T.Type,
215217
forKey key: Key) throws -> T
216-
where T: BinaryInteger & UnsignedInteger & Decodable {
218+
where T: BinaryInteger & UnsignedInteger & Decodable
219+
{
217220
return try decodeConcrete(type, forKey: key)
218221
}
219222

220223
private func decodeFloatingPoint<T>(_ type: T.Type,
221224
forKey key: Key) throws -> T
222-
where T: BinaryFloatingPoint & Decodable {
225+
where T: BinaryFloatingPoint & Decodable
226+
{
223227
return try decodeConcrete(type, forKey: key)
224228
}
225229

@@ -265,7 +269,8 @@ extension XMLKeyedDecodingContainer {
265269
// You can't decode sequences from attributes, but other strategies
266270
// need special handling for empty sequences.
267271
if strategy(key) != .attribute && elements.isEmpty,
268-
let empty = (type as? AnySequence.Type)?.init() as? T {
272+
let empty = (type as? AnySequence.Type)?.init() as? T
273+
{
269274
return empty
270275
}
271276

@@ -309,7 +314,8 @@ extension XMLKeyedDecodingContainer {
309314

310315
let value: T?
311316
if !(type is AnySequence.Type), let unkeyedBox = box as? UnkeyedBox,
312-
let first = unkeyedBox.first {
317+
let first = unkeyedBox.first
318+
{
313319
// Handle case where we have held onto a `SingleKeyedBox`
314320
if let singleKeyed = first as? SingleKeyedBox {
315321
if singleKeyed.element.isNull {
@@ -325,7 +331,8 @@ extension XMLKeyedDecodingContainer {
325331
}
326332

327333
if value == nil, let type = type as? AnyOptional.Type,
328-
let result = type.init() as? T {
334+
let result = type.init() as? T
335+
{
329336
return result
330337
}
331338

0 commit comments

Comments
 (0)