Skip to content

remove deprecated code #3240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Basics/JSON+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ extension JSONEncoder {
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
encoder.outputFormatting = [.sortedKeys, .prettyPrinted, .withoutEscapingSlashes]
} else if #available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
} else if #available(iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
encoder.outputFormatting = [.sortedKeys, .prettyPrinted]
} else {
encoder.outputFormatting = [.prettyPrinted]
Expand Down
6 changes: 0 additions & 6 deletions Sources/PackageGraph/PackageContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ public protocol PackageContainer {
/// version appears first.
func versionsDescending() throws -> [Version]

/// Get the list of versions in the repository sorted in the reverse order, that is the latest
/// version appears first.
// FIXME: deprecated 12/2020, remove once clients migrate
@available(*, deprecated, message: "use versionsDescending instead")
func reversedVersions() throws -> [Version]

// FIXME: We should perhaps define some particularly useful error codes
// here, so the resolver can handle errors more meaningfully.
//
Expand Down
11 changes: 0 additions & 11 deletions Sources/PackageGraph/PackageGraph.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ public struct PackageGraph {
/// All root and root dependency packages provided as input to the graph.
public let inputPackages: [ResolvedPackage]

/// Construct a package graph directly.
// FIXME: deprecated 12/2020, remove once clients migrate
@available(*, deprecated, message: "use throwing variant instead (init(rootPackages:rootDependencies:dependencies:)")
public init(
rootPackages: [ResolvedPackage],
rootDependencies: [ResolvedPackage] = [],
requiredDependencies: Set<PackageReference>
) {
try! self.init(rootPackages: rootPackages, rootDependencies: rootDependencies, dependencies: requiredDependencies)
}

/// Construct a package graph directly.
public init(
rootPackages: [ResolvedPackage],
Expand Down
67 changes: 0 additions & 67 deletions Sources/PackageLoading/ManifestLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,47 +154,6 @@ public final class ManifestLoader: ManifestLoaderProtocol {
self.operationQueue.maxConcurrentOperationCount = Concurrency.maxOperations
}

// FIXME: deprecated before 12/2020, remove once clients migrate
@available(*, deprecated)
public convenience init(resources: ManifestResourceProvider, isManifestSandboxEnabled: Bool = true) {
self.init(manifestResources: resources, isManifestSandboxEnabled: isManifestSandboxEnabled)
}

// FIXME: deprecated 12/2020, remove once clients migrate
@available(*, deprecated, message: "use non-blocking version instead")
public static func loadManifest(
packagePath: AbsolutePath,
swiftCompiler: AbsolutePath,
swiftCompilerFlags: [String],
packageKind: PackageReference.Kind
) throws -> Manifest {
try temp_await{
Self.loadManifest(packagePath: packagePath,
swiftCompiler: swiftCompiler,
swiftCompilerFlags: swiftCompilerFlags,
packageKind: packageKind,
on: .global(),
completion: $0)
}
}

@available(*, deprecated, message: "use at:kind: version instead")
public static func loadManifest(
packagePath: AbsolutePath,
swiftCompiler: AbsolutePath,
swiftCompilerFlags: [String],
packageKind: PackageReference.Kind,
on queue: DispatchQueue,
completion: @escaping (Result<Manifest, Error>) -> Void
) {
Self.loadManifest(at: packagePath,
kind: packageKind,
swiftCompiler: swiftCompiler,
swiftCompilerFlags: swiftCompilerFlags,
on: queue,
completion: completion)
}

/// Loads a manifest from a package repository using the resources associated with a particular `swiftc` executable.
///
/// - Parameters:
Expand Down Expand Up @@ -232,32 +191,6 @@ public final class ManifestLoader: ManifestLoaderProtocol {
}
}

// FIXME: deprecated 12/2020, remove once clients migrate
@available(*, deprecated, message: "use non-blocking version instead")
public func load(
packagePath path: AbsolutePath,
baseURL: String,
version: Version?,
revision: String?,
toolsVersion: ToolsVersion,
packageKind: PackageReference.Kind,
fileSystem: FileSystem? = nil,
diagnostics: DiagnosticsEngine? = nil
) throws -> Manifest {
try temp_await{
self.load(at: path,
packageKind: packageKind,
packageLocation: baseURL,
version: version,
revision: revision,
toolsVersion: toolsVersion,
fileSystem: fileSystem ?? localFileSystem,
diagnostics: diagnostics,
on: .global(),
completion: $0)
}
}

public func load(
at path: AbsolutePath,
packageKind: PackageReference.Kind,
Expand Down
46 changes: 0 additions & 46 deletions Sources/PackageLoading/PackageBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,52 +273,6 @@ public final class PackageBuilder {
self.warnAboutImplicitExecutableTargets = warnAboutImplicitExecutableTargets
}

// FIXME: deprecated 12/2020, remove once clients migrate
@available(*, deprecated, message: "use non-blocking version instead")
public static func loadPackage(
packagePath: AbsolutePath,
swiftCompiler: AbsolutePath,
swiftCompilerFlags: [String],
xcTestMinimumDeploymentTargets: [PackageModel.Platform:PlatformVersion]
= MinimumDeploymentTarget.default.xcTestMinimumDeploymentTargets,
diagnostics: DiagnosticsEngine,
kind: PackageReference.Kind = .root
) throws -> Package {
return try temp_await {
Self.loadPackage(packagePath: packagePath,
swiftCompiler: swiftCompiler,
swiftCompilerFlags: swiftCompilerFlags,
xcTestMinimumDeploymentTargets: xcTestMinimumDeploymentTargets,
diagnostics: diagnostics,
kind: kind,
on: .global(),
completion: $0)
}
}

// FIXME: deprecated 2/2021, remove once clients migrate
@available(*, deprecated, message: "use at:kind:... version instead")
public static func loadPackage(
packagePath: AbsolutePath,
swiftCompiler: AbsolutePath,
swiftCompilerFlags: [String],
xcTestMinimumDeploymentTargets: [PackageModel.Platform:PlatformVersion]
= MinimumDeploymentTarget.default.xcTestMinimumDeploymentTargets,
diagnostics: DiagnosticsEngine,
kind: PackageReference.Kind = .root,
on queue: DispatchQueue,
completion: @escaping (Result<Package, Error>) -> Void
) {
Self.loadPackage(at: packagePath,
kind: kind,
swiftCompiler: swiftCompiler,
swiftCompilerFlags: swiftCompilerFlags,
xcTestMinimumDeploymentTargets: xcTestMinimumDeploymentTargets,
diagnostics: diagnostics,
on: queue,
completion: completion)
}

/// Loads a package from a package repository using the resources associated with a particular `swiftc` executable.
///
/// - Parameters:
Expand Down
1 change: 1 addition & 0 deletions Sources/PackageModel/Manifest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public final class Manifest: ObjectIdentifierProtocol {
/// The repository URL the manifest was loaded from.
public let packageLocation: String

// FIXME: deprecated 2/2021, remove once clients migrate
@available(*, deprecated)
public var url: String {
get {
Expand Down
19 changes: 0 additions & 19 deletions Sources/SourceControl/RepositoryManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,9 @@ public protocol RepositoryManagerDelegate: AnyObject {
/// Called when a repository is about to be fetched.
func fetchingWillBegin(handle: RepositoryManager.RepositoryHandle, fetchDetails: RepositoryManager.FetchDetails?)

/// Called when a repository is about to be fetched.
@available(*, deprecated)
func fetchingWillBegin(handle: RepositoryManager.RepositoryHandle)

/// Called when a repository has finished fetching.
func fetchingDidFinish(handle: RepositoryManager.RepositoryHandle, fetchDetails: RepositoryManager.FetchDetails?, error: Swift.Error?)

/// Called when a repository has finished fetching.
@available(*, deprecated)
func fetchingDidFinish(handle: RepositoryManager.RepositoryHandle, error: Swift.Error?)

/// Called when a repository has started updating from its remote.
func handleWillUpdate(handle: RepositoryManager.RepositoryHandle)

Expand All @@ -39,17 +31,6 @@ public protocol RepositoryManagerDelegate: AnyObject {
}

public extension RepositoryManagerDelegate {

@available(*, deprecated)
func fetchingWillBegin(handle: RepositoryManager.RepositoryHandle, fetchDetails: RepositoryManager.FetchDetails?) {
fetchingWillBegin(handle: handle)
}

@available(*, deprecated)
func fetchingDidFinish(handle: RepositoryManager.RepositoryHandle, fetchDetails: RepositoryManager.FetchDetails?, error: Swift.Error?) {
fetchingDidFinish(handle: handle, error: error)
}

func fetchingWillBegin(handle: RepositoryManager.RepositoryHandle) {}
func fetchingDidFinish(handle: RepositoryManager.RepositoryHandle, error: Swift.Error?) {}
func handleWillUpdate(handle: RepositoryManager.RepositoryHandle) {}
Expand Down
62 changes: 0 additions & 62 deletions Sources/Workspace/Workspace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,9 @@ public protocol WorkspaceDelegate: AnyObject {
/// The workspace has started fetching this repository.
func fetchingWillBegin(repository: String, fetchDetails: RepositoryManager.FetchDetails?)

/// The workspace has started fetching this repository.
@available(*, deprecated)
func fetchingWillBegin(repository: String)

/// The workspace has finished fetching this repository.
func fetchingDidFinish(repository: String, fetchDetails: RepositoryManager.FetchDetails?, diagnostic: Diagnostic?)

/// The workspace has finished fetching this repository.
@available(*, deprecated)
func fetchingDidFinish(repository: String, diagnostic: Diagnostic?)

/// The workspace has started updating this repository.
func repositoryWillUpdate(_ repository: String)

Expand Down Expand Up @@ -127,17 +119,6 @@ public extension WorkspaceDelegate {

func fetchingWillBegin(repository: String) {}
func fetchingDidFinish(repository: String, diagnostic: Diagnostic?) {}

@available(*, deprecated)
func fetchingWillBegin(repository: String, fetchDetails: RepositoryManager.FetchDetails?) {
fetchingWillBegin(repository: repository)
}

@available(*, deprecated)
func fetchingDidFinish(repository: String, fetchDetails: RepositoryManager.FetchDetails?, diagnostic: Diagnostic?) {
fetchingDidFinish(repository: repository, diagnostic: diagnostic)
}

}

private class WorkspaceRepositoryManagerDelegate: RepositoryManagerDelegate {
Expand Down Expand Up @@ -651,33 +632,6 @@ extension Workspace {
return try workspace.loadPackageGraph(rootPath: packagePath, diagnostics: diagnostics)
}

/// Fetch and load the complete package at the given path.
///
/// This will implicitly cause any dependencies not yet present in the
/// working checkouts to be resolved, cloned, and checked out.
///
/// - Returns: The loaded package graph.
// FIXME: deprecated 12/2020, remove once clients migrate
@available(*, deprecated, message: "use throwing variant instead (loadPackageGraph(input:)")
@discardableResult
public func loadPackageGraph(
root: PackageGraphRootInput,
explicitProduct: String? = nil,
createMultipleTestProducts: Bool = false,
createREPLProduct: Bool = false,
forceResolvedVersions: Bool = false,
diagnostics: DiagnosticsEngine,
xcTestMinimumDeploymentTargets: [PackageModel.Platform:PlatformVersion]? = nil
) -> PackageGraph {
try! self.loadPackageGraph(rootInput: root,
explicitProduct: explicitProduct,
createMultipleTestProducts: createMultipleTestProducts,
createREPLProduct: createREPLProduct,
forceResolvedVersions: forceResolvedVersions,
diagnostics: diagnostics,
xcTestMinimumDeploymentTargets: xcTestMinimumDeploymentTargets)
}

@discardableResult
public func loadPackageGraph(
rootInput root: PackageGraphRootInput,
Expand Down Expand Up @@ -734,22 +688,6 @@ extension Workspace {
)
}


// FIXME: deprecated 12/2020, remove once clients migrate
@discardableResult
@available(*, deprecated, message: "use throwing variant instead (loadPackageGraph(rootPath:)")
public func loadPackageGraph(
root: AbsolutePath,
explicitProduct: String? = nil,
diagnostics: DiagnosticsEngine
) -> PackageGraph {
try! self.loadPackageGraph(
rootInput: PackageGraphRootInput(packages: [root], mirrors: config.mirrors),
explicitProduct: explicitProduct,
diagnostics: diagnostics
)
}

@discardableResult
public func loadPackageGraph(
rootPath: AbsolutePath,
Expand Down