Skip to content
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

Enable dynamic dispatch for package path manifest loading #8057

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
37 changes: 35 additions & 2 deletions Sources/PackageLoading/ManifestLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ extension ManifestParseError: CustomStringConvertible {

/// Protocol for the manifest loader interface.
public protocol ManifestLoaderProtocol {
/// Load the manifest for the package at `path`.
/// Load the manifest at `path`.
///
/// - Parameters:
/// - manifestPath: The root path of the package.
/// - manifestPath: The path of the manifest file to load.
/// - manifestToolsVersion: The version of the tools the manifest supports.
/// - packageIdentity: the identity of the package
/// - packageKind: The kind of package the manifest is from.
Expand All @@ -112,6 +112,7 @@ public protocol ManifestLoaderProtocol {
/// - dependencyMapper: A helper to map dependencies.
/// - fileSystem: File system to load from.
/// - observabilityScope: Observability scope to emit diagnostics.
/// - delegateQueue: The dispatch queue to perform the delegate callbacks on.
/// - callbackQueue: The dispatch queue to perform completion handler on.
/// - completion: The completion handler .
func load(
Expand All @@ -130,6 +131,38 @@ public protocol ManifestLoaderProtocol {
completion: @escaping (Result<Manifest, Error>) -> Void
)

/// Load the manifest for the package at `path`.
///
/// - Parameters:
/// - packagePath: The root path of the package.
/// - packageIdentity: the identity of the package
/// - packageKind: The kind of package the manifest is from.
/// - packageLocation: The location the package the manifest was loaded from.
/// - packageVersion: Optional. The version and revision of the package.
/// - currentToolsVersion The current tools version.
/// - identityResolver: A helper to resolve identities based on configuration.
/// - dependencyMapper: A helper to map dependencies.
/// - fileSystem: File system to load from.
/// - observabilityScope: Observability scope to emit diagnostics.
/// - delegateQueue: The dispatch queue to perform the delegate callbacks on.
/// - callbackQueue: The dispatch queue to perform completion handler on.
/// - completion: The completion handler .
func load(
packagePath: AbsolutePath,
packageIdentity: PackageIdentity,
packageKind: PackageReference.Kind,
packageLocation: String,
packageVersion: (version: Version?, revision: String?)?,
currentToolsVersion: ToolsVersion,
identityResolver: IdentityResolver,
dependencyMapper: DependencyMapper,
fileSystem: FileSystem,
observabilityScope: ObservabilityScope,
delegateQueue: DispatchQueue,
callbackQueue: DispatchQueue,
completion: @escaping (Result<Manifest, Error>) -> Void
)

/// Reset any internal cache held by the manifest loader.
func resetCache(observabilityScope: ObservabilityScope)

Expand Down