Skip to content

STRUCT

PackageSettings ​

Contents

  • Properties
    • productTypes
    • baseSettings
    • targetSettings
    • projectOptions
  • Methods
    • init(productTypes:baseSettings:targetSettings:projectOptions:)
swift
public struct PackageSettings: Codable, Equatable

A custom Swift Package Manager configuration

swift
// swift-tools-version: 5.8
import PackageDescription

#if GEKO
    import ProjectDescription
    import ProjectDescriptionHelpers

    let packageSettings = PackageSettings(
        productTypes: [
            "Alamofire": .framework, // default is .staticFramework
        ]
    )
#endif

let package = Package(
    name: "PackageName",
    dependencies: [
        .package(url: "https://github.com/Alamofire/Alamofire", from: "5.0.0"),
    ]
)

Properties ​

productTypes ​

swift
public var productTypes: [String: Product]

The custom Product type to be used for SPM targets.

baseSettings ​

swift
public var baseSettings: Settings

targetSettings ​

swift
public var targetSettings: [String: Settings]

projectOptions ​

swift
public var projectOptions: [String: Project.Options]

Custom project configurations to be used for projects generated from SwiftPackageManager.

Methods ​

init(productTypes:baseSettings:targetSettings:projectOptions:) ​

swift
public init(
    productTypes: [String: Product] = [:],
    baseSettings: Settings = .settings(),
    targetSettings: [String: Settings] = [:],
    projectOptions: [String: Project.Options] = [:]
)

Creates PackageSettings instance for custom Swift Package Manager configuration.

  • Parameters:
    • productTypes: The custom Product types to be used for SPM targets.
    • baseSettings: Additional settings to be added to targets generated from SwiftPackageManager.
    • targetSettings: Additional settings to be added to targets generated from SwiftPackageManager.
    • projectOptions: Custom project configurations to be used for projects generated from SwiftPackageManager.

Parameters ​

NameDescription
productTypesThe custom Product types to be used for SPM targets.
baseSettingsAdditional settings to be added to targets generated from SwiftPackageManager.
targetSettingsAdditional settings to be added to targets generated from SwiftPackageManager.
projectOptionsCustom project configurations to be used for projects generated from SwiftPackageManager.