@@ -24,21 +24,21 @@ struct CMakeSmokeTest: CommandPlugin {
24
24
}
25
25
26
26
guard let cmakePath = args. extractOption ( named: " cmake-path " ) . last else { throw Errors . missingRequiredOption ( " --cmake-path " ) }
27
- print ( " using cmake at \( cmakePath) " )
27
+ Diagnostics . progress ( " using cmake at \( cmakePath) " )
28
28
let cmakeURL = URL ( filePath: cmakePath)
29
29
guard let ninjaPath = args. extractOption ( named: " ninja-path " ) . last else { throw Errors . missingRequiredOption ( " --ninja-path " ) }
30
- print ( " using ninja at \( ninjaPath) " )
30
+ Diagnostics . progress ( " using ninja at \( ninjaPath) " )
31
31
let ninjaURL = URL ( filePath: ninjaPath)
32
32
let sysrootPath = args. extractOption ( named: " sysroot-path " ) . last
33
33
if let sysrootPath {
34
- print ( " using sysroot at \( sysrootPath) " )
34
+ Diagnostics . progress ( " using sysroot at \( sysrootPath) " )
35
35
}
36
36
37
37
let moduleCachePath = context. pluginWorkDirectoryURL. appending ( component: " module-cache " ) . path ( )
38
38
39
39
let swiftBuildURL = context. package . directoryURL
40
40
let swiftBuildBuildURL = context. pluginWorkDirectoryURL. appending ( component: " swift-build " )
41
- print ( " swift-build: \( swiftBuildURL. path ( ) ) " )
41
+ Diagnostics . progress ( " swift-build: \( swiftBuildURL. path ( ) ) " )
42
42
43
43
let swiftToolsSupportCoreURL = try findDependency ( " swift-tools-support-core " , pluginContext: context)
44
44
let swiftToolsSupportCoreBuildURL = context. pluginWorkDirectoryURL. appending ( component: " swift-tools-support-core " )
@@ -82,37 +82,37 @@ struct CMakeSmokeTest: CommandPlugin {
82
82
" -DCMAKE_Swift_FLAGS=' \( sharedSwiftFlags. joined ( separator: " " ) ) ' "
83
83
] + cMakeProjectArgs
84
84
85
- print ( " Building swift-tools-support-core " )
85
+ Diagnostics . progress ( " Building swift-tools-support-core " )
86
86
try await Process . checkNonZeroExit ( url: cmakeURL, arguments: sharedCMakeArgs + [ swiftToolsSupportCoreURL. path ( ) ] , workingDirectory: swiftToolsSupportCoreBuildURL)
87
87
try await Process . checkNonZeroExit ( url: ninjaURL, arguments: [ ] , workingDirectory: swiftToolsSupportCoreBuildURL)
88
- print ( " Built swift-tools-support-core " )
88
+ Diagnostics . progress ( " Built swift-tools-support-core " )
89
89
90
90
if hostOS != . macOS {
91
- print ( " Building swift-system " )
91
+ Diagnostics . progress ( " Building swift-system " )
92
92
try await Process . checkNonZeroExit ( url: cmakeURL, arguments: sharedCMakeArgs + [ swiftSystemURL. path ( ) ] , workingDirectory: swiftSystemBuildURL)
93
93
try await Process . checkNonZeroExit ( url: ninjaURL, arguments: [ ] , workingDirectory: swiftSystemBuildURL)
94
- print ( " Built swift-system " )
94
+ Diagnostics . progress ( " Built swift-system " )
95
95
}
96
96
97
- print ( " Building llbuild " )
97
+ Diagnostics . progress ( " Building llbuild " )
98
98
try await Process . checkNonZeroExit ( url: cmakeURL, arguments: sharedCMakeArgs + [ " -DLLBUILD_SUPPORT_BINDINGS:=Swift " , llbuildURL. path ( ) ] , workingDirectory: llbuildBuildURL)
99
99
try await Process . checkNonZeroExit ( url: ninjaURL, arguments: [ ] , workingDirectory: llbuildBuildURL)
100
- print ( " Built llbuild " )
100
+ Diagnostics . progress ( " Built llbuild " )
101
101
102
- print ( " Building swift-argument-parser " )
102
+ Diagnostics . progress ( " Building swift-argument-parser " )
103
103
try await Process . checkNonZeroExit ( url: cmakeURL, arguments: sharedCMakeArgs + [ " -DBUILD_TESTING=NO " , " -DBUILD_EXAMPLES=NO " , swiftArgumentParserURL. path ( ) ] , workingDirectory: swiftArgumentParserBuildURL)
104
104
try await Process . checkNonZeroExit ( url: ninjaURL, arguments: [ ] , workingDirectory: swiftArgumentParserBuildURL)
105
- print ( " Built swift-argument-parser " )
105
+ Diagnostics . progress ( " Built swift-argument-parser " )
106
106
107
- print ( " Building swift-driver " )
107
+ Diagnostics . progress ( " Building swift-driver " )
108
108
try await Process . checkNonZeroExit ( url: cmakeURL, arguments: sharedCMakeArgs + [ swiftDriverURL. path ( ) ] , workingDirectory: swiftDriverBuildURL)
109
109
try await Process . checkNonZeroExit ( url: ninjaURL, arguments: [ ] , workingDirectory: swiftDriverBuildURL)
110
- print ( " Built swift-driver " )
110
+ Diagnostics . progress ( " Built swift-driver " )
111
111
112
- print ( " Building swift-build in \( swiftBuildBuildURL) " )
112
+ Diagnostics . progress ( " Building swift-build in \( swiftBuildBuildURL) " )
113
113
try await Process . checkNonZeroExit ( url: cmakeURL, arguments: sharedCMakeArgs + [ swiftBuildURL. path ( ) ] , workingDirectory: swiftBuildBuildURL)
114
114
try await Process . checkNonZeroExit ( url: ninjaURL, arguments: [ ] , workingDirectory: swiftBuildBuildURL)
115
- print ( " Built swift-build " )
115
+ Diagnostics . progress ( " Built swift-build " )
116
116
}
117
117
118
118
func findDependency( _ name: String , pluginContext: PluginContext ) throws -> URL {
@@ -132,7 +132,7 @@ struct CMakeSmokeTest: CommandPlugin {
132
132
throw Errors . missingRepository ( name)
133
133
}
134
134
let dependencyURL = dependency. directoryURL
135
- print ( " \( name) : \( dependencyURL. path ( ) ) " )
135
+ Diagnostics . progress ( " \( name) : \( dependencyURL. path ( ) ) " )
136
136
guard FileManager . default. fileExists ( atPath: dependencyURL. path ( ) ) else {
137
137
throw Errors . missingRepository ( dependencyURL. path ( ) )
138
138
}
@@ -182,12 +182,14 @@ extension Process {
182
182
}
183
183
184
184
static func checkNonZeroExit( url: URL , arguments: [ String ] , workingDirectory: URL , environment: [ String : String ] ? = nil ) async throws {
185
- print ( " \( url. path ( ) ) \( arguments. joined ( separator: " " ) ) " )
185
+ Diagnostics . progress ( " \( url. path ( ) ) \( arguments. joined ( separator: " " ) ) " )
186
186
let process = Process ( )
187
187
process. executableURL = url
188
188
process. arguments = arguments
189
189
process. currentDirectoryURL = workingDirectory
190
190
process. environment = environment
191
+ process. standardOutput = nil
192
+ process. standardError = nil
191
193
try await process. run ( )
192
194
if process. terminationStatus != 0 {
193
195
throw Errors . processError ( terminationReason: process. terminationReason, terminationStatus: process. terminationStatus)
0 commit comments