swift

package
v0.0.0-...-9878773 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManifestFile   string = "Package.swift"
	BuildDirectory string = ".build"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PackageDependency

type PackageDependency struct {
	Name         string              `json:"name"`
	URL          string              `json:"url"`
	Version      string              `json:"version"`
	Path         string              `json:"path"`
	Dependencies []PackageDependency `json:"dependencies"`
}

func (PackageDependency) Module

func (dep PackageDependency) Module() *meta.Package

type PackageDescription

type PackageDescription struct {
	Name string `json:"name"`
	Path string `json:"path"`

	Dependencies []struct {
		URL         string `json:"url"`
		Requirement struct {
			Revision []string `json:"revision"`
			Range    []struct {
				LowerBound string `json:"lower_bound"`
				UpperBound string `json:"upper_bound"`
			}
		} `json:"requirement"`
	} `json:"dependencies"`

	Platforms []struct {
		Name    string `json:"name"`
		Version string `json:"version"`
	} `json:"platforms"`

	Products []struct {
		Name    string                 `json:"name"`
		Targets []string               `json:"targets"`
		Type    map[string]interface{} `json:"type"`
	} `json:"products"`

	Targets []struct {
		C99Name            string   `json:"c99name"`
		ModuleType         string   `json:"module_type"`
		Name               string   `json:"name"`
		Path               string   `json:"path"`
		ProductMemberships []string `json:"product_memberships"`
		Sources            []string `json:"sources"`
		TargetDependencies []string `json:"target_dependencies"`
		Type               string   `json:"type"`
	} `json:"targets"`

	ToolVersion string `json:"tools_version"`
}

func (PackageDescription) Module

func (description PackageDescription) Module() *meta.Package

type Swift

type Swift struct {
	// contains filtered or unexported fields
}

func New

func New() *Swift

New creates a new Swift package instance

func (*Swift) GetMetadata

func (m *Swift) GetMetadata() plugin.Metadata

GetMetadata returns root package information base on path given

func (*Swift) GetRootModule

func (m *Swift) GetRootModule(path string) (*meta.Package, error)

GetRootModule returns root package information base on path given

func (*Swift) GetVersion

func (m *Swift) GetVersion() (string, error)

GetVersion returns Swift language version

func (*Swift) HasModulesInstalled

func (m *Swift) HasModulesInstalled(path string) error

HasModulesInstalled checks whether the current project (based on given path) has the dependent packages installed

func (*Swift) IsValid

func (m *Swift) IsValid(path string) bool

IsValid checks if the project dependency file provided in the contract exists

func (*Swift) ListModulesWithDeps

func (m *Swift) ListModulesWithDeps(path string, globalSettingFile string) ([]meta.Package, error)

ListModulesWithDeps fetches and lists all packages (root and direct dependencies) required by the project in the given project directory (side-by-side), this is a one level only list of all used modules, and each with its direct dependency only (similar output to ListUsedModules but with direct dependency only)

func (*Swift) ListUsedModules

func (m *Swift) ListUsedModules(path string) ([]meta.Package, error)

ListUsedModules fetches and lists all packages required by the project in the given project directory, this is a plain list of all used modules (no nested or tree view)

func (*Swift) SetRootModule

func (m *Swift) SetRootModule(path string) error

SetRootModule sets root package information base on path given

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL