Documentation ¶
Overview ¶
Package spdesc provides types and utility functions for reading Swift package description JSON.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type Dependency struct { Identity string Type string URL string Requirement DependencyRequirement }
A Dependency represents a Swift external dependency.
type DependencyRequirement ¶
type DependencyRequirement struct {
Range []VersionRange
}
A DependencyRequirement represents the eligibility requirements for an external dependency.
type Manifest ¶
type Manifest struct { Name string ManifestDisplayName string `json:"manifest_display_name"` Path string ToolsVersion string `json:"tools_version"` Targets Targets Platforms []Platform Products []Product Dependencies []Dependency }
A Manifest represents the root of the description JSON. The members of the struct provide access to the Swift manifest parts.
func NewManifestFromJSON ¶
NewManifestFromJSON creates a Swift manifest from description JSON.
type Product ¶
type Product struct { Name string Targets []string Type ProductType }
A Product represents a Swift product.
type ProductType ¶
type ProductType int
A ProductType is an enum that identifies the type of Swift product.
const ( UnknownProductType ProductType = iota ExecutableProductType LibraryProductType PluginProductType )
func (*ProductType) UnmarshalJSON ¶
func (pt *ProductType) UnmarshalJSON(b []byte) error
type Target ¶
type Target struct { Name string C99name string `json:"c99name"` Type string ModuleType string `json:"module_type"` Path string Sources []string TargetDependencies []string `json:"target_dependencies"` ProductDependencies []string `json:"product_dependencies"` ProductMemberships []string `json:"product_memberships"` }
A Target represents a Swift target.
func (*Target) SourcesWithPath ¶
SourcesWithPath returns the sources prepended by the target's path.
type Targets ¶
type Targets []Target
Targets represents a slice of Swift targets.
func (Targets) FindByName ¶
FindByName returns the Swift target that matches the provided name. It returns nil, if a match is not found.
func (Targets) FindByPath ¶
FindByPath returns the Swift target that matches the provided path. It returns nil, if a match is not found.
type VersionRange ¶
type VersionRange struct { LowerBound string `json:"lower_bound"` UpperBound string `json:"upper_bound"` }
A VersionRange represents an upper and lower bound for the elgibility of an external dependency.