Product

public final class Product: CustomStringConvertible, Codable

A product that is vended by the parent package.

For more information, visit the SPM docs.

  • Keys used of encoding a Product object.

    Declaration

    Swift

    public typealias CodingKeys = ProductCodingKeys
  • Denotes wheather the product is a library or an executable.

    Declaration

    Swift

    public let type: ProductType
  • The name of the target.

    Declaration

    Swift

    public var name: String
  • How the product gets linked to a client project if it is a library.

    Declaration

    Swift

    public var linking: LibraryLinkingType?
  • The package’s targets that the product can access.

    Declaration

    Swift

    public var targets: [String]
  • Declaration

    Swift

    public init(type: ProductType, name: String, linking: LibraryLinkingType?, targets: [String])
  • Declaration

    Swift

    public init(from decoder: Decoder) throws
  • The product formatted for the manifest.

    Declaration

    Swift

    public var description: String
  • Encodes the objects public properties to an encoder

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws

    Parameters

    encoder

    The encoder the properties get encoded to.

  • Updates the product’s instance in the project’s manifest. If the product does not exist in the manifest

    Declaration

    Swift

    public func save() throws
  • Removes the product instance from the manifest’s Package.products array.

    Throws

    Errors that occur when creating a RegEx pattern or reading or writing the manifest.

    Declaration

    Swift

    public func delete() throws