Skip to content

Commit e1d8bb6

Browse files
committed
Delay removing the deprecated 'diagnostics.json file by 1 minor release
1 parent 4f207a4 commit e1d8bb6

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

Sources/SwiftDocC/Infrastructure/ConvertOutputConsumer.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import Foundation
1616
/// or store them in memory.
1717
public protocol ConvertOutputConsumer {
1818
/// Consumes an array of problems that were generated during a conversion.
19-
@available(*, deprecated, message: "This deprecated API will be removed after 6.2 is released")
20-
func consume(problems: [Problem]) throws
19+
@available(*, deprecated, message: "This deprecated API will be removed after 6.3 is released")
20+
func _deprecated_consume(problems: [Problem]) throws
2121

2222
/// Consumes a render node that was generated during a conversion.
2323
/// > Warning: This method might be called concurrently.
@@ -62,7 +62,7 @@ public extension ConvertOutputConsumer {
6262

6363
// Default implementation so that conforming types don't need to implement deprecated API.
6464
public extension ConvertOutputConsumer {
65-
func consume(problems: [Problem]) throws {}
65+
func _deprecated_consume(problems: [Problem]) throws {}
6666
}
6767

6868
// A package-internal protocol that callers can cast to when they need to call `_consume(problems:)` for backwards compatibility (until `consume(problems:)` is removed).
@@ -84,7 +84,7 @@ package struct _Deprecated<Consumer: ConvertOutputConsumer>: _DeprecatedConsumeP
8484
}
8585

8686
// This needs to be deprecated to be able to call `consume(problems:)` without a deprecation warning.
87-
@available(*, deprecated, message: "This deprecated API will be removed after 6.2 is released")
87+
@available(*, deprecated, message: "This deprecated API will be removed after 6.3 is released")
8888
package func _consume(problems: [Problem]) throws {
8989
var problems = problems
9090

@@ -94,15 +94,15 @@ package struct _Deprecated<Consumer: ConvertOutputConsumer>: _DeprecatedConsumeP
9494
severity: .warning,
9595
identifier: "org.swift.docc.DeprecatedDiagnosticsDigets",
9696
summary: """
97-
The 'diagnostics.json' digest file is deprecated and will be removed after 6.2 is released. \
97+
The 'diagnostics.json' digest file is deprecated and will be removed after 6.3 is released. \
9898
Pass a `--diagnostics-file <diagnostics-file>` to specify a custom location where DocC will write a diagnostics JSON file with more information.
9999
""")
100100
),
101101
at: 0
102102
)
103103
}
104104

105-
try consumer.consume(problems: problems)
105+
try consumer._deprecated_consume(problems: problems)
106106
}
107107
}
108108

Sources/SwiftDocC/SwiftDocC.docc/Resources/Diagnostics.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"openapi": "3.0.0",
33
"info": {
4-
"description": "Specification of the deprecated DocC diagnostics.json digest file. This deprecated file will be removed after 6.2 is released.",
4+
"description": "Specification of the deprecated DocC diagnostics.json digest file. This deprecated file will be removed after 6.3 is released.",
55
"version": "0.1.0",
66
"title": "Diagnostics"
77
},

Sources/SwiftDocCUtilities/Action/Actions/Convert/ConvertFileWritingConsumer.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ struct ConvertFileWritingConsumer: ConvertOutputConsumer, ExternalNodeConsumer {
5050
self.assetPrefixComponent = bundleID?.rawValue.split(separator: "/").joined(separator: "-")
5151
}
5252

