@@ -26,7 +26,7 @@ public struct PubGrubDependencyResolver {
26
26
public typealias Constraint = PackageContainerConstraint
27
27
28
28
/// the mutable state that get computed
29
- internal final class State {
29
+ package final class State {
30
30
/// The root package reference.
31
31
let root : DependencyResolutionNode
32
32
@@ -44,7 +44,7 @@ public struct PubGrubDependencyResolver {
44
44
45
45
private let lock = NSLock ( )
46
46
47
- init ( root: DependencyResolutionNode ,
47
+ package init ( root: DependencyResolutionNode ,
48
48
overriddenPackages: [ PackageReference : ( version: BoundVersion , products: ProductFilter ) ] = [ : ] ,
49
49
solution: PartialSolution = PartialSolution ( ) )
50
50
{
@@ -53,7 +53,7 @@ public struct PubGrubDependencyResolver {
53
53
self . solution = solution
54
54
}
55
55
56
- func addIncompatibility( _ incompatibility: Incompatibility , at location: LogLocation ) {
56
+ package func addIncompatibility( _ incompatibility: Incompatibility , at location: LogLocation ) {
57
57
self . lock. withLock {
58
58
// log("incompat: \(incompatibility) \(location)")
59
59
for package in incompatibility. terms. map ( \. node) {
@@ -69,7 +69,7 @@ public struct PubGrubDependencyResolver {
69
69
}
70
70
71
71
/// Find all incompatibilities containing a positive term for a given package.
72
- func positiveIncompatibilities( for node: DependencyResolutionNode ) -> [ Incompatibility ] ? {
72
+ package func positiveIncompatibilities( for node: DependencyResolutionNode ) -> [ Incompatibility ] ? {
73
73
self . lock. withLock {
74
74
guard let all = self . incompatibilities [ node] else {
75
75
return nil
@@ -80,15 +80,15 @@ public struct PubGrubDependencyResolver {
80
80
}
81
81
}
82
82
83
- func decide( _ node: DependencyResolutionNode , at version: Version ) {
83
+ package func decide( _ node: DependencyResolutionNode , at version: Version ) {
84
84
let term = Term ( node, . exact( version) )
85
85
self . lock. withLock {
86
86
assert ( term. isValidDecision ( for: self . solution) )
87
87
self . solution. decide ( node, at: version)
88
88
}
89
89
}
90
90
91
- func derive( _ term: Term , cause: Incompatibility ) {
91
+ package func derive( _ term: Term , cause: Incompatibility ) {
92
92
self . lock. withLock {
93
93
self . solution. derive ( term, cause: cause)
94
94
}
@@ -209,7 +209,7 @@ public struct PubGrubDependencyResolver {
209
209
/// Find a set of dependencies that fit the given constraints. If dependency
210
210
/// resolution is unable to provide a result, an error is thrown.
211
211
/// - Warning: It is expected that the root package reference has been set before this is called.
212
- internal func solve( root: DependencyResolutionNode , constraints: [ Constraint ] ) async throws -> ( bindings: [ DependencyResolverBinding ] , state: State ) {
212
+ package func solve( root: DependencyResolutionNode , constraints: [ Constraint ] ) async throws -> ( bindings: [ DependencyResolverBinding ] , state: State ) {
213
213
// first process inputs
214
214
let inputs = try await self . processInputs ( root: root, with: constraints)
215
215
@@ -511,7 +511,7 @@ public struct PubGrubDependencyResolver {
511
511
/// partial solution.
512
512
/// If a conflict is found, the conflicting incompatibility is returned to
513
513
/// resolve the conflict on.
514
- internal func propagate( state: State , node: DependencyResolutionNode ) throws {
514
+ package func propagate( state: State , node: DependencyResolutionNode ) throws {
515
515
var changed : OrderedCollections . OrderedSet < DependencyResolutionNode > = [ node]
516
516
517
517
while !changed. isEmpty {
@@ -575,7 +575,7 @@ public struct PubGrubDependencyResolver {
575
575
// Based on:
576
576
// https://github.com/dart-lang/pub/tree/master/doc/solver.md#conflict-resolution
577
577
// https://github.com/dart-lang/pub/blob/master/lib/src/solver/version_solver.dart#L201
578
- internal func resolve( state: State , conflict: Incompatibility ) throws -> Incompatibility {
578
+ package func resolve( state: State , conflict: Incompatibility ) throws -> Incompatibility {
579
579
self . delegate? . conflict ( conflict: conflict)
580
580
581
581
var incompatibility = conflict
@@ -703,7 +703,7 @@ public struct PubGrubDependencyResolver {
703
703
}
704
704
}
705
705
706
- internal func makeDecision(
706
+ package func makeDecision(
707
707
state: State
708
708
) async throws -> DependencyResolutionNode ? {
709
709
// If there are no more undecided terms, version solving is complete.
@@ -771,7 +771,7 @@ public struct PubGrubDependencyResolver {
771
771
}
772
772
}
773
773
774
- internal enum LogLocation : String {
774
+ package enum LogLocation : String {
775
775
case topLevel = " top level "
776
776
case unitPropagation = " unit propagation "
777
777
case decisionMaking = " decision making "
0 commit comments