@@ -594,7 +594,7 @@ extension Workspace {
594
594
}
595
595
596
596
// If any products are required, the rest of the package graph will supply those constraints.
597
- let constraint = PackageContainerConstraint ( package : dependency. packageRef , requirement: requirement, products: . nothing)
597
+ let constraint = PackageContainerConstraint ( package : dependency. package , requirement: requirement, products: . nothing)
598
598
599
599
// Run the resolution.
600
600
try self . resolve (
@@ -986,9 +986,9 @@ extension Workspace {
986
986
case . checkout( let checkoutState) :
987
987
return checkoutState
988
988
case . edited:
989
- diagnostics. emit ( error: " dependency ' \( dependency. packageRef . name) ' already in edit mode " )
989
+ diagnostics. emit ( error: " dependency ' \( dependency. package . name) ' already in edit mode " )
990
990
case . local:
991
- diagnostics. emit ( error: " local dependency ' \( dependency. packageRef . name) ' can't be edited " )
991
+ diagnostics. emit ( error: " local dependency ' \( dependency. package . name) ' can't be edited " )
992
992
}
993
993
return nil
994
994
}
@@ -1020,10 +1020,10 @@ extension Workspace {
1020
1020
if fileSystem. exists ( destination) {
1021
1021
// FIXME: this should not block
1022
1022
let manifest = try temp_await {
1023
- self . loadManifest ( packageIdentity: dependency. packageRef . identity,
1023
+ self . loadManifest ( packageIdentity: dependency. package . identity,
1024
1024
packageKind: . local,
1025
1025
packagePath: destination,
1026
- packageLocation: dependency. packageRef . repository. url,
1026
+ packageLocation: dependency. package . repository. url,
1027
1027
diagnostics: diagnostics,
1028
1028
completion: $0)
1029
1029
}
@@ -1049,7 +1049,7 @@ extension Workspace {
1049
1049
// Get handle to the repository.
1050
1050
// TODO: replace with async/await when available
1051
1051
let handle = try temp_await {
1052
- repositoryManager. lookup ( repository: dependency. packageRef . repository, skipUpdate: true , on: . sharedConcurrent, completion: $0)
1052
+ repositoryManager. lookup ( repository: dependency. package . repository, skipUpdate: true , on: . sharedConcurrent, completion: $0)
1053
1053
}
1054
1054
let repo = try handle. open ( )
1055
1055
@@ -1115,7 +1115,7 @@ extension Workspace {
1115
1115
switch dependency. state {
1116
1116
// If the dependency isn't in edit mode, we can't unedit it.
1117
1117
case . checkout, . local:
1118
- throw WorkspaceDiagnostics . DependencyNotInEditMode ( dependencyName: dependency. packageRef . name)
1118
+ throw WorkspaceDiagnostics . DependencyNotInEditMode ( dependencyName: dependency. package . name)
1119
1119
1120
1120
case . edited( let path) :
1121
1121
if path != nil {
@@ -1151,10 +1151,10 @@ extension Workspace {
1151
1151
// Restore the original checkout.
1152
1152
//
1153
1153
// The clone method will automatically update the managed dependency state.
1154
- _ = try clone ( package : dependency. packageRef , at: checkoutState)
1154
+ _ = try clone ( package : dependency. package , at: checkoutState)
1155
1155
} else {
1156
1156
// The original dependency was removed, update the managed dependency state.
1157
- state. dependencies. remove ( forURL: dependency. packageRef . location)
1157
+ state. dependencies. remove ( forURL: dependency. package . location)
1158
1158
try state. saveState ( )
1159
1159
}
1160
1160
@@ -1183,7 +1183,7 @@ extension Workspace {
1183
1183
let requiredURLs = dependencyManifests. computePackageURLs ( ) . required
1184
1184
1185
1185
for dependency in state. dependencies {
1186
- if requiredURLs. contains ( where: { $0. location == dependency. packageRef . location } ) {
1186
+ if requiredURLs. contains ( where: { $0. location == dependency. package . location } ) {
1187
1187
pinsStore. pin ( dependency)
1188
1188
}
1189
1189
}
@@ -1213,7 +1213,7 @@ fileprivate extension PinsStore {
1213
1213
}
1214
1214
1215
1215
self . pin (
1216
- packageRef: dependency. packageRef ,
1216
+ packageRef: dependency. package ,
1217
1217
state: checkoutState
1218
1218
)
1219
1219
}
@@ -1325,12 +1325,12 @@ extension Workspace {
1325
1325
switch dependency. state {
1326
1326
case . checkout( let checkout) :
1327
1327
if checkout. isBranchOrRevisionBased {
1328
- result. insert ( dependency. packageRef )
1328
+ result. insert ( dependency. package )
1329
1329
}
1330
1330
case . edited:
1331
1331
continue
1332
1332
case . local:
1333
- result. insert ( dependency. packageRef )
1333
+ result. insert ( dependency. package )
1334
1334
}
1335
1335
}
1336
1336
@@ -1397,7 +1397,7 @@ extension Workspace {
1397
1397
// FIXME: We shouldn't need to construct a new package reference object here.
1398
1398
// We should get the correct one from managed dependency object.
1399
1399
let ref = PackageReference . local (
1400
- identity: managedDependency. packageRef . identity,
1400
+ identity: managedDependency. package . identity,
1401
1401
path: workspace. path ( to: managedDependency)
1402
1402
)
1403
1403
let constraint = PackageContainerConstraint (
@@ -1426,7 +1426,7 @@ extension Workspace {
1426
1426
// FIXME: We shouldn't need to construct a new package reference object here.
1427
1427
// We should get the correct one from managed dependency object.
1428
1428
let ref = PackageReference . local (
1429
- identity: managedDependency. packageRef . identity,
1429
+ identity: managedDependency. package . identity,
1430
1430
path: workspace. path ( to: managedDependency)
1431
1431
)
1432
1432
let constraint = PackageContainerConstraint (
@@ -1475,7 +1475,7 @@ extension Workspace {
1475
1475
case . edited( let path) :
1476
1476
return path ?? self . location. editsDirectory. appending ( dependency. subpath)
1477
1477
case . local:
1478
- return AbsolutePath ( dependency. packageRef . location)
1478
+ return AbsolutePath ( dependency. package . location)
1479
1479
}
1480
1480
}
1481
1481
@@ -1513,9 +1513,9 @@ extension Workspace {
1513
1513
let dependenciesToCheck = Array ( state. dependencies)
1514
1514
// Remove any managed dependency which has become a root.
1515
1515
for dependency in dependenciesToCheck {
1516
- if root. packages. keys. contains ( dependency. packageRef . identity) {
1516
+ if root. packages. keys. contains ( dependency. package . identity) {
1517
1517
diagnostics. wrap {
1518
- try self . remove ( package : dependency. packageRef )
1518
+ try self . remove ( package : dependency. package )
1519
1519
}
1520
1520
}
1521
1521
}
@@ -1554,7 +1554,7 @@ extension Workspace {
1554
1554
// prepopulate managed dependencies if we are asked to do so
1555
1555
if automaticallyAddManagedDependencies {
1556
1556
dependenciesRequired. filter { $0. isLocal } . forEach { dependency in
1557
- state. dependencies. add ( ManagedDependency . local ( packageRef : dependency. createPackageRef ( ) ) )
1557
+ state. dependencies. add ( ManagedDependency . local ( package : dependency. createPackageRef ( ) ) )
1558
1558
}
1559
1559
diagnostics. wrap { try state. saveState ( ) }
1560
1560
}
@@ -1628,10 +1628,10 @@ extension Workspace {
1628
1628
let packagePath = path ( to: managedDependency)
1629
1629
1630
1630
// Load and return the manifest.
1631
- self . loadManifest ( packageIdentity: managedDependency. packageRef . identity,
1631
+ self . loadManifest ( packageIdentity: managedDependency. package . identity,
1632
1632
packageKind: packageKind,
1633
1633
packagePath: packagePath,
1634
- packageLocation: managedDependency. packageRef . location,
1634
+ packageLocation: managedDependency. package . location,
1635
1635
version: version,
1636
1636
diagnostics: diagnostics) { result in
1637
1637
// error is added to diagnostics in the function above
@@ -1815,7 +1815,7 @@ extension Workspace {
1815
1815
private func parseArtifacts( from manifests: DependencyManifests ) throws -> ( local: [ ManagedArtifact ] , remote: [ RemoteArtifact ] ) {
1816
1816
let packageAndManifests : [ ( reference: PackageReference , manifest: Manifest ) ] =
1817
1817
manifests. root. packages. values + // Root package and manifests.
1818
- manifests. dependencies. map ( { manifest, managed, _ in ( managed. packageRef , manifest) } ) // Dependency package and manifests.
1818
+ manifests. dependencies. map ( { manifest, managed, _ in ( managed. package , manifest) } ) // Dependency package and manifests.
1819
1819
1820
1820
var localArtifacts : [ ManagedArtifact ] = [ ]
1821
1821
var remoteArtifacts : [ RemoteArtifact ] = [ ]
@@ -2338,11 +2338,11 @@ extension Workspace {
2338
2338
case . edited, . local: continue
2339
2339
}
2340
2340
2341
- let identity = dependency. packageRef . identity
2341
+ let identity = dependency. package . identity
2342
2342
2343
- if requiredURLs. contains ( where: { $0. location == dependency. packageRef . location } ) {
2343
+ if requiredURLs. contains ( where: { $0. location == dependency. package . location } ) {
2344
2344
// If required identity contains this dependency, it should be in the pins store.
2345
- if let pin = pinsStore. pinsMap [ identity] , pin. packageRef. location == dependency. packageRef . location {
2345
+ if let pin = pinsStore. pinsMap [ identity] , pin. packageRef. location == dependency. package . location {
2346
2346
continue
2347
2347
}
2348
2348
} else if !pins. contains ( identity) {
@@ -2463,7 +2463,7 @@ extension Workspace {
2463
2463
return self . path ( to: $0) . pathString == packageRef. location
2464
2464
} ) {
2465
2465
currentDependency = editedDependency
2466
- let originalReference = editedDependency. basedOn!. packageRef // forced unwrap safe
2466
+ let originalReference = editedDependency. basedOn!. package // forced unwrap safe
2467
2467
packageStateChanges [ originalReference. location] = ( originalReference, . unchanged)
2468
2468
} else {
2469
2469
currentDependency = nil
@@ -2549,7 +2549,7 @@ extension Workspace {
2549
2549
}
2550
2550
}
2551
2551
// Set the state of any old package that might have been removed.
2552
- for packageRef in state. dependencies. lazy. map ( { $0. packageRef } ) where packageStateChanges [ packageRef. location] == nil {
2552
+ for packageRef in state. dependencies. lazy. map ( { $0. package } ) where packageStateChanges [ packageRef. location] == nil {
2553
2553
packageStateChanges [ packageRef. location] = ( packageRef, . removed)
2554
2554
}
2555
2555
@@ -2620,8 +2620,8 @@ extension Workspace {
2620
2620
switch dependency. state {
2621
2621
case . checkout( let checkoutState) :
2622
2622
// If some checkout dependency has been removed, clone it again.
2623
- _ = try clone ( package : dependency. packageRef , at: checkoutState)
2624
- diagnostics. emit ( . checkedOutDependencyMissing( packageName: dependency. packageRef . name) )
2623
+ _ = try clone ( package : dependency. package , at: checkoutState)
2624
+ diagnostics. emit ( . checkedOutDependencyMissing( packageName: dependency. package . name) )
2625
2625
2626
2626
case . edited:
2627
2627
// If some edited dependency has been removed, mark it as unedited.
@@ -2631,10 +2631,10 @@ extension Workspace {
2631
2631
// of some other resolve operation (i.e. resolve, update, etc).
2632
2632
try unedit ( dependency: dependency, forceRemove: true , diagnostics: diagnostics)
2633
2633
2634
- diagnostics. emit ( . editedDependencyMissing( packageName: dependency. packageRef . name) )
2634
+ diagnostics. emit ( . editedDependencyMissing( packageName: dependency. package . name) )
2635
2635
2636
2636
case . local:
2637
- state. dependencies. remove ( forURL: dependency. packageRef . location)
2637
+ state. dependencies. remove ( forURL: dependency. package . location)
2638
2638
try state. saveState ( )
2639
2639
}
2640
2640
}
@@ -2827,7 +2827,7 @@ extension Workspace {
2827
2827
checkoutState = . branch( name: branch, revision: revision)
2828
2828
2829
2829
case . unversioned:
2830
- state. dependencies. add ( ManagedDependency . local ( packageRef : package ) )
2830
+ state. dependencies. add ( ManagedDependency . local ( package : package ) )
2831
2831
try state. saveState ( )
2832
2832
return AbsolutePath ( package . location)
2833
2833
}
@@ -2856,7 +2856,7 @@ extension Workspace {
2856
2856
}
2857
2857
2858
2858
// Inform the delegate.
2859
- delegate? . removing ( repository: dependency. packageRef . repository. url)
2859
+ delegate? . removing ( repository: dependency. package . repository. url)
2860
2860
2861
2861
// Compute the dependency which we need to remove.
2862
2862
let dependencyToRemove : ManagedDependency
@@ -2868,7 +2868,7 @@ extension Workspace {
2868
2868
state. dependencies. add ( dependency)
2869
2869
} else {
2870
2870
dependencyToRemove = dependency
2871
- state. dependencies. remove ( forURL: dependencyToRemove. packageRef . location)
2871
+ state. dependencies. remove ( forURL: dependencyToRemove. package . location)
2872
2872
}
2873
2873
2874
2874
// Remove the checkout.
@@ -2882,7 +2882,7 @@ extension Workspace {
2882
2882
try fileSystem. removeFileTree ( dependencyPath)
2883
2883
2884
2884
// Remove the clone.
2885
- try repositoryManager. remove ( repository: dependencyToRemove. packageRef . repository)
2885
+ try repositoryManager. remove ( repository: dependencyToRemove. package . repository)
2886
2886
2887
2887
// Save the state.
2888
2888
try state. saveState ( )
0 commit comments