toolkits

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 20 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BashToolkit

type BashToolkit struct {
}

func (BashToolkit) Bootstrap

func (toolkit BashToolkit) Bootstrap() error

func (BashToolkit) Check

func (toolkit BashToolkit) Check() (bool, ToolkitCheckResult, error)

func (BashToolkit) Install

func (toolkit BashToolkit) Install() error

func (BashToolkit) IsToolAvailableInPATH

func (toolkit BashToolkit) IsToolAvailableInPATH() bool

func (BashToolkit) PrepareForStepRun

func (toolkit BashToolkit) PrepareForStepRun(_ models.StepModel, _ stepid.CanonicalID, _ string) error

func (BashToolkit) StepRunCommandArguments

func (toolkit BashToolkit) StepRunCommandArguments(step models.StepModel, sIDData stepid.CanonicalID, stepAbsDirPath string) ([]string, error)

func (BashToolkit) ToolkitName

func (toolkit BashToolkit) ToolkitName() string

type GoConfigurationModel

type GoConfigurationModel struct {
	// full path of the go binary to use
	GoBinaryPath string
	// GOROOT env var value to set (unless empty)
	GOROOT string
}

type GoToolkit

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

func NewGoToolkit

func NewGoToolkit(logger stepman.Logger) GoToolkit

func (GoToolkit) Bootstrap

func (toolkit GoToolkit) Bootstrap() error

func (GoToolkit) Check

func (toolkit GoToolkit) Check() (bool, ToolkitCheckResult, error)

func (GoToolkit) Install

func (toolkit GoToolkit) Install() error

func (GoToolkit) IsToolAvailableInPATH

func (toolkit GoToolkit) IsToolAvailableInPATH() bool

func (GoToolkit) PrepareForStepRun

func (toolkit GoToolkit) PrepareForStepRun(step models.StepModel, sIDData stepid.CanonicalID, stepAbsDirPath string) error

PrepareForStepRun ...

func (GoToolkit) StepRunCommandArguments

func (toolkit GoToolkit) StepRunCommandArguments(_ models.StepModel, sIDData stepid.CanonicalID, stepAbsDirPath string) ([]string, error)

StepRunCommandArguments ...

func (GoToolkit) ToolkitName

func (toolkit GoToolkit) ToolkitName() string

type SwiftToolkit

type SwiftToolkit struct {
}

func (SwiftToolkit) Bootstrap

func (toolkit SwiftToolkit) Bootstrap() error

func (SwiftToolkit) Check

func (toolkit SwiftToolkit) Check() (bool, ToolkitCheckResult, error)

func (SwiftToolkit) Install

func (toolkit SwiftToolkit) Install() error

func (SwiftToolkit) IsToolAvailableInPATH

func (toolkit SwiftToolkit) IsToolAvailableInPATH() bool

func (SwiftToolkit) PrepareForStepRun

func (toolkit SwiftToolkit) PrepareForStepRun(step models.StepModel, _ stepid.CanonicalID, stepAbsDirPath string) error

func (SwiftToolkit) StepRunCommandArguments

func (toolkit SwiftToolkit) StepRunCommandArguments(step models.StepModel, sIDData stepid.CanonicalID, stepAbsDirPath string) ([]string, error)

func (SwiftToolkit) ToolkitName

func (toolkit SwiftToolkit) ToolkitName() string

type Toolkit

type Toolkit interface {
	// ToolkitName : a one liner name/id of the toolkit, for logging purposes
	ToolkitName() string

	// Check the toolkit - first returned value (bool) indicates
	// whether the toolkit have to be installed (true=install required | false=no install required).
	// "Have to be installed" can be true if the toolkit is not installed,
	// or if an older version is installed, and an update/newer version is required.
	Check() (bool, ToolkitCheckResult, error)

	// Install the toolkit
	Install() error

	// Check whether the toolkit's tool (e.g. Go, Ruby, Bash, ...) is available
	// and "usable"" without any bootstrapping.
	// Return true even if the version is older than the required version for this toolkit,
	// you can pick / init the right version later. This function only checks
	// whether the system has a pre-installed version of the toolkit's tool or not,
	// no compability check is required!
	IsToolAvailableInPATH() bool

	// Bootstrap : initialize the toolkit for use, ONLY IF THERE'S NO SYSTEM INSTALLED VERSION!
	// If there's any version of the tool (e.g. Go) installed, Bootstrap should not overwrite it,
	// so that the non toolkit steps will still use the system installed version!
	//
	// Will run only once, before the build would actually start,
	// so that it can set e.g. a default Go or other language version, if there's no System Installed version!
	//
	// Bootstrap should only set a sensible default if there's no System Installed version of the tool,
	// but should not enforce the toolkit's version of the tool!
	// The `PrepareForStepRun` function will be called for every step,
	// the toolkit should be "enforced" there, BUT ONLY FOR THAT FUNCTION (e.g. don't call os.Setenv there!)
	Bootstrap() error

	// PrepareForStepRun can be used to pre-compile or otherwise prepare for the step's execution.
	//
	// Important: do NOT enforce the toolkit for subsequent / unrelated steps or functions,
	// the toolkit should/can be "enforced" here (e.g. during the compilation),
	// BUT ONLY for this function! E.g. don't call `os.Setenv` or something similar
	// which would affect other functions, just pass the required envs to the compilation command!
	PrepareForStepRun(step models.StepModel, sIDData stepid.CanonicalID, stepAbsDirPath string) error

	// StepRunCommandArguments ...
	StepRunCommandArguments(step models.StepModel, sIDData stepid.CanonicalID, stepAbsDirPath string) ([]string, error)
}

func AllSupportedToolkits

func AllSupportedToolkits(logger stepman.Logger) []Toolkit

func ToolkitForStep

func ToolkitForStep(step models.StepModel, logger stepman.Logger) Toolkit

type ToolkitCheckResult

type ToolkitCheckResult struct {
	Path    string
	Version string
}

Jump to

Keyboard shortcuts

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