@@ -22,8 +22,13 @@ import struct TSCBasic.ProcessResult
22
22
/// A SwiftPM package that gets written to disk and for which a Git repository is initialized with a commit tagged
23
23
/// `1.0.0`. This repository can then be used as a dependency for another package, usually a `SwiftPMTestProject`.
24
24
public class SwiftPMDependencyProject {
25
+ /// The scratch directory created for the dependency project.
26
+ public let scratchDirectory : URL
27
+
25
28
/// The directory in which the repository lives.
26
- public let packageDirectory : URL
29
+ public var packageDirectory : URL {
30
+ return scratchDirectory. appendingPathComponent ( " MyDependency " )
31
+ }
27
32
28
33
private func runGitCommand( _ arguments: [ String ] , workingDirectory: URL ) async throws {
29
34
enum Error : Swift . Error {
@@ -66,7 +71,7 @@ public class SwiftPMDependencyProject {
66
71
manifest: String = defaultPackageManifest,
67
72
testName: String = #function
68
73
) async throws {
69
- packageDirectory = try testScratchDir ( testName: testName) . appendingPathComponent ( " MyDependency " )
74
+ scratchDirectory = try testScratchDir ( testName: testName)
70
75
71
76
var files = files
72
77
files [ " Package.swift " ] = manifest
@@ -94,7 +99,7 @@ public class SwiftPMDependencyProject {
94
99
95
100
deinit {
96
101
if cleanScratchDirectories {
97
- try ? FileManager . default. removeItem ( at: packageDirectory )
102
+ try ? FileManager . default. removeItem ( at: scratchDirectory )
98
103
}
99
104
}
100
105
0 commit comments