Skip to content

Commit c2f7eef

Browse files
authored
remove deprecated code (#3240)
motivation: cleanup changes: * remove check for < macOS 15 which is now the min target * remove code deprecated in or before 5.4
1 parent 543f9b0 commit c2f7eef

File tree

8 files changed

+2
-212
lines changed

8 files changed

+2
-212
lines changed

Sources/Basics/JSON+Extensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ extension JSONEncoder {
8484
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
8585
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
8686
encoder.outputFormatting = [.sortedKeys, .prettyPrinted, .withoutEscapingSlashes]
87-
} else if #available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
87+
} else if #available(iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
8888
encoder.outputFormatting = [.sortedKeys, .prettyPrinted]
8989
} else {
9090
encoder.outputFormatting = [.prettyPrinted]

Sources/PackageGraph/PackageContainer.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ public protocol PackageContainer {
5959
/// version appears first.
6060
func versionsDescending() throws -> [Version]
6161

62-
/// Get the list of versions in the repository sorted in the reverse order, that is the latest
63-
/// version appears first.
64-
// FIXME: deprecated 12/2020, remove once clients migrate
65-
@available(*, deprecated, message: "use versionsDescending instead")
66-
func reversedVersions() throws -> [Version]
67-
6862
// FIXME: We should perhaps define some particularly useful error codes
6963
// here, so the resolver can handle errors more meaningfully.
7064
//

Sources/PackageGraph/PackageGraph.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,6 @@ public struct PackageGraph {
8686
/// All root and root dependency packages provided as input to the graph.
8787
public let inputPackages: [ResolvedPackage]
8888

89-
/// Construct a package graph directly.
90-
// FIXME: deprecated 12/2020, remove once clients migrate
91-
@available(*, deprecated, message: "use throwing variant instead (init(rootPackages:rootDependencies:dependencies:)")
92-
public init(
93-
rootPackages: [ResolvedPackage],
94-
rootDependencies: [ResolvedPackage] = [],
95-
requiredDependencies: Set<PackageReference>
96-
) {
97-
try! self.init(rootPackages: rootPackages, rootDependencies: rootDependencies, dependencies: requiredDependencies)
98-
}
99-
10089
/// Construct a package graph directly.
10190
public init(
10291
rootPackages: [ResolvedPackage],

Sources/PackageLoading/ManifestLoader.swift

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -154,47 +154,6 @@ public final class ManifestLoader: ManifestLoaderProtocol {
154154
self.operationQueue.maxConcurrentOperationCount = Concurrency.maxOperations
155155
}
156156

157-
// FIXME: deprecated before 12/2020, remove once clients migrate
158-
@available(*, deprecated)
159-
public convenience init(resources: ManifestResourceProvider, isManifestSandboxEnabled: Bool = true) {
160-
self.init(manifestResources: resources, isManifestSandboxEnabled: isManifestSandboxEnabled)
161-
}
162-
163-
// FIXME: deprecated 12/2020, remove once clients migrate
164-
@available(*, deprecated, message: "use non-blocking version instead")
165-
public static func loadManifest(
166-
packagePath: AbsolutePath,
167-
swiftCompiler: AbsolutePath,
168-
swiftCompilerFlags: [String],
169-
packageKind: PackageReference.Kind
170-
) throws -> Manifest {
171-
try temp_await{
172-
Self.loadManifest(packagePath: packagePath,
173-
swiftCompiler: swiftCompiler,
174-
swiftCompilerFlags: swiftCompilerFlags,
175-
packageKind: packageKind,
176-
on: .global(),
177-
completion: $0)
178-
}
179-
}
180-
181-
@available(*, deprecated, message: "use at:kind: version instead")
182-
public static func loadManifest(
183-
packagePath: AbsolutePath,
184-
swiftCompiler: AbsolutePath,
185-
swiftCompilerFlags: [String],
186-
packageKind: PackageReference.Kind,
187-
on queue: DispatchQueue,
188-
completion: @escaping (Result<Manifest, Error>) -> Void
189-
) {
190-
Self.loadManifest(at: packagePath,
191-
kind: packageKind,
192-
swiftCompiler: swiftCompiler,
193-
swiftCompilerFlags: swiftCompilerFlags,
194-
on: queue,
195-
completion: completion)
196-
}
197-
198157
/// Loads a manifest from a package repository using the resources associated with a particular `swiftc` executable.
199158
///
200159
/// - Parameters:
@@ -232,32 +191,6 @@ public final class ManifestLoader: ManifestLoaderProtocol {
232191
}
233192
}
234193

235-
// FIXME: deprecated 12/2020, remove once clients migrate
236-
@available(*, deprecated, message: "use non-blocking version instead")
237-
public func load(
238-
packagePath path: AbsolutePath,
239-
baseURL: String,
240-
version: Version?,
241-
revision: String?,
242-
toolsVersion: ToolsVersion,
243-
packageKind: PackageReference.Kind,
244-
fileSystem: FileSystem? = nil,
245-
diagnostics: DiagnosticsEngine? = nil
246-
) throws -> Manifest {
247-
try temp_await{
248-
self.load(at: path,
249-
packageKind: packageKind,
250-
packageLocation: baseURL,
251-
version: version,
252-
revision: revision,
253-
toolsVersion: toolsVersion,
254-
fileSystem: fileSystem ?? localFileSystem,
255-
diagnostics: diagnostics,
256-
on: .global(),
257-
completion: $0)
258-
}
259-
}
260-
261194
public func load(
262195
at path: AbsolutePath,
263196
packageKind: PackageReference.Kind,

Sources/PackageLoading/PackageBuilder.swift

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -273,52 +273,6 @@ public final class PackageBuilder {
273273
self.warnAboutImplicitExecutableTargets = warnAboutImplicitExecutableTargets
274274
}
275275

276-
// FIXME: deprecated 12/2020, remove once clients migrate
277-
@available(*, deprecated, message: "use non-blocking version instead")
278-
public static func loadPackage(
279-
packagePath: AbsolutePath,
280-
swiftCompiler: AbsolutePath,
281-
swiftCompilerFlags: [String],
282-
xcTestMinimumDeploymentTargets: [PackageModel.Platform:PlatformVersion]
283-
= MinimumDeploymentTarget.default.xcTestMinimumDeploymentTargets,
284-
diagnostics: DiagnosticsEngine,
285-
kind: PackageReference.Kind = .root
286-
) throws -> Package {
287-
return try temp_await {
288-
Self.loadPackage(packagePath: packagePath,
289-
swiftCompiler: swiftCompiler,
290-
swiftCompilerFlags: swiftCompilerFlags,
291-
xcTestMinimumDeploymentTargets: xcTestMinimumDeploymentTargets,
292-
diagnostics: diagnostics,
293-
kind: kind,
294-
on: .global(),
295-
completion: $0)
296-
}
297-
}
298-
299-
// FIXME: deprecated 2/2021, remove once clients migrate
300-
@available(*, deprecated, message: "use at:kind:... version instead")
301-
public static func loadPackage(
302-
packagePath: AbsolutePath,
303-
swiftCompiler: AbsolutePath,
304-
swiftCompilerFlags: [String],
305-
xcTestMinimumDeploymentTargets: [PackageModel.Platform:PlatformVersion]
306-
= MinimumDeploymentTarget.default.xcTestMinimumDeploymentTargets,
307-
diagnostics: DiagnosticsEngine,
308-
kind: PackageReference.Kind = .root,
309-
on queue: DispatchQueue,
310-
completion: @escaping (Result<Package, Error>) -> Void
311-
) {
312-
Self.loadPackage(at: packagePath,
313-
kind: kind,
314-
swiftCompiler: swiftCompiler,
315-
swiftCompilerFlags: swiftCompilerFlags,
316-
xcTestMinimumDeploymentTargets: xcTestMinimumDeploymentTargets,
317-
diagnostics: diagnostics,
318-
on: queue,
319-
completion: completion)
320-
}
321-
322276
/// Loads a package from a package repository using the resources associated with a particular `swiftc` executable.
323277
///
324278
/// - Parameters:

Sources/PackageModel/Manifest.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public final class Manifest: ObjectIdentifierProtocol {
4141
/// The repository URL the manifest was loaded from.
4242
public let packageLocation: String
4343

44+
// FIXME: deprecated 2/2021, remove once clients migrate
4445
@available(*, deprecated)
4546
public var url: String {
4647
get {

Sources/SourceControl/RepositoryManager.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,9 @@ public protocol RepositoryManagerDelegate: AnyObject {
2020
/// Called when a repository is about to be fetched.
2121
func fetchingWillBegin(handle: RepositoryManager.RepositoryHandle, fetchDetails: RepositoryManager.FetchDetails?)
2222

23-
/// Called when a repository is about to be fetched.
24-
@available(*, deprecated)
25-
func fetchingWillBegin(handle: RepositoryManager.RepositoryHandle)
26-
2723
/// Called when a repository has finished fetching.
2824
func fetchingDidFinish(handle: RepositoryManager.RepositoryHandle, fetchDetails: RepositoryManager.FetchDetails?, error: Swift.Error?)
2925

30-
/// Called when a repository has finished fetching.
31-
@available(*, deprecated)
32-
func fetchingDidFinish(handle: RepositoryManager.RepositoryHandle, error: Swift.Error?)
33-
3426
/// Called when a repository has started updating from its remote.
3527
func handleWillUpdate(handle: RepositoryManager.RepositoryHandle)
3628

@@ -39,17 +31,6 @@ public protocol RepositoryManagerDelegate: AnyObject {
3931
}
4032

4133
public extension RepositoryManagerDelegate {
42-
43-
@available(*, deprecated)
44-
func fetchingWillBegin(handle: RepositoryManager.RepositoryHandle, fetchDetails: RepositoryManager.FetchDetails?) {
45-
fetchingWillBegin(handle: handle)
46-
}
47-
48-
@available(*, deprecated)
49-
func fetchingDidFinish(handle: RepositoryManager.RepositoryHandle, fetchDetails: RepositoryManager.FetchDetails?, error: Swift.Error?) {
50-
fetchingDidFinish(handle: handle, error: error)
51-
}
52-
5334
func fetchingWillBegin(handle: RepositoryManager.RepositoryHandle) {}
5435
func fetchingDidFinish(handle: RepositoryManager.RepositoryHandle, error: Swift.Error?) {}
5536
func handleWillUpdate(handle: RepositoryManager.RepositoryHandle) {}

Sources/Workspace/Workspace.swift

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,9 @@ public protocol WorkspaceDelegate: AnyObject {
4848
/// The workspace has started fetching this repository.
4949
func fetchingWillBegin(repository: String, fetchDetails: RepositoryManager.FetchDetails?)
5050

51-
/// The workspace has started fetching this repository.
52-
@available(*, deprecated)
53-
func fetchingWillBegin(repository: String)
54-
5551
/// The workspace has finished fetching this repository.
5652
func fetchingDidFinish(repository: String, fetchDetails: RepositoryManager.FetchDetails?, diagnostic: Diagnostic?)
5753

58-
/// The workspace has finished fetching this repository.
59-
@available(*, deprecated)
60-
func fetchingDidFinish(repository: String, diagnostic: Diagnostic?)
61-
6254
/// The workspace has started updating this repository.
6355
func repositoryWillUpdate(_ repository: String)
6456

@@ -127,17 +119,6 @@ public extension WorkspaceDelegate {
127119

128120
func fetchingWillBegin(repository: String) {}
129121
func fetchingDidFinish(repository: String, diagnostic: Diagnostic?) {}
130-
131-
@available(*, deprecated)
132-
func fetchingWillBegin(repository: String, fetchDetails: RepositoryManager.FetchDetails?) {
133-
fetchingWillBegin(repository: repository)
134-
}
135-
136-
@available(*, deprecated)
137-
func fetchingDidFinish(repository: String, fetchDetails: RepositoryManager.FetchDetails?, diagnostic: Diagnostic?) {
138-
fetchingDidFinish(repository: repository, diagnostic: diagnostic)
139-
}
140-
141122
}
142123

143124
private class WorkspaceRepositoryManagerDelegate: RepositoryManagerDelegate {
@@ -651,33 +632,6 @@ extension Workspace {
651632
return try workspace.loadPackageGraph(rootPath: packagePath, diagnostics: diagnostics)
652633
}
653634

654-
/// Fetch and load the complete package at the given path.
655-
///
656-
/// This will implicitly cause any dependencies not yet present in the
657-
/// working checkouts to be resolved, cloned, and checked out.
658-
///
659-
/// - Returns: The loaded package graph.
660-
// FIXME: deprecated 12/2020, remove once clients migrate
661-
@available(*, deprecated, message: "use throwing variant instead (loadPackageGraph(input:)")
662-
@discardableResult
663-
public func loadPackageGraph(
664-
root: PackageGraphRootInput,
665-
explicitProduct: String? = nil,
666-
createMultipleTestProducts: Bool = false,
667-
createREPLProduct: Bool = false,
668-
forceResolvedVersions: Bool = false,
669-
diagnostics: DiagnosticsEngine,
670-
xcTestMinimumDeploymentTargets: [PackageModel.Platform:PlatformVersion]? = nil
671-
) -> PackageGraph {
672-
try! self.loadPackageGraph(rootInput: root,
673-
explicitProduct: explicitProduct,
674-
createMultipleTestProducts: createMultipleTestProducts,
675-
createREPLProduct: createREPLProduct,
676-
forceResolvedVersions: forceResolvedVersions,
677-
diagnostics: diagnostics,
678-
xcTestMinimumDeploymentTargets: xcTestMinimumDeploymentTargets)
679-
}
680-
681635
@discardableResult
682636
public func loadPackageGraph(
683637
rootInput root: PackageGraphRootInput,
@@ -734,22 +688,6 @@ extension Workspace {
734688
)
735689
}
736690

737-
738-
// FIXME: deprecated 12/2020, remove once clients migrate
739-
@discardableResult
740-
@available(*, deprecated, message: "use throwing variant instead (loadPackageGraph(rootPath:)")
741-
public func loadPackageGraph(
742-
root: AbsolutePath,
743-
explicitProduct: String? = nil,
744-
diagnostics: DiagnosticsEngine
745-
) -> PackageGraph {
746-
try! self.loadPackageGraph(
747-
rootInput: PackageGraphRootInput(packages: [root], mirrors: config.mirrors),
748-
explicitProduct: explicitProduct,
749-
diagnostics: diagnostics
750-
)
751-
}
752-
753691
@discardableResult
754692
public func loadPackageGraph(
755693
rootPath: AbsolutePath,

0 commit comments

Comments
 (0)