@@ -130,7 +130,7 @@ extension LLBuildManifestBuilder {
130
130
131
131
// Add the output paths of any prebuilds that were run, so that we redo the plan if they change.
132
132
var derivedSourceDirPaths : [ AbsolutePath ] = [ ]
133
- for result in plan. prebuildCommandResults. values. flatMap ( { $0 } ) {
133
+ for result in self . plan. prebuildCommandResults. values. flatMap ( { $0 } ) {
134
134
derivedSourceDirPaths. append ( contentsOf: result. outputDirectories)
135
135
}
136
136
inputs. append ( contentsOf: derivedSourceDirPaths. sorted ( ) . map { Node . directoryStructure ( $0) } )
@@ -213,7 +213,7 @@ extension LLBuildManifestBuilder {
213
213
private func addTestDiscoveryGenerationCommand( ) throws {
214
214
for testDiscoveryTarget in self . plan. targets. compactMap ( \. testDiscoveryTargetBuildDescription) {
215
215
let testTargets = testDiscoveryTarget. target. dependencies
216
- . compactMap ( \. target) . compactMap { plan. targetMap [ $0] }
216
+ . compactMap ( \. target) . compactMap { self . plan. targetMap [ $0] }
217
217
let objectFiles = try testTargets. flatMap { try $0. objects } . sorted ( ) . map ( Node . file)
218
218
let outputs = testDiscoveryTarget. target. sources. paths
219
219
@@ -241,7 +241,7 @@ extension LLBuildManifestBuilder {
241
241
// depends on.
242
242
let discoveredTargetDependencyBuildDescriptions = testEntryPointTarget. target. dependencies
243
243
. compactMap ( \. target)
244
- . compactMap { plan. targetMap [ $0] }
244
+ . compactMap { self . plan. targetMap [ $0] }
245
245
. compactMap ( \. testDiscoveryTargetBuildDescription)
246
246
247
247
// The module outputs of the discovery targets this synthesized entry point target depends on are
@@ -273,70 +273,6 @@ extension TargetBuildDescription {
273
273
}
274
274
}
275
275
276
- // MARK: - Product Command
277
-
278
- extension LLBuildManifestBuilder {
279
- private func createProductCommand( _ buildProduct: ProductBuildDescription ) throws {
280
- let cmdName = try buildProduct. product. getCommandName ( config: self . buildConfig)
281
-
282
- // Add dependency on Info.plist generation on Darwin platforms.
283
- let testInputs : [ AbsolutePath ]
284
- if buildProduct. product. type == . test, buildProduct. buildParameters. targetTriple. isDarwin ( ) , buildProduct. buildParameters. experimentalTestOutput {
285
- let testBundleInfoPlistPath = try buildProduct. binaryPath. parentDirectory. parentDirectory. appending ( component: " Info.plist " )
286
- testInputs = [ testBundleInfoPlistPath]
287
-
288
- self . manifest. addWriteInfoPlistCommand ( principalClass: " \( buildProduct. product. targets [ 0 ] . c99name) .SwiftPMXCTestObserver " , outputPath: testBundleInfoPlistPath)
289
- } else {
290
- testInputs = [ ]
291
- }
292
-
293
- switch buildProduct. product. type {
294
- case . library( . static) :
295
- try self . manifest. addShellCmd (
296
- name: cmdName,
297
- description: " Archiving \( buildProduct. binaryPath. prettyPath ( ) ) " ,
298
- inputs: ( buildProduct. objects + [ buildProduct. linkFileListPath] ) . map ( Node . file) ,
299
- outputs: [ . file( buildProduct. binaryPath) ] ,
300
- arguments: try buildProduct. archiveArguments ( )
301
- )
302
-
303
- default :
304
- let inputs = try buildProduct. objects
305
- + buildProduct. dylibs. map { try $0. binaryPath }
306
- + [ buildProduct. linkFileListPath]
307
- + testInputs
308
-
309
- try self . manifest. addShellCmd (
310
- name: cmdName,
311
- description: " Linking \( buildProduct. binaryPath. prettyPath ( ) ) " ,
312
- inputs: inputs. map ( Node . file) ,
313
- outputs: [ . file( buildProduct. binaryPath) ] ,
314
- arguments: try buildProduct. linkArguments ( )
315
- )
316
- }
317
-
318
- // Create a phony node to represent the entire target.
319
- let targetName = try buildProduct. product. getLLBuildTargetName ( config: self . buildConfig)
320
- let output : Node = . virtual( targetName)
321
-
322
- self . manifest. addNode ( output, toTarget: targetName)
323
- try self . manifest. addPhonyCmd (
324
- name: output. name,
325
- inputs: [ . file( buildProduct. binaryPath) ] ,
326
- outputs: [ output]
327
- )
328
-
329
- if self . plan. graph. reachableProducts. contains ( buildProduct. product) {
330
- if buildProduct. product. type != . test {
331
- self . addNode ( output, toTarget: . main)
332
- }
333
- self . addNode ( output, toTarget: . test)
334
- }
335
-
336
- self . manifest. addWriteLinkFileListCommand ( objects: Array ( buildProduct. objects) , linkFileListPath: buildProduct. linkFileListPath)
337
- }
338
- }
339
-
340
276
extension ResolvedTarget {
341
277
public func getCommandName( config: String ) -> String {
342
278
" C. " + self . getLLBuildTargetName ( config: config)
@@ -404,25 +340,6 @@ extension LLBuildManifestBuilder {
404
340
}
405
341
}
406
342
407
- extension TypedVirtualPath {
408
- /// Resolve a typed virtual path provided by the Swift driver to
409
- /// a node in the build graph.
410
- func resolveToNode( fileSystem: FileSystem ) throws -> Node {
411
- if let absolutePath = ( file. absolutePath. flatMap { AbsolutePath ( $0) } ) {
412
- return Node . file ( absolutePath)
413
- } else if let relativePath = ( file. relativePath. flatMap { RelativePath ( $0) } ) {
414
- guard let workingDirectory: AbsolutePath = fileSystem. currentWorkingDirectory else {
415
- throw InternalError ( " unknown working directory " )
416
- }
417
- return Node . file ( workingDirectory. appending ( relativePath) )
418
- } else if let temporaryFileName = file. temporaryFileName {
419
- return Node . virtual ( temporaryFileName. pathString)
420
- } else {
421
- throw InternalError ( " Cannot resolve VirtualPath: \( file) " )
422
- }
423
- }
424
- }
425
-
426
343
extension Sequence where Element: Hashable {
427
344
/// Unique the elements in a sequence.
428
345
func uniqued( ) -> [ Element ] {
0 commit comments