Skip to content

Commit 0492f86

Browse files
committed
Deprecate DocumentationWorkspaceDataProvider
1 parent 66dad3e commit 0492f86

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

Sources/SwiftDocC/Infrastructure/Workspace/DocumentationWorkspaceDataProvider.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
This source file is part of the Swift.org open source project
33

4-
Copyright (c) 2021 Apple Inc. and the Swift project authors
4+
Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
55
Licensed under Apache License v2.0 with Runtime Library Exception
66

77
See https://swift.org/LICENSE.txt for license information
@@ -11,6 +11,7 @@
1111
import Foundation
1212

1313
/// A type that vends bundles and responds to requests for data.
14+
@available(*, deprecated, message: "Pass the context its inputs at initialization instead. This deprecated API will be removed after 6.2 is released")
1415
public protocol DocumentationWorkspaceDataProvider {
1516
/// A string that uniquely identifies this data provider.
1617
///
@@ -35,6 +36,7 @@ public protocol DocumentationWorkspaceDataProvider {
3536
func bundles(options: BundleDiscoveryOptions) throws -> [DocumentationBundle]
3637
}
3738

39+
@available(*, deprecated, message: "Pass the context its inputs at initialization instead. This deprecated API will be removed after 6.2 is released")
3840
public extension DocumentationWorkspaceDataProvider {
3941
/// Returns the documentation bundles that your data provider provides; discovered with the default options.
4042
///

Sources/SwiftDocC/Infrastructure/Workspace/LocalFileSystemDataProvider+BundleDiscovery.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
import Foundation
1212

13-
extension LocalFileSystemDataProvider {
13+
@available(*, deprecated, message: "Use 'DocumentationContext.InputProvider' instead. This deprecated API will be removed after 6.2 is released")
14+
extension LocalFileSystemDataProvider: DocumentationWorkspaceDataProvider {
1415
public func bundles(options: BundleDiscoveryOptions) throws -> [DocumentationBundle] {
1516
var bundles = try bundlesInTree(fileSystem, options: options)
1617

Sources/SwiftDocC/Infrastructure/Workspace/LocalFileSystemDataProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import Foundation
1212

1313
/// A type that provides documentation bundles that it discovers by traversing the local file system.
14-
public struct LocalFileSystemDataProvider: DocumentationWorkspaceDataProvider, FileSystemProvider {
14+
public struct LocalFileSystemDataProvider: FileSystemProvider {
1515
public var identifier: String = UUID().uuidString
1616

1717
/// The location that this provider searches for documentation bundles in.

Tests/SwiftDocCTests/Infrastructure/Input Discovery/DocumentationInputsProviderTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import SwiftDocCTestUtilities
1414

1515
class DocumentationInputsProviderTests: XCTestCase {
1616

17+
// After 6.2 we can update this test to verify that the input provider discovers the same inputs regardless of FileManagerProtocol
18+
@available(*, deprecated, message: "This test uses `LocalFileSystemDataProvider` as a `DocumentationWorkspaceDataProvider` which is deprecated and will be removed after 6.2 is released")
1719
func testDiscoversSameFilesAsPreviousImplementation() throws {
1820
let folderHierarchy = Folder(name: "one", content: [
1921
Folder(name: "two", content: [

0 commit comments

Comments
 (0)