init(name:defaultLocalization:platforms:pkgConfig:providers:products:dependencies:targets:swiftLanguageVersions:cLanguageStandard:cxxLanguageStandard:)
Initializes a Swift package with configuration options you provide.
PackageDescription.swift:258This declaration has been renamed to Package.init(name:defaultLocalization:platforms:pkgConfig:providers:products:dependencies:targets:swiftLanguageModes:cLanguageStandard:cxxLanguageStandard:).
This declaration was deprecated in SwiftPM 6.
init(name: String, defaultLocalization: LanguageTag? = nil, platforms: [SupportedPlatform]? = nil, pkgConfig: String? = nil, providers: [SystemPackageProvider]? = nil, products: [Product] = [], dependencies: [Dependency] = [], targets: [Target] = [], swiftLanguageVersions: [SwiftVersion]? = nil, cLanguageStandard: CLanguageStandard? = nil, cxxLanguageStandard: CXXLanguageStandard? = nil)
Parameters
- name
The name of the Swift package, or
nil
to use the package’s Git URL to deduce the name.- defaultLocalization
The default localization for resources.
- platforms
The list of supported platforms with a custom deployment target.
- pkgConfig
The name to use for C modules. If present, Swift Package Manager searches for a
<name>.pc
file to get the additional flags required for a system target.- providers
The package providers for a system target.
- products
The list of products that this package makes available for clients to use.
- dependencies
The list of package dependencies.
- targets
The list of targets that are part of this package.
- swiftLanguageVersions
The list of Swift versions with which this package is compatible.
- cLanguageStandard
The C language standard to use for all C targets in this package.
- cxxLanguageStandard
The C++ language standard to use for all C++ targets in this package.
Other members in extension
Types
class Dependency
A package dependency of a Swift package.
Type members
init(name: String, defaultLocalization: LanguageTag?, platforms: [SupportedPlatform]?, pkgConfig: String?, providers: [SystemPackageProvider]?, products: [Product], dependencies: [Dependency], targets: [Target], swiftLanguageModes: [SwiftLanguageMode]?, cLanguageStandard: CLanguageStandard?, cxxLanguageStandard: CXXLanguageStandard?
) Initializes a Swift package with configuration options you provide.
Show obsolete interfaces (3)
Hide obsolete interfaces
init(name: String, pkgConfig: String?, providers: [SystemPackageProvider]?, products: [Product], dependencies: [Dependency], targets: [Target], swiftLanguageVersions: [SwiftVersion]?, cLanguageStandard: CLanguageStandard?, cxxLanguageStandard: CXXLanguageStandard?
) Initializes a Swift package with configuration options you provide.
init(name: String, pkgConfig: String?, providers: [SystemPackageProvider]?, products: [Product], dependencies: [Dependency], targets: [Target], swiftLanguageVersions: [Int]?, cLanguageStandard: CLanguageStandard?, cxxLanguageStandard: CXXLanguageStandard?
) Initializes a Swift package with configuration options you provide.
init(name: String, platforms: [SupportedPlatform]?, pkgConfig: String?, providers: [SystemPackageProvider]?, products: [Product], dependencies: [Dependency], targets: [Target], swiftLanguageVersions: [SwiftVersion]?, cLanguageStandard: CLanguageStandard?, cxxLanguageStandard: CXXLanguageStandard?
) Initializes a Swift package with configuration options you provide.
Instance members
var cLanguageStandard: CLanguageStandard?
The C language standard to use for all C targets in this package.
var cxxLanguageStandard: CXXLanguageStandard?
The C++ language standard to use for all C++ targets in this package.
var defaultLocalization: LanguageTag?
The default localization for resources.
var dependencies: [Dependency]
The list of package dependencies.
var name: String
The name of the Swift package.
var pkgConfig: String?
The name to use for C modules.
var platforms: [SupportedPlatform]?
The list of minimum versions for platforms supported by the package.
var products: [Product]
The list of products that this package vends and that clients can use.
var providers: [SystemPackageProvider]?
An array of providers for a system target.
var swiftLanguageModes: [SwiftLanguageMode]?
The list of Swift language modes with which this package is compatible.
var targets: [Target]
The list of targets that are part of this package.
Show obsolete interfaces (1)
Hide obsolete interfaces
var swiftLanguageVersions: [SwiftVersion]?
Legacy property name, accesses value of
swiftLanguageModes