@@ -30,7 +30,7 @@ import struct PackageGraph.ModulesGraph
30
30
import struct PackageGraph. ResolvedModule
31
31
import struct PackageGraph. ResolvedPackage
32
32
33
- import enum SWBProjectModel . PIF
33
+ import enum SwiftBuild . PIF
34
34
35
35
/// A builder for generating the PIF object from a package.
36
36
public final class PIFPackageBuilder {
@@ -41,12 +41,12 @@ public final class PIFPackageBuilder {
41
41
let packageManifest : PackageModel . Manifest // FIXME: Can't we just use `package.manifest` instead? —— Paulo
42
42
43
43
/// The built PIF project object.
44
- public var pifProject : SWBProjectModel . PIF . Project {
44
+ public var pifProject : SwiftBuild . PIF . Project {
45
45
assert ( self . _pifProject != nil , " Call build() method to build the PIF first " )
46
46
return self . _pifProject!
47
47
}
48
48
49
- private var _pifProject : SWBProjectModel . PIF . Project ?
49
+ private var _pifProject : SwiftBuild . PIF . Project ?
50
50
51
51
/// Scope for logging informational debug messages (intended for developers, not end users).
52
52
let observabilityScope : ObservabilityScope
@@ -85,7 +85,7 @@ public final class PIFPackageBuilder {
85
85
86
86
/// For executables — only executables for now — we check to see if there is a custom package product type
87
87
/// provider that can provide this information.
88
- func customProductType( forExecutable product: PackageModel . Product ) -> SWBProjectModel . PIF . Target . ProductType ?
88
+ func customProductType( forExecutable product: PackageModel . Product ) -> SwiftBuild . PIF . Target . ProductType ?
89
89
90
90
/// Returns all *device family* IDs for all SDK variants.
91
91
func deviceFamilyIDs( ) -> Set < Int >
@@ -97,12 +97,12 @@ public final class PIFPackageBuilder {
97
97
var isPluginExecutionSandboxingDisabled : Bool { get }
98
98
99
99
/// Hook to customize the project-wide build settings.
100
- func configureProjectBuildSettings( _ buildSettings: inout SWBProjectModel . PIF . BuildSettings )
100
+ func configureProjectBuildSettings( _ buildSettings: inout SwiftBuild . PIF . BuildSettings )
101
101
102
102
/// Hook to customize source module build settings.
103
103
func configureSourceModuleBuildSettings(
104
104
sourceModule: PackageGraph . ResolvedModule ,
105
- settings: inout SWBProjectModel . PIF . BuildSettings
105
+ settings: inout SwiftBuild . PIF . BuildSettings
106
106
)
107
107
108
108
/// Custom install path for the specified product, if any.
@@ -118,13 +118,13 @@ public final class PIFPackageBuilder {
118
118
func customSDKOptions( forPlatform: PackageModel . Platform ) -> [ String ]
119
119
120
120
/// Create additional custom PIF targets after all targets have been built.
121
- func addCustomTargets( pifProject: SWBProjectModel . PIF . Project ) throws -> [ PIFPackageBuilder . ModuleOrProduct ]
121
+ func addCustomTargets( pifProject: SwiftBuild . PIF . Project ) throws -> [ PIFPackageBuilder . ModuleOrProduct ]
122
122
123
123
/// Should we suppresses the specific product dependency, updating the provided build settings if necessary?
124
124
/// The specified product may be in the same package or a different one.
125
125
func shouldSuppressProductDependency(
126
126
product: PackageModel . Product ,
127
- buildSettings: inout SWBProjectModel . PIF . BuildSettings
127
+ buildSettings: inout SwiftBuild . PIF . BuildSettings
128
128
) -> Bool
129
129
130
130
/// Should we set the install path for a dynamic library/framework?
@@ -133,8 +133,8 @@ public final class PIFPackageBuilder {
133
133
/// Provides additional configuration and files for the specified library product.
134
134
func configureLibraryProduct(
135
135
product: PackageModel . Product ,
136
- pifTarget: SWBProjectModel . PIF . Target ,
137
- additionalFiles: SWBProjectModel . PIF . Group
136
+ pifTarget: SwiftBuild . PIF . Target ,
137
+ additionalFiles: SwiftBuild . PIF . Group
138
138
)
139
139
140
140
/// The de#tention behind this is to set a value for `watchOS`, `tvOS`, and `visionOS`
@@ -204,7 +204,7 @@ public final class PIFPackageBuilder {
204
204
205
205
/// Build an empty PIF project for the specified `Package`.
206
206
207
- public class func buildEmptyPIF( package : PackageModel . Package ) -> SWBProjectModel . PIF . Project {
207
+ public class func buildEmptyPIF( package : PackageModel . Package ) -> SwiftBuild . PIF . Project {
208
208
self . buildEmptyPIF (
209
209
id: " PACKAGE: \( package . identity) " ,
210
210
path: package . manifest. path. pathString,
@@ -221,15 +221,15 @@ public final class PIFPackageBuilder {
221
221
projectDir: String ,
222
222
name: String ,
223
223
developmentRegion: String ? = nil
224
- ) -> SWBProjectModel . PIF . Project {
225
- let project = SWBProjectModel . PIF. Project (
224
+ ) -> SwiftBuild . PIF . Project {
225
+ let project = SwiftBuild . PIF. Project (
226
226
id: id,
227
227
path: path,
228
228
projectDir: projectDir,
229
229
name: name,
230
230
developmentRegion: developmentRegion
231
231
)
232
- let settings = SWBProjectModel . PIF. BuildSettings ( )
232
+ let settings = SwiftBuild . PIF. BuildSettings ( )
233
233
234
234
project. addBuildConfig ( name: " Debug " , settings: settings)
235
235
project. addBuildConfig ( name: " Release " , settings: settings)
@@ -238,18 +238,18 @@ public final class PIFPackageBuilder {
238
238
}
239
239
240
240
public func buildPlaceholderPIF( id: String , path: String , projectDir: String , name: String ) -> ModuleOrProduct {
241
- let project = SWBProjectModel . PIF. Project (
241
+ let project = SwiftBuild . PIF. Project (
242
242
id: id,
243
243
path: path,
244
244
projectDir: projectDir,
245
245
name: name
246
246
)
247
- let projectSettings = SWBProjectModel . PIF. BuildSettings ( )
247
+ let projectSettings = SwiftBuild . PIF. BuildSettings ( )
248
248
project. addBuildConfig ( name: " Debug " , settings: projectSettings)
249
249
project. addBuildConfig ( name: " Release " , settings: projectSettings)
250
250
251
251
let target = project. addAggregateTarget ( id: " PACKAGE-PLACEHOLDER: \( id) " , name: id)
252
- let targetSettings : SWBProjectModel . PIF . BuildSettings = self . package . underlying. packageBaseBuildSettings
252
+ let targetSettings : SwiftBuild . PIF . BuildSettings = self . package . underlying. packageBaseBuildSettings
253
253
target. addBuildConfig ( name: " Debug " , settings: targetSettings)
254
254
target. addBuildConfig ( name: " Release " , settings: targetSettings)
255
255
@@ -280,7 +280,7 @@ public final class PIFPackageBuilder {
280
280
public var moduleName : String ?
281
281
public var isDynamicLibraryVariant : Bool = false
282
282
283
- public var pifTarget : SWBProjectModel . PIF . BaseTarget ?
283
+ public var pifTarget : SwiftBuild . PIF . BaseTarget ?
284
284
285
285
public var indexableFileURLs : [ SourceControlURL ]
286
286
public var headerFiles : Set < AbsolutePath >
@@ -333,7 +333,7 @@ public final class PIFPackageBuilder {
333
333
334
334
public var description : String { rawValue }
335
335
336
- init ( from pifProductType: SWBProjectModel . PIF . Target . ProductType ) {
336
+ init ( from pifProductType: SwiftBuild . PIF . Target . ProductType ) {
337
337
self = switch pifProductType {
338
338
case . application: . application
339
339
case . staticArchive: . staticArchive
@@ -459,7 +459,7 @@ public final class PIFPackageBuilder {
459
459
/// First we set those that are in common between the "Debug" and "Release" configurations, and then we set those
460
460
/// that are different.
461
461
private func addProjectBuildSettings( project: PackagePIFProjectBuilder ) {
462
- var settings = SWBProjectModel . PIF. BuildSettings ( )
462
+ var settings = SwiftBuild . PIF. BuildSettings ( )
463
463
settings. PRODUCT_NAME = " $(TARGET_NAME) "
464
464
settings. SUPPORTED_PLATFORMS = [ " $(AVAILABLE_PLATFORMS) " ]
465
465
settings. SKIP_INSTALL = " YES "
@@ -508,7 +508,7 @@ public final class PIFPackageBuilder {
508
508
self . delegate. configureProjectBuildSettings ( & settings)
509
509
510
510
for (platform, platformOptions) in self . package . sdkOptions ( delegate: self . delegate) {
511
- let pifPlatform = SWBProjectModel . PIF. BuildSettings. Platform ( from: platform)
511
+ let pifPlatform = SwiftBuild . PIF. BuildSettings. Platform ( from: platform)
512
512
settings. platformSpecificSettings [ pifPlatform] ![ . SPECIALIZATION_SDK_OPTIONS] !
513
513
. append ( contentsOf: platformOptions)
514
514
}
@@ -591,7 +591,7 @@ extension PIFPackageBuilder.ModuleOrProduct {
591
591
type moduleOrProductType: PIFPackageBuilder . ModuleOrProductType ,
592
592
name: String ,
593
593
moduleName: String ? ,
594
- pifTarget: SWBProjectModel . PIF . BaseTarget ? ,
594
+ pifTarget: SwiftBuild . PIF . BaseTarget ? ,
595
595
indexableFileURLs: [ SourceControlURL ] = [ ] ,
596
596
headerFiles: Set < AbsolutePath > = [ ] ,
597
597
linkedPackageBinaries: [ PIFPackageBuilder . LinkedPackageBinary ] = [ ] ,
0 commit comments