Skip to content

Adopt SwiftBuild.ProjectModel API in the new PIF builder in SwiftBuildSupport #8441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 5, 2025
6 changes: 3 additions & 3 deletions Sources/SwiftBuildSupport/PIFBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,7 @@ private struct PIFBuildSettingAssignment {
let platforms: [PIF.BuildSettings.Platform]?
}

extension BuildSettings.AssignmentTable {
extension PackageModel.BuildSettings.AssignmentTable {
fileprivate var pifAssignments: [PIF.BuildSettings.MultipleValueSetting: [PIFBuildSettingAssignment]] {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just fixing naming clashes.

var pifAssignments: [PIF.BuildSettings.MultipleValueSetting: [PIFBuildSettingAssignment]] = [:]

Expand Down Expand Up @@ -1679,7 +1679,7 @@ extension BuildSettings.AssignmentTable {
}
}

extension BuildSettings.Assignment {
extension PackageModel.BuildSettings.Assignment {
fileprivate var configurations: [BuildConfiguration] {
if let configurationCondition = conditions.lazy.compactMap(\.configurationCondition).first {
[configurationCondition.configuration]
Expand Down Expand Up @@ -1866,7 +1866,7 @@ extension PIF.BuildSettings {
.filter { isSupportedVersion($0) }.map(\.description)
}

func computeEffectiveTargetVersion(for assignment: BuildSettings.Assignment) throws -> String {
func computeEffectiveTargetVersion(for assignment: PackageModel.BuildSettings.Assignment) throws -> String {
let versions = assignment.values.compactMap { SwiftLanguageVersion(string: $0) }
if let effectiveVersion = computeEffectiveSwiftVersions(for: versions).last {
return effectiveVersion
Expand Down
295 changes: 159 additions & 136 deletions Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.swift

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions Sources/SwiftBuildSupport/PackagePIFBuilder+Plugins.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import enum Basics.Sandbox
import struct Basics.SourceControlURL

#if canImport(SwiftBuild)
import enum SwiftBuild.PIF

extension PIFPackageBuilder {
import enum SwiftBuild.ProjectModel

extension PackagePIFBuilder {
/// Contains all of the information resulting from applying a build tool plugin to a package target thats affect how
/// a target is built.
///
Expand Down
226 changes: 121 additions & 105 deletions Sources/SwiftBuildSupport/PackagePIFBuilder.swift

Large diffs are not rendered by default.

444 changes: 250 additions & 194 deletions Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift

Large diffs are not rendered by default.

556 changes: 329 additions & 227 deletions Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift

Large diffs are not rendered by default.

262 changes: 163 additions & 99 deletions Sources/SwiftBuildSupport/PackagePIFProjectBuilder.swift

Large diffs are not rendered by default.