STRUCT
PackageSettings
Contents
- Properties
productTypesbaseSettingstargetSettingsprojectOptions
- Methods
init(productTypes:baseSettings:targetSettings:projectOptions:)
swift
public struct PackageSettings: Codable, EquatableA 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: SettingstargetSettings
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
Producttypes 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.
- productTypes: The custom
Parameters
| Name | Description |
|---|---|
| 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. |