53-
@available(*, deprecated, message: "This deprecated API will be removed after 6.2 is released")
54-
func consume(problems: [Problem]) throws {
53+
@available(*, deprecated, message: "This deprecated API will be removed after 6.3 is released")
54+
func _deprecated_consume(problems: [Problem]) throws {
5555
let diagnostics = problems.map { problem in
5656
Digest.Diagnostic(diagnostic: problem.diagnostic, rootURL: bundleRootFolder)
5757
}
@@ -251,7 +251,7 @@ enum Digest {
251251
let downloads: [DownloadReference]
252252
}
253253

254-
@available(*, deprecated, message: "This deprecated API will be removed after 6.2 is released")
254+
@available(*, deprecated, message: "This deprecated API will be removed after 6.3 is released")
255255
struct Diagnostic: Codable {
256256
struct Location: Codable {
257257
let line: Int
@@ -270,7 +270,7 @@ enum Digest {
270270
}
271271
}
272272

273-
@available(*, deprecated, message: "This deprecated API will be removed after 6.2 is released")
273+
@available(*, deprecated, message: "This deprecated API will be removed after 6.3 is released")
274274
private extension Digest.Diagnostic {
275275
init(diagnostic: Diagnostic, rootURL: URL?) {
276276
self.start = (diagnostic.range?.lowerBound).map { Location(line: $0.line, column: $0.column) }

Tests/SwiftDocCTests/DeprecatedDiagnosticsDigestWarningTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ class DeprecatedDiagnosticsDigestWarningTests: XCTestCase {
6666
let deprecationWarning = try XCTUnwrap(outputConsumer.problems.first?.diagnostic)
6767

6868
XCTAssertEqual(deprecationWarning.identifier, "org.swift.docc.DeprecatedDiagnosticsDigets")
69-
XCTAssertEqual(deprecationWarning.summary, "The 'diagnostics.json' digest file is deprecated and will be removed after 6.2 is released. Pass a `--diagnostics-file <diagnostics-file>` to specify a custom location where DocC will write a diagnostics JSON file with more information.")
69+
XCTAssertEqual(deprecationWarning.summary, "The 'diagnostics.json' digest file is deprecated and will be removed after 6.3 is released. Pass a `--diagnostics-file <diagnostics-file>` to specify a custom location where DocC will write a diagnostics JSON file with more information.")
7070
}
7171
}
7272

7373
private class TestOutputConsumer: ConvertOutputConsumer, ExternalNodeConsumer {
7474
var problems: [Problem] = []
7575

76-
func consume(problems: [Problem]) throws {
76+
func _deprecated_consume(problems: [Problem]) throws {
7777
self.problems.append(contentsOf: problems)
7878
}
7979

Tests/SwiftDocCUtilitiesTests/ConvertActionTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ class ConvertActionTests: XCTestCase {
609609
start: nil,
610610
source: nil,
611611
severity: .warning,
612-
summary: "The 'diagnostics.json' digest file is deprecated and will be removed after 6.2 is released. Pass a `--diagnostics-file <diagnostics-file>` to specify a custom location where DocC will write a diagnostics JSON file with more information.",
612+
summary: "The 'diagnostics.json' digest file is deprecated and will be removed after 6.3 is released. Pass a `--diagnostics-file <diagnostics-file>` to specify a custom location where DocC will write a diagnostics JSON file with more information.",
613613
explanation: nil,
614614
notes: []
615615
),
@@ -672,7 +672,7 @@ class ConvertActionTests: XCTestCase {
672672
start: nil,
673673
source: nil,
674674
severity: .warning,
675-
summary: "The 'diagnostics.json' digest file is deprecated and will be removed after 6.2 is released. Pass a `--diagnostics-file <diagnostics-file>` to specify a custom location where DocC will write a diagnostics JSON file with more information.",
675+
summary: "The 'diagnostics.json' digest file is deprecated and will be removed after 6.3 is released. Pass a `--diagnostics-file <diagnostics-file>` to specify a custom location where DocC will write a diagnostics JSON file with more information.",
676676
explanation: nil,
677677
notes: []
678678
),
@@ -764,7 +764,7 @@ class ConvertActionTests: XCTestCase {
764764
start: nil,
765765
source: nil,
766766
severity: .warning,
767-
summary: "The 'diagnostics.json' digest file is deprecated and will be removed after 6.2 is released. Pass a `--diagnostics-file <diagnostics-file>` to specify a custom location where DocC will write a diagnostics JSON file with more information.",
767+
summary: "The 'diagnostics.json' digest file is deprecated and will be removed after 6.3 is released. Pass a `--diagnostics-file <diagnostics-file>` to specify a custom location where DocC will write a diagnostics JSON file with more information.",
768768
explanation: nil,
769769
notes: []
770770
),

0 commit comments

Comments
 (0)