swiftbin

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package swiftbin provides utitilty functions for executing Swift commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindSwiftBinPath

func FindSwiftBinPath() (string, error)

FindSwiftBinPath returns the path to the Swift executable.

func SwiftBinBase

func SwiftBinBase() string

SwiftBinBase returns the base name for the Swift executable.

Types

type Executor

type Executor interface {
	InitPackage(dir, name, pkgType string) error
	DumpPackage(dir, buildDir string) ([]byte, error)
	DescribePackage(dir string) ([]byte, error)
}

An Executor represents commands provided by the Swift binary.

type SwiftBin

type SwiftBin struct {
	BinPath string
}

A SwiftBin implements that actual calls to the Swift binary.

func NewSwiftBin

func NewSwiftBin(binPath string) *SwiftBin

func (*SwiftBin) DescribePackage

func (sb *SwiftBin) DescribePackage(dir string) ([]byte, error)

DescribePackage returns the `swift package describe` JSON for a Swift package.

func (*SwiftBin) DumpPackage

func (sb *SwiftBin) DumpPackage(dir, buildDir string) ([]byte, error)

DumpPackage returns the `swift package dump-package` JSON for a Swift package.

func (*SwiftBin) InitPackage

func (sb *SwiftBin) InitPackage(dir, name, pkgType string) error

InitPackage initializes a new Swift package in the specified directory.

func (*SwiftBin) ResolvePackage

func (sb *SwiftBin) ResolvePackage(dir, buildDir string, updateToLatest bool) error

ResolvePackage executes Swift package dependency resolution for a Swift package.

Jump to

Keyboard shortcuts

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