@@ -70,8 +70,8 @@ extension Workspace {
70
70
delegate: WorkspaceDelegate = TestWorkspaceDelegate ( ) ,
71
71
fileSystem: FileSystem = localFileSystem,
72
72
repositoryProvider: RepositoryProvider = GitRepositoryProvider ( )
73
- ) throws -> Workspace {
74
- let workspace = try Workspace (
73
+ ) -> Workspace {
74
+ let workspace = Workspace (
75
75
dataPath: path. appending ( component: " .build " ) ,
76
76
editablesPath: path. appending ( component: " Packages " ) ,
77
77
pinsFile: path. appending ( component: " Package.pins " ) ,
@@ -124,7 +124,7 @@ final class WorkspaceTests: XCTestCase {
124
124
125
125
// Create the initial workspace.
126
126
do {
127
- let workspace = try Workspace . createWith ( rootPackage: path)
127
+ let workspace = Workspace . createWith ( rootPackage: path)
128
128
XCTAssertEqual ( try workspace. managedDependencies. dematerialize ( ) . values. map { $0. repository. url } , [ ] )
129
129
130
130
// Do a low-level clone.
@@ -135,7 +135,7 @@ final class WorkspaceTests: XCTestCase {
135
135
136
136
// Re-open the workspace, and check we know the checkout version.
137
137
do {
138
- let workspace = try Workspace . createWith ( rootPackage: path)
138
+ let workspace = Workspace . createWith ( rootPackage: path)
139
139
XCTAssertEqual ( try workspace. managedDependencies. dematerialize ( ) . values. map { $0. repository } , [ testRepoSpec] )
140
140
if let dependency = try workspace. managedDependencies. dematerialize ( ) . values. first ( where: { _ in true } ) {
141
141
XCTAssertEqual ( dependency. repository, testRepoSpec)
@@ -151,7 +151,7 @@ final class WorkspaceTests: XCTestCase {
151
151
// Re-check the persisted state.
152
152
let statePath : AbsolutePath
153
153
do {
154
- let workspace = try Workspace . createWith ( rootPackage: path)
154
+ let workspace = Workspace . createWith ( rootPackage: path)
155
155
statePath = try workspace. managedDependencies. dematerialize ( ) . statePath
156
156
XCTAssertEqual ( try workspace. managedDependencies. dematerialize ( ) . values. map { $0. repository } , [ testRepoSpec] )
157
157
if let dependency = try workspace. managedDependencies. dematerialize ( ) . values. first ( where: { _ in true } ) {
@@ -163,7 +163,7 @@ final class WorkspaceTests: XCTestCase {
163
163
// Blow away the workspace state file, and check we can get back to a good state.
164
164
try removeFileTree ( statePath)
165
165
do {
166
- let workspace = try Workspace . createWith ( rootPackage: path)
166
+ let workspace = Workspace . createWith ( rootPackage: path)
167
167
XCTAssertEqual ( try workspace. managedDependencies. dematerialize ( ) . values. map { $0. repository. url } , [ ] )
168
168
let state = CheckoutState ( revision: currentRevision)
169
169
_ = try workspace. clone ( repository: testRepoSpec, at: state)
@@ -193,7 +193,7 @@ final class WorkspaceTests: XCTestCase {
193
193
]
194
194
)
195
195
// Create the workspace.
196
- let workspace = try Workspace . createWith ( rootPackage: path, manifestLoader: graph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
196
+ let workspace = Workspace . createWith ( rootPackage: path, manifestLoader: graph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
197
197
198
198
// Ensure we have checkouts for A & AA.
199
199
for name in [ " A " , " AA " ] {
@@ -232,7 +232,7 @@ final class WorkspaceTests: XCTestCase {
232
232
)
233
233
234
234
// Create the workspace.
235
- let workspace = try Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
235
+ let workspace = Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
236
236
237
237
// Ensure we have a checkout for A.
238
238
for name in [ " A " ] {
@@ -263,7 +263,7 @@ final class WorkspaceTests: XCTestCase {
263
263
] ,
264
264
fs: fs
265
265
)
266
- let workspace = try Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) , fileSystem: fs, repositoryProvider: manifestGraph. repoProvider!)
266
+ let workspace = Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) , fileSystem: fs, repositoryProvider: manifestGraph. repoProvider!)
267
267
let graph = workspace. loadPackageGraph ( )
268
268
XCTAssertTrue ( graph. errors. isEmpty)
269
269
XCTAssertEqual ( graph. packages. count, 2 )
@@ -296,7 +296,7 @@ final class WorkspaceTests: XCTestCase {
296
296
)
297
297
// Create the workspace.
298
298
let delegate = TestWorkspaceDelegate ( )
299
- let workspace = try Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: delegate)
299
+ let workspace = Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: delegate)
300
300
301
301
// Ensure delegates haven't been called yet.
302
302
XCTAssert ( delegate. fetched. isEmpty)
@@ -355,7 +355,7 @@ final class WorkspaceTests: XCTestCase {
355
355
let repoPath = AbsolutePath ( manifestGraph. repo ( " A " ) . url)
356
356
357
357
func createWorkspace( ) throws -> Workspace {
358
- return try Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: delegate)
358
+ return Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: delegate)
359
359
}
360
360
361
361
do {
@@ -427,7 +427,7 @@ final class WorkspaceTests: XCTestCase {
427
427
try makeDirectories ( testRepoPath)
428
428
initGitRepo ( testRepoPath, tag: " initial " )
429
429
430
- let workspace = try Workspace . createWith ( rootPackage: path)
430
+ let workspace = Workspace . createWith ( rootPackage: path)
431
431
let state = CheckoutState ( revision: Revision ( identifier: " initial " ) )
432
432
let checkoutPath = try workspace. clone ( repository: testRepoSpec, at: state)
433
433
XCTAssertEqual ( try workspace. managedDependencies. dematerialize ( ) . values. map { $0. repository } , [ testRepoSpec] )
@@ -474,7 +474,7 @@ final class WorkspaceTests: XCTestCase {
474
474
]
475
475
)
476
476
// Create the workspace.
477
- let workspace = try Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
477
+ let workspace = Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
478
478
// Load the package graph.
479
479
let graph = workspace. loadPackageGraph ( )
480
480
XCTAssertTrue ( graph. errors. isEmpty)
@@ -524,7 +524,7 @@ final class WorkspaceTests: XCTestCase {
524
524
525
525
do {
526
526
// Reopen workspace and check if we maintained the state.
527
- let workspace = try Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
527
+ let workspace = Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
528
528
let dependency = try workspace. managedDependencies. dematerialize ( ) [ RepositorySpecifier ( url: aManifest. url) ] !
529
529
XCTAssert ( dependency. state == . edited)
530
530
}
@@ -549,7 +549,7 @@ final class WorkspaceTests: XCTestCase {
549
549
]
550
550
)
551
551
// Create the workspace.
552
- let workspace = try Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
552
+ let workspace = Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
553
553
// Load the package graph.
554
554
let graph = workspace. loadPackageGraph ( )
555
555
XCTAssertTrue ( graph. errors. isEmpty)
@@ -601,7 +601,7 @@ final class WorkspaceTests: XCTestCase {
601
601
]
602
602
)
603
603
// Create the workspace.
604
- let workspace = try Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
604
+ let workspace = Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
605
605
// Load the package graph.
606
606
let graph = workspace. loadPackageGraph ( )
607
607
XCTAssertTrue ( graph. errors. isEmpty)
@@ -669,7 +669,7 @@ final class WorkspaceTests: XCTestCase {
669
669
let provider = manifestGraph. repoProvider!
670
670
671
671
func newWorkspace( ) -> Workspace {
672
- return try ! Workspace . createWith (
672
+ return Workspace . createWith (
673
673
rootPackage: path,
674
674
manifestLoader: manifestGraph. manifestLoader,
675
675
delegate: TestWorkspaceDelegate ( ) ,
@@ -774,7 +774,7 @@ final class WorkspaceTests: XCTestCase {
774
774
try aRepo. tag ( name: " 1.0.1 " )
775
775
776
776
func newWorkspace( ) -> Workspace {
777
- return try ! Workspace . createWith (
777
+ return Workspace . createWith (
778
778
rootPackage: path,
779
779
manifestLoader: manifestGraph. manifestLoader,
780
780
delegate: TestWorkspaceDelegate ( ) ,
@@ -877,7 +877,7 @@ final class WorkspaceTests: XCTestCase {
877
877
let provider = manifestGraph. repoProvider!
878
878
879
879
func newWorkspace( ) -> Workspace {
880
- return try ! Workspace . createWith (
880
+ return Workspace . createWith (
881
881
rootPackage: path,
882
882
manifestLoader: manifestGraph. manifestLoader,
883
883
delegate: TestWorkspaceDelegate ( ) ,
@@ -962,7 +962,7 @@ final class WorkspaceTests: XCTestCase {
962
962
let provider = manifestGraph. repoProvider!
963
963
964
964
func newWorkspace( ) -> Workspace {
965
- return try ! Workspace . createWith (
965
+ return Workspace . createWith (
966
966
rootPackage: path,
967
967
manifestLoader: manifestGraph. manifestLoader,
968
968
delegate: TestWorkspaceDelegate ( ) ,
@@ -1018,7 +1018,7 @@ final class WorkspaceTests: XCTestCase {
1018
1018
try provider. specifierMap [ manifestGraph. repo ( " B " ) ] !. tag ( name: " 2.0.0 " )
1019
1019
1020
1020
func newWorkspace( ) -> Workspace {
1021
- return try ! Workspace . createWith (
1021
+ return Workspace . createWith (
1022
1022
rootPackage: path,
1023
1023
manifestLoader: manifestGraph. manifestLoader,
1024
1024
delegate: TestWorkspaceDelegate ( ) ,
@@ -1088,7 +1088,7 @@ final class WorkspaceTests: XCTestCase {
1088
1088
let provider = manifestGraph. repoProvider!
1089
1089
try provider. specifierMap [ manifestGraph. repo ( " B " ) ] !. tag ( name: " 2.0.0 " )
1090
1090
func newWorkspace( ) -> Workspace {
1091
- return try ! Workspace . createWith (
1091
+ return Workspace . createWith (
1092
1092
rootPackage: path,
1093
1093
manifestLoader: manifestGraph. manifestLoader,
1094
1094
delegate: TestWorkspaceDelegate ( ) ,
@@ -1124,7 +1124,7 @@ final class WorkspaceTests: XCTestCase {
1124
1124
let provider = manifestGraph. repoProvider!
1125
1125
1126
1126
func newWorkspace( ) -> Workspace {
1127
- return try ! Workspace . createWith (
1127
+ return Workspace . createWith (
1128
1128
rootPackage: path,
1129
1129
manifestLoader: manifestGraph. manifestLoader,
1130
1130
delegate: delegate,
@@ -1234,7 +1234,7 @@ final class WorkspaceTests: XCTestCase {
1234
1234
1235
1235
1236
1236
func getWorkspace( ) -> Workspace {
1237
- return try ! Workspace . createWith (
1237
+ return Workspace . createWith (
1238
1238
rootPackage: root,
1239
1239
manifestLoader: MockManifestLoader ( manifests: manifests) )
1240
1240
}
@@ -1372,7 +1372,7 @@ final class WorkspaceTests: XCTestCase {
1372
1372
1373
1373
func createWorkspace( ) throws -> Workspace {
1374
1374
let buildPath = path. appending ( components: " build " )
1375
- return try Workspace (
1375
+ return Workspace (
1376
1376
dataPath: buildPath,
1377
1377
editablesPath: buildPath. appending ( component: " Packages " ) ,
1378
1378
pinsFile: path. appending ( component: " Package.pins " ) ,
@@ -1478,7 +1478,7 @@ final class WorkspaceTests: XCTestCase {
1478
1478
)
1479
1479
1480
1480
let delegate = TestWorkspaceDelegate ( )
1481
- let workspace = try Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: delegate)
1481
+ let workspace = Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: delegate)
1482
1482
workspace. loadPackageGraph ( )
1483
1483
1484
1484
// Put A in edit mode.
@@ -1514,12 +1514,12 @@ final class WorkspaceTests: XCTestCase {
1514
1514
)
1515
1515
1516
1516
let delegate = TestWorkspaceDelegate ( )
1517
- func createWorkspace( ) throws -> Workspace {
1518
- return try Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: delegate)
1517
+ func createWorkspace( ) -> Workspace {
1518
+ return Workspace . createWith ( rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: delegate)
1519
1519
}
1520
1520
1521
1521
do {
1522
- let workspace = try createWorkspace ( )
1522
+ let workspace = createWorkspace ( )
1523
1523
workspace. loadPackageGraph ( )
1524
1524
let manifests = try workspace. loadDependencyManifests ( )
1525
1525
@@ -1541,7 +1541,7 @@ final class WorkspaceTests: XCTestCase {
1541
1541
1542
1542
// Update and check states.
1543
1543
do {
1544
- let workspace = try createWorkspace ( )
1544
+ let workspace = createWorkspace ( )
1545
1545
try workspace. updateDependencies ( repin: true )
1546
1546
let manifests = try workspace. loadDependencyManifests ( )
1547
1547
@@ -1581,7 +1581,7 @@ final class WorkspaceTests: XCTestCase {
1581
1581
let manifestLoader = MockManifestLoader ( manifests: manifests)
1582
1582
1583
1583
func createWorkspace( _ toolsVersion: ToolsVersion ) throws -> Workspace {
1584
- let workspace = try Workspace (
1584
+ let workspace = Workspace (
1585
1585
dataPath: AbsolutePath . root. appending ( component: " .build " ) ,
1586
1586
editablesPath: AbsolutePath . root. appending ( component: " Packages " ) ,
1587
1587
pinsFile: AbsolutePath . root. appending ( component: " Package.pins " ) ,
@@ -1648,7 +1648,7 @@ final class WorkspaceTests: XCTestCase {
1648
1648
stream <<< " let package = Package(name: \" root0 \" ) "
1649
1649
}
1650
1650
1651
- let workspace = try Workspace . createWith ( rootPackage: roots [ 0 ] )
1651
+ let workspace = Workspace . createWith ( rootPackage: roots [ 0 ] )
1652
1652
workspace. registerPackage ( at: roots [ 1 ] )
1653
1653
workspace. registerPackage ( at: roots [ 2 ] )
1654
1654
@@ -1670,7 +1670,7 @@ final class WorkspaceTests: XCTestCase {
1670
1670
]
1671
1671
)
1672
1672
// Create the workspace.
1673
- let workspace = try Workspace . createWith (
1673
+ let workspace = Workspace . createWith (
1674
1674
rootPackage: path, manifestLoader: manifestGraph. manifestLoader, delegate: TestWorkspaceDelegate ( ) )
1675
1675
1676
1676
func getDependency( _ manifest: Manifest ) -> ManagedDependency {
0 commit comments