From f25174ac9aac07b43f249d287b32125161c2ba4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20R=C3=B6nnqvist?= Date: Tue, 17 Sep 2024 13:41:12 +0200 Subject: [PATCH 1/2] Remove API that was deprecated during the 5.10 release --- .../Indexing/Navigator/NavigatorIndex.swift | 5 +- .../Diagnostics/DiagnosticConsoleWriter.swift | 6 - .../Diagnostics/DiagnosticConsumer.swift | 12 -- .../Diagnostics/DiagnosticEngine.swift | 5 - ...mentationContext+DeprecatedResolvers.swift | 43 ------ ...eferenceResolver+DeprecatedResolvers.swift | 126 ------------------ .../Workspace/DefaultAvailability.swift | 6 - .../RenderNodeVariantOverridesApplier.swift | 11 -- .../SwiftDocC/Semantics/Symbol/Symbol.swift | 4 - .../ConvertAction+CommandInitialization.swift | 9 +- .../Options/DocumentationBundleOption.swift | 3 - ...DocumentationCoverageOptionsArgument.swift | 14 -- .../ArgumentParsing/Subcommands/Convert.swift | 59 +------- .../Diagnostics/DiagnosticEngineTests.swift | 2 +- .../ConvertSubcommandTests.swift | 41 ------ 15 files changed, 4 insertions(+), 342 deletions(-) delete mode 100644 Sources/SwiftDocC/Infrastructure/External Data/Deprecated/DocumentationContext+DeprecatedResolvers.swift delete mode 100644 Sources/SwiftDocC/Infrastructure/External Data/Deprecated/OutOfProcessReferenceResolver+DeprecatedResolvers.swift diff --git a/Sources/SwiftDocC/Indexing/Navigator/NavigatorIndex.swift b/Sources/SwiftDocC/Indexing/Navigator/NavigatorIndex.swift index 5dfdefe6e2..c54c94506e 100644 --- a/Sources/SwiftDocC/Indexing/Navigator/NavigatorIndex.swift +++ b/Sources/SwiftDocC/Indexing/Navigator/NavigatorIndex.swift @@ -65,9 +65,6 @@ public class NavigatorIndex { /// Missing bundle identifier. case missingBundleIdentifier - @available(*, deprecated, renamed: "missingBundleIdentifier", message: "Use 'missingBundleIdentifier' instead. This deprecated API will be removed after 6.0 is released") - case missingBundleIndentifier - /// A RenderNode has no title and won't be indexed. case missingTitle(description: String) @@ -76,7 +73,7 @@ public class NavigatorIndex { public var errorDescription: String { switch self { - case .missingBundleIdentifier, .missingBundleIndentifier: + case .missingBundleIdentifier: return "A navigator index requires a bundle identifier, which is missing." case .missingTitle: return "The page has no valid title available." diff --git a/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsoleWriter.swift b/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsoleWriter.swift index b4d069fc62..eb9225201c 100644 --- a/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsoleWriter.swift +++ b/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsoleWriter.swift @@ -74,12 +74,6 @@ public final class DiagnosticConsoleWriter: DiagnosticFormattingConsumer { self.diagnosticFormatter.finalize() } - // This is deprecated but still necessary to implement. - @available(*, deprecated, renamed: "flush()", message: "Use 'flush()' instead. This deprecated API will be removed after 6.0 is released") - public func finalize() throws { - try flush() - } - private static func makeDiagnosticFormatter( _ options: DiagnosticFormattingOptions, baseURL: URL?, diff --git a/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsumer.swift b/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsumer.swift index 2ae01af373..7b71800722 100644 --- a/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsumer.swift +++ b/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsumer.swift @@ -16,10 +16,6 @@ public protocol DiagnosticConsumer: AnyObject { /// - Parameter problems: The encountered diagnostics. func receive(_ problems: [Problem]) - /// Inform the consumer that the engine has sent all diagnostics for this build. - @available(*, deprecated, renamed: "flush()", message: "Use 'flush()' instead. This deprecated API will be removed after 6.0 is released") - func finalize() throws - /// Inform the consumer that the engine has sent all diagnostics in a given context. func flush() throws } @@ -29,11 +25,3 @@ public protocol DiagnosticFormattingConsumer: DiagnosticConsumer { /// Options for how problems should be formatted if written to output. var formattingOptions: DiagnosticFormattingOptions { get set } } - -public extension DiagnosticConsumer { - // Deprecated for suppressing the warning emitted when calling `finalize()` - @available(*, deprecated, message: "This deprecated API will be removed after 6.0 is released") - func flush() throws { - try finalize() - } -} diff --git a/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticEngine.swift b/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticEngine.swift index 06c89ae5a5..a7f1d44a2d 100644 --- a/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticEngine.swift +++ b/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticEngine.swift @@ -105,11 +105,6 @@ public final class DiagnosticEngine { } } - @available(*, deprecated, renamed: "flush()", message: "Use 'flush()' instead. This deprecated API will be removed after 6.0 is released") - public func finalize() { - flush() - } - public func flush() { workQueue.sync { for consumer in self.consumers.sync({ $0.values }) { diff --git a/Sources/SwiftDocC/Infrastructure/External Data/Deprecated/DocumentationContext+DeprecatedResolvers.swift b/Sources/SwiftDocC/Infrastructure/External Data/Deprecated/DocumentationContext+DeprecatedResolvers.swift deleted file mode 100644 index 67f1ceb7c8..0000000000 --- a/Sources/SwiftDocC/Infrastructure/External Data/Deprecated/DocumentationContext+DeprecatedResolvers.swift +++ /dev/null @@ -1,43 +0,0 @@ -/* - This source file is part of the Swift.org open source project - - Copyright (c) 2024 Apple Inc. and the Swift project authors - Licensed under Apache License v2.0 with Runtime Library Exception - - See https://swift.org/LICENSE.txt for license information - See https://swift.org/CONTRIBUTORS.txt for Swift project authors -*/ - -import Foundation - -extension DocumentationContext { - @available(*, deprecated, message: "This deprecated API will be removed after 6.0 is released") - public var _externalAssetResolvers: [BundleIdentifier: _ExternalAssetResolver] { - get { [:] } - set { /* do nothing */ } - } - - @available(*, deprecated, renamed: "globalExternalSymbolResolver", message: "Use 'globalExternalSymbolResolver' instead. This deprecated API will be removed after 6.0 is released") - public var externalSymbolResolver: ExternalSymbolResolver? { - get { nil } - set { /* do nothing */ } - } - - @available(*, deprecated, renamed: "externalDocumentationSources", message: "Use 'externalDocumentationSources' instead. This deprecated API will be removed after 6.0 is released") - public var externalReferenceResolvers: [BundleIdentifier: ExternalReferenceResolver] { - get { [:] } - set { /* do nothing */ } - } - - @available(*, deprecated, renamed: "convertServiceFallbackResolver", message: "Use 'convertServiceFallbackResolver' instead. This deprecated API will be removed after 6.0 is released") - public var fallbackReferenceResolvers: [BundleIdentifier: FallbackReferenceResolver] { - get { [:] } - set { /* do nothing */ } - } - - @available(*, deprecated, renamed: "convertServiceFallbackResolver", message: "Use 'convertServiceFallbackResolver' instead. This deprecated API will be removed after 6.0 is released") - public var fallbackAssetResolvers: [BundleIdentifier: FallbackAssetResolver] { - get { [:] } - set { /* do nothing */ } - } -} diff --git a/Sources/SwiftDocC/Infrastructure/External Data/Deprecated/OutOfProcessReferenceResolver+DeprecatedResolvers.swift b/Sources/SwiftDocC/Infrastructure/External Data/Deprecated/OutOfProcessReferenceResolver+DeprecatedResolvers.swift deleted file mode 100644 index 1cff6737c2..0000000000 --- a/Sources/SwiftDocC/Infrastructure/External Data/Deprecated/OutOfProcessReferenceResolver+DeprecatedResolvers.swift +++ /dev/null @@ -1,126 +0,0 @@ -/* - This source file is part of the Swift.org open source project - - Copyright (c) 2024 Apple Inc. and the Swift project authors - Licensed under Apache License v2.0 with Runtime Library Exception - - See https://swift.org/LICENSE.txt for license information - See https://swift.org/CONTRIBUTORS.txt for Swift project authors -*/ - -import Foundation - -private struct DeprecatedAPIError: DescribedError { - var apiName: String - init(apiName: String = #function) { - self.apiName = apiName - } - - var errorDescription: String { - return "\(apiName.singleQuoted) is deprecated and is no longer used." - } -} - -// MARK: External Symbol Resolver - -@available(*, deprecated, renamed: "GlobalExternalSymbolResolver", message: "Use 'GlobalExternalSymbolResolver' instead. This deprecated API will be removed after 6.0 is released") -public protocol ExternalSymbolResolver { - func symbolEntity(withPreciseIdentifier preciseIdentifier: String) throws -> DocumentationNode - func urlForResolvedSymbol(reference: ResolvedTopicReference) -> URL? - func preciseIdentifier(forExternalSymbolReference reference: TopicReference) -> String? -} - -@available(*, deprecated) -extension OutOfProcessReferenceResolver: ExternalSymbolResolver { - @_disfavoredOverload - public func symbolEntity(withPreciseIdentifier _: String) throws -> DocumentationNode { - assertionFailure("\(#function) is deprecated and is no longer used.") - throw DeprecatedAPIError() - } - public func preciseIdentifier(forExternalSymbolReference _: TopicReference) -> String? { - assertionFailure("\(#function) is deprecated and is no longer used.") - return nil - } - public func urlForResolvedSymbol(reference _: ResolvedTopicReference) -> URL? { - assertionFailure("\(#function) is deprecated and is no longer used.") - return nil - } -} - -// MARK: External Reference Resolver - -@available(*, deprecated, renamed: "ExternalDocumentationSource", message: "Use 'ExternalDocumentationSource' instead. This deprecated API will be removed after 6.0 is released") -public protocol ExternalReferenceResolver { - func resolve(_ reference: TopicReference, sourceLanguage: SourceLanguage) -> TopicReferenceResolutionResult - func entity(with reference: ResolvedTopicReference) throws -> DocumentationNode - func urlForResolvedReference(_ reference: ResolvedTopicReference) -> URL -} - -@available(*, deprecated) -extension OutOfProcessReferenceResolver: ExternalReferenceResolver { - @_disfavoredOverload - public func entity(with _: ResolvedTopicReference) throws -> DocumentationNode { - assertionFailure("\(#function) is deprecated and is no longer used.") - throw DeprecatedAPIError() - } - public func urlForResolvedReference(_ reference: ResolvedTopicReference) -> URL { - assertionFailure("\(#function) is deprecated and is no longer used.") - return reference.url.withoutHostAndPortAndScheme() - } - public func resolve(_ reference: TopicReference, sourceLanguage: SourceLanguage) -> TopicReferenceResolutionResult { - assertionFailure("\(#function) is deprecated and is no longer used.") - return resolve(reference) - } -} - -// MARK: Fallback Reference Resolver - -@available(*, deprecated, renamed: "ConvertServiceFallbackResolver", message: "Use 'ConvertServiceFallbackResolver' instead. This deprecated API will be removed after 6.0 is released") -public protocol FallbackReferenceResolver { - func resolve(_ reference: TopicReference, sourceLanguage: SourceLanguage) -> TopicReferenceResolutionResult - func entityIfPreviouslyResolved(with reference: ResolvedTopicReference) throws -> DocumentationNode? - func urlForResolvedReferenceIfPreviouslyResolved(_ reference: ResolvedTopicReference) -> URL? -} - -@available(*, deprecated) -extension OutOfProcessReferenceResolver: FallbackReferenceResolver { - public func entityIfPreviouslyResolved(with reference: ResolvedTopicReference) throws -> DocumentationNode? { - assertionFailure("\(#function) is deprecated and is no longer used.") - return nil - } - - public func urlForResolvedReferenceIfPreviouslyResolved(_ reference: ResolvedTopicReference) -> URL? { - assertionFailure("\(#function) is deprecated and is no longer used.") - return nil - } -} - -// MARK: Fallback Asset Resolver - -@available(*, deprecated, renamed: "ConvertServiceFallbackResolver", message: "Use 'ConvertServiceFallbackResolver' instead. This deprecated API will be removed after 6.0 is released") -public protocol FallbackAssetResolver { - func resolve(assetNamed assetName: String, bundleIdentifier: String) -> DataAsset? -} - -@available(*, deprecated) -extension OutOfProcessReferenceResolver: FallbackAssetResolver { - public func resolve(assetNamed assetName: String, bundleIdentifier: String) -> DataAsset? { - assertionFailure("\(#function) is deprecated and is no longer used.") - return nil - } -} - -// MARK: External Asset Resolver - -@available(*, deprecated, message: "This protocol is not used. This deprecated API will be removed after 6.0 is released") -public protocol _ExternalAssetResolver { - func _resolveExternalAsset(named assetName: String, bundleIdentifier: String) -> DataAsset? -} - -@available(*, deprecated) -extension OutOfProcessReferenceResolver: _ExternalAssetResolver { - public func _resolveExternalAsset(named assetName: String, bundleIdentifier: String) -> DataAsset? { - assertionFailure("\(#function) is deprecated and is no longer used.") - return nil - } -} diff --git a/Sources/SwiftDocC/Infrastructure/Workspace/DefaultAvailability.swift b/Sources/SwiftDocC/Infrastructure/Workspace/DefaultAvailability.swift index af56bd238b..8ec50865c6 100644 --- a/Sources/SwiftDocC/Infrastructure/Workspace/DefaultAvailability.swift +++ b/Sources/SwiftDocC/Infrastructure/Workspace/DefaultAvailability.swift @@ -60,12 +60,6 @@ public struct DefaultAvailability: Codable, Equatable { /// The availability version state information, e.g unavailable internal var versionInformation: VersionInformation - /// A string representation of the version for this platform. - @available(*, deprecated, message: "Use `introducedVersion` instead. This deprecated API will be removed after 6.0 is released", renamed: "introducedVersion") - public var platformVersion: String { - return introducedVersion ?? "0.0" - } - /// A string representation of the version for this platform /// or nil if it's unavailable. public var introducedVersion: String? { diff --git a/Sources/SwiftDocC/Model/Rendering/Variants/RenderNodeVariantOverridesApplier.swift b/Sources/SwiftDocC/Model/Rendering/Variants/RenderNodeVariantOverridesApplier.swift index 990d1b5a69..d7a7e1a4d9 100644 --- a/Sources/SwiftDocC/Model/Rendering/Variants/RenderNodeVariantOverridesApplier.swift +++ b/Sources/SwiftDocC/Model/Rendering/Variants/RenderNodeVariantOverridesApplier.swift @@ -42,15 +42,4 @@ public struct RenderNodeVariantOverridesApplier { private struct RenderNodeVariantsProxy: Codable { var variantOverrides: VariantOverrides? } - - @available(*, deprecated, message: "This error is never raised. This deprecated API will be removed after 6.0 is released") - public enum Error: DescribedError { - case corruptedRenderNode - public var errorDescription: String { - switch self { - case .corruptedRenderNode: - return "Corrupted or malformed render node value." - } - } - } } diff --git a/Sources/SwiftDocC/Semantics/Symbol/Symbol.swift b/Sources/SwiftDocC/Semantics/Symbol/Symbol.swift index d7f0cf32a4..f2a06d59e1 100644 --- a/Sources/SwiftDocC/Semantics/Symbol/Symbol.swift +++ b/Sources/SwiftDocC/Semantics/Symbol/Symbol.swift @@ -595,10 +595,6 @@ extension Symbol { /// The first variant of the symbol's platform, if available. public var platformName: PlatformName? { platformNameVariants.firstValue } - - /// The first variant of the symbol's extended module, if available - @available(*, deprecated, message: "Use 'extendedModuleVariants' instead. This deprecated API will be removed after 6.0 is released") - public var extendedModule: String? { extendedModuleVariants.firstValue } /// Whether the first variant of the symbol is required in its context. public var isRequired: Bool { diff --git a/Sources/SwiftDocCUtilities/ArgumentParsing/ActionExtensions/ConvertAction+CommandInitialization.swift b/Sources/SwiftDocCUtilities/ArgumentParsing/ActionExtensions/ConvertAction+CommandInitialization.swift index 5fc21e41ad..6a6260713e 100644 --- a/Sources/SwiftDocCUtilities/ArgumentParsing/ActionExtensions/ConvertAction+CommandInitialization.swift +++ b/Sources/SwiftDocCUtilities/ArgumentParsing/ActionExtensions/ConvertAction+CommandInitialization.swift @@ -44,9 +44,7 @@ extension ConvertAction { // into a dictionary. This will throw with a descriptive error upon failure. let parsedPlatforms = try PlatformArgumentParser.parse(convert.platforms) - let additionalSymbolGraphFiles = (convert as _DeprecatedSymbolGraphFilesAccess).additionalSymbolGraphFiles + symbolGraphFiles( - in: convert.additionalSymbolGraphDirectory - ) + let additionalSymbolGraphFiles = symbolGraphFiles(in: convert.additionalSymbolGraphDirectory) let bundleDiscoveryOptions = BundleDiscoveryOptions( fallbackDisplayName: convert.fallbackBundleDisplayName, @@ -104,8 +102,3 @@ private func symbolGraphFiles(in directory: URL?) -> [URL] { return subpaths.map { directory.appendingPathComponent($0) } .filter { DocumentationBundleFileTypes.isSymbolGraphFile($0) } } - -private protocol _DeprecatedSymbolGraphFilesAccess { - var additionalSymbolGraphFiles: [URL] { get } -} -extension Docc.Convert: _DeprecatedSymbolGraphFilesAccess {} diff --git a/Sources/SwiftDocCUtilities/ArgumentParsing/Options/DocumentationBundleOption.swift b/Sources/SwiftDocCUtilities/ArgumentParsing/Options/DocumentationBundleOption.swift index 75ef1549d4..50e601cea1 100644 --- a/Sources/SwiftDocCUtilities/ArgumentParsing/Options/DocumentationBundleOption.swift +++ b/Sources/SwiftDocCUtilities/ArgumentParsing/Options/DocumentationBundleOption.swift @@ -25,6 +25,3 @@ public struct DocumentationCatalogOption: DirectoryPathOption { transform: URL.init(fileURLWithPath:)) public var url: URL? } - -@available(*, deprecated, renamed: "DocumentationCatalogOption", message: "Use 'DocumentationCatalogOption' instead. This deprecated API will be removed after 6.0 is released") -public typealias DocumentationBundleOption = DocumentationCatalogOption diff --git a/Sources/SwiftDocCUtilities/ArgumentParsing/Options/DocumentationCoverageOptionsArgument.swift b/Sources/SwiftDocCUtilities/ArgumentParsing/Options/DocumentationCoverageOptionsArgument.swift index 5b42c4a326..3037e4d452 100644 --- a/Sources/SwiftDocCUtilities/ArgumentParsing/Options/DocumentationCoverageOptionsArgument.swift +++ b/Sources/SwiftDocCUtilities/ArgumentParsing/Options/DocumentationCoverageOptionsArgument.swift @@ -40,10 +40,6 @@ public struct DocumentationCoverageOptionsArgument: ParsableArguments { valueName: "symbol-kind") ) var summaryLevel: DocumentationCoverageLevel = .brief - - @Option(help: .hidden) - @available(*, deprecated, renamed: "summaryLevel", message: "Use 'summaryLevel' instead. This deprecated API will be removed after 6.0 is released") - public var level: DocumentationCoverageLevel = .none var effectiveSummaryLevel: DocumentationCoverageLevel { guard experimentalDocumentationCoverage else { @@ -69,19 +65,9 @@ public struct DocumentationCoverageOptionsArgument: ParsableArguments { ) public var symbolKindFilter: [DocumentationCoverageOptions.KindFilterOptions.BitFlagRepresentation] = [] - @Option(parsing: ArrayParsingStrategy.upToNextOption, help: .hidden) - @available(*, deprecated, renamed: "symbolKindFilter", message: "Use 'symbolKindFilter' instead. This deprecated API will be removed after 6.0 is released") - public var kinds: [DocumentationCoverageOptions.KindFilterOptions.BitFlagRepresentation] = [] - - @available(*, deprecated) // This deprecation silences the access of the deprecated `level` and `kind` options. public mutating func validate() throws { Docc.Convert.warnAboutDeprecatedOptionIfNeeded("level", message: "Use '--coverage-summary-level' instead.") Docc.Convert.warnAboutDeprecatedOptionIfNeeded("kinds", message: "Use '--coverage-symbol-kind-filter' instead.") - - if !ProcessInfo.processInfo.arguments.contains("--coverage-summary-level"), level != .none { - summaryLevel = level - } - symbolKindFilter.append(contentsOf: kinds) } } diff --git a/Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/Convert.swift b/Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/Convert.swift index 08cc55131f..b2e7e333ce 100644 --- a/Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/Convert.swift +++ b/Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/Convert.swift @@ -62,15 +62,6 @@ extension Docc { ) var additionalSymbolGraphDirectory: URL? - @Option( - name: [.customLong("additional-symbol-graph-files")], - parsing: ArrayParsingStrategy.upToNextOption, - help: .hidden, - transform: URL.init(fileURLWithPath:) - ) - @available(*, deprecated, renamed: "additionalSymbolGraphDirectory", message: "Use 'additionalSymbolGraphDirectory' instead. This deprecated API will be removed after 6.0 is released") - var additionalSymbolGraphFiles: [URL] = [] // Remove when other tools no longer use it. (rdar://72449411) - @Option( name: [.customLong("output-path"), .customLong("output-dir"), .customShort("o")], // Remove "output-dir" when other tools no longer pass that option. (rdar://72449411) help: "The location where the documentation compiler writes the built documentation.", @@ -96,11 +87,6 @@ extension Docc { get { inputsAndOutputs.documentationCatalog } set { inputsAndOutputs.documentationCatalog = newValue } } - @available(*, deprecated, renamed: "documentationCatalog", message: "Use 'documentationCatalog' instead. This deprecated API will be removed after 6.0 is released") - public var documentationBundle: DocumentationBundleOption { - get { inputsAndOutputs.documentationCatalog } - set { inputsAndOutputs.documentationCatalog = newValue } - } /// A user-provided path to a directory of additional symbol graph files that the convert action will process. public var additionalSymbolGraphDirectory: URL? { @@ -108,12 +94,6 @@ extension Docc { set { inputsAndOutputs.additionalSymbolGraphDirectory = newValue } } - @available(*, deprecated, renamed: "additionalSymbolGraphDirectory", message: "Use 'additionalSymbolGraphDirectory' instead. This deprecated API will be removed after 6.0 is released") - public var additionalSymbolGraphFiles: [URL] { // Remove when other tools no longer use it. (rdar://72449411) - get { inputsAndOutputs.additionalSymbolGraphFiles } - set { inputsAndOutputs.additionalSymbolGraphFiles = newValue } - } - /// A user-provided location where the convert action writes the built documentation. public var providedOutputURL: URL? { get { inputsAndOutputs.providedOutputURL } @@ -352,13 +332,6 @@ extension Docc { """) ) var fallbackBundleIdentifier: String? - - @Option( - name: [.customLong("fallback-bundle-version"), .customLong("bundle-version")], // Remove spelling without "fallback" prefix when other tools no longer use it. (rdar://72449411) - help: .hidden - ) - @available(*, deprecated, message: "The bundle version isn't used for anything. This deprecated API will be removed after 6.0 is released") - var fallbackBundleVersion: String? @Option( help: ArgumentHelp("A fallback default module kind if no value is provided in the documentation catalogs's Info.plist file.", discussion: """ @@ -391,15 +364,6 @@ extension Docc { set { infoPlistFallbacks.fallbackBundleIdentifier = newValue } } - /// A user-provided fallback version for the documentation bundle. - /// - /// If the documentation catalogs's Info.plist file contains a bundle version, the documentation catalog ignores this fallback version. - @available(*, deprecated, message: "The bundle version isn't used for anything. This deprecated API will be removed after 6.0 is released") - public var fallbackBundleVersion: String? { - get { infoPlistFallbacks.fallbackBundleVersion } - set { infoPlistFallbacks.fallbackBundleVersion = newValue } - } - /// A user-provided default language for code listings. /// /// If the documentation catalogs's Info.plist file contains a default code listing language, the documentation catalog ignores this fallback language. @@ -548,11 +512,6 @@ extension Docc { ) var enableParametersAndReturnsValidation = true - // This flag only exist to allow developers to pass the previous '--enable-experimental-...' flag without errors. - @Flag(name: .customLong("enable-experimental-parameters-and-returns-validation"), help: .hidden) - @available(*, deprecated, message: "This deprecated API will be removed after 6.0 is released") - var enableExperimentalParametersAndReturnsValidation = false - @Flag(help: "Write additional metadata files to the output directory.") var emitDigest = false @@ -563,10 +522,6 @@ extension Docc { ) ) var emitLMDBIndex = false - - @Flag(help: .hidden) - @available(*, deprecated, renamed: "emitLMDBIndex", message: "Use 'emitLMDBIndex' instead. This deprecated API will be removed after 6.0 is released") - var index = false @available(*, deprecated) // This deprecation silences the access of the deprecated `index` flag. mutating func validate() throws { @@ -575,7 +530,7 @@ extension Docc { Convert.warnAboutDeprecatedOptionIfNeeded("experimental-parse-doxygen-commands", message: "This flag has no effect. Doxygen support is enabled by default.") Convert.warnAboutDeprecatedOptionIfNeeded("enable-experimental-parameters-and-returns-validation", message: "This flag has no effect. Parameter and return value validation is enabled by default.") Convert.warnAboutDeprecatedOptionIfNeeded("index", message: "Use '--emit-lmdb-index' indead.") - emitLMDBIndex = emitLMDBIndex || index + emitLMDBIndex = emitLMDBIndex } } @@ -647,12 +602,6 @@ extension Docc { set { featureFlags.enableParametersAndReturnsValidation = newValue } } - @available(*, deprecated, renamed: "enableParametersAndReturnsValidation", message: "Use 'enableParametersAndReturnsValidation' instead. This deprecated API will be removed after 6.0 is released") - public var enableExperimentalParametersAndReturnsValidation: Bool { - get { enableParametersAndReturnsValidation } - set { enableParametersAndReturnsValidation = newValue } - } - /// A user-provided value that is true if additional metadata files should be produced. /// /// Defaults to false. @@ -669,12 +618,6 @@ extension Docc { set { featureFlags.emitLMDBIndex = newValue } } - /// This value is provided for backwards compatibility with existing clients but will be removed soon. Renamed to '--emit-lmdb-index'. - @available(*, deprecated, renamed: "emitLMDBIndex", message: "Use 'emitLMDBIndex' instead. This deprecated API will be removed after 6.0 is released") - public var index: Bool { - get { featureFlags.emitLMDBIndex } - set { featureFlags.emitLMDBIndex = newValue } - } // MARK: - ParsableCommand conformance diff --git a/Tests/SwiftDocCTests/Diagnostics/DiagnosticEngineTests.swift b/Tests/SwiftDocCTests/Diagnostics/DiagnosticEngineTests.swift index efeed413d8..b83426a46b 100644 --- a/Tests/SwiftDocCTests/Diagnostics/DiagnosticEngineTests.swift +++ b/Tests/SwiftDocCTests/Diagnostics/DiagnosticEngineTests.swift @@ -21,7 +21,7 @@ class DiagnosticEngineTests: XCTestCase { func receive(_ problems: [Problem]) { expectation.fulfill() } - func finalize() { } + func flush() { } } func testEmitDiagnostic() { diff --git a/Tests/SwiftDocCUtilitiesTests/ArgumentParsing/ConvertSubcommandTests.swift b/Tests/SwiftDocCUtilitiesTests/ArgumentParsing/ConvertSubcommandTests.swift index 5d41a0eef3..98aa1aca48 100644 --- a/Tests/SwiftDocCUtilitiesTests/ArgumentParsing/ConvertSubcommandTests.swift +++ b/Tests/SwiftDocCUtilitiesTests/ArgumentParsing/ConvertSubcommandTests.swift @@ -212,7 +212,6 @@ class ConvertSubcommandTests: XCTestCase { testBundleURL.path, "--display-name", "DisplayName", "--bundle-identifier", "com.example.test", - "--bundle-version", "1.2.3", "--default-code-listing-language", "swift", ]) @@ -227,7 +226,6 @@ class ConvertSubcommandTests: XCTestCase { testBundleURL.path, "--fallback-display-name", "DisplayName", "--fallback-bundle-identifier", "com.example.test", - "--fallback-bundle-version", "1.2.3", "--default-code-listing-language", "swift", ]) @@ -280,40 +278,6 @@ class ConvertSubcommandTests: XCTestCase { "sidekit.symbols.json", ]) } - - // Deprecated option is still supported - do { - let convertOptions = try Docc.Convert.parse([ - testBundleURL.path, - "--additional-symbol-graph-files", - "/path/to/first.symbols.json", - "/path/to/second.symbols.json", - ]) - - XCTAssertEqual(convertOptions.additionalSymbolGraphFiles, [ - URL(fileURLWithPath: "/path/to/first.symbols.json"), - URL(fileURLWithPath: "/path/to/second.symbols.json"), - ]) - - let action = try ConvertAction(fromConvertCommand: convertOptions) - XCTAssertEqual(action.converter.bundleDiscoveryOptions.additionalSymbolGraphFiles, [ - URL(fileURLWithPath: "/path/to/first.symbols.json"), - URL(fileURLWithPath: "/path/to/second.symbols.json"), - ]) - } - } - - func testIndex() throws { - let convertOptions = try Docc.Convert.parse([ - testBundleURL.path, - "--index", - ]) - - XCTAssertTrue(convertOptions.emitLMDBIndex) - - let action = try ConvertAction(fromConvertCommand: convertOptions) - - XCTAssertEqual(action.buildLMDBIndex, true) } func testEmitLMDBIndex() throws { @@ -333,7 +297,6 @@ class ConvertSubcommandTests: XCTestCase { let convertOptions = try Docc.Convert.parse([ "--fallback-display-name", "DisplayName", "--fallback-bundle-identifier", "com.example.test", - "--fallback-bundle-version", "1.2.3", "--additional-symbol-graph-dir", testBundleURL.path, @@ -609,10 +572,6 @@ class ConvertSubcommandTests: XCTestCase { let noFlagConvert = try Docc.Convert.parse([]) XCTAssertEqual(noFlagConvert.enableParametersAndReturnsValidation, true) - // It's allowed to pass the previous "--enable-experimental-..." flag. - let oldFlagConvert = try Docc.Convert.parse(["--enable-experimental-parameters-and-returns-validation"]) - XCTAssertEqual(oldFlagConvert.enableParametersAndReturnsValidation, true) - // It's allowed to pass the redundant "--enable-..." flag. let enabledFlagConvert = try Docc.Convert.parse(["--enable-parameters-and-returns-validation"]) XCTAssertEqual(enabledFlagConvert.enableParametersAndReturnsValidation, true) From 26028da77136c5cc27b0549a34eabfcba2a3fd91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20R=C3=B6nnqvist?= Date: Wed, 25 Sep 2024 09:36:44 +0100 Subject: [PATCH 2/2] Update copyright year for modified files --- .../Infrastructure/Diagnostics/DiagnosticConsumer.swift | 2 +- .../SwiftDocC/Infrastructure/Diagnostics/DiagnosticEngine.swift | 2 +- .../ActionExtensions/ConvertAction+CommandInitialization.swift | 2 +- .../ArgumentParsing/Options/DocumentationBundleOption.swift | 2 +- Tests/SwiftDocCTests/Diagnostics/DiagnosticEngineTests.swift | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsumer.swift b/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsumer.swift index 7b71800722..50a9d74935 100644 --- a/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsumer.swift +++ b/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsumer.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021-2023 Apple Inc. and the Swift project authors + Copyright (c) 2021-2024 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information diff --git a/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticEngine.swift b/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticEngine.swift index a7f1d44a2d..35bfeceb14 100644 --- a/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticEngine.swift +++ b/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticEngine.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021-2022 Apple Inc. and the Swift project authors + Copyright (c) 2021-2024 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information diff --git a/Sources/SwiftDocCUtilities/ArgumentParsing/ActionExtensions/ConvertAction+CommandInitialization.swift b/Sources/SwiftDocCUtilities/ArgumentParsing/ActionExtensions/ConvertAction+CommandInitialization.swift index 6a6260713e..9ef9c7e46f 100644 --- a/Sources/SwiftDocCUtilities/ArgumentParsing/ActionExtensions/ConvertAction+CommandInitialization.swift +++ b/Sources/SwiftDocCUtilities/ArgumentParsing/ActionExtensions/ConvertAction+CommandInitialization.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021-2023 Apple Inc. and the Swift project authors + Copyright (c) 2021-2024 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information diff --git a/Sources/SwiftDocCUtilities/ArgumentParsing/Options/DocumentationBundleOption.swift b/Sources/SwiftDocCUtilities/ArgumentParsing/Options/DocumentationBundleOption.swift index 50e601cea1..494e75dfa3 100644 --- a/Sources/SwiftDocCUtilities/ArgumentParsing/Options/DocumentationBundleOption.swift +++ b/Sources/SwiftDocCUtilities/ArgumentParsing/Options/DocumentationBundleOption.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021-2023 Apple Inc. and the Swift project authors + Copyright (c) 2021-2024 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information diff --git a/Tests/SwiftDocCTests/Diagnostics/DiagnosticEngineTests.swift b/Tests/SwiftDocCTests/Diagnostics/DiagnosticEngineTests.swift index b83426a46b..cfcb1b79eb 100644 --- a/Tests/SwiftDocCTests/Diagnostics/DiagnosticEngineTests.swift +++ b/Tests/SwiftDocCTests/Diagnostics/DiagnosticEngineTests.swift @@ -1,7 +1,7 @@ /* This source file is part of the Swift.org open source project - Copyright (c) 2021-2023 Apple Inc. and the Swift project authors + Copyright (c) 2021-2024 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See https://swift.org/LICENSE.txt for license information