toolkits

package
v0.0.0-...-5994bb8 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BashToolkit

type BashToolkit struct {
}

BashToolkit ...

func (BashToolkit) Bootstrap

func (toolkit BashToolkit) Bootstrap() error

Bootstrap ...

func (BashToolkit) Check

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

Check ...

func (BashToolkit) Install

func (toolkit BashToolkit) Install() error

Install ...

func (BashToolkit) IsToolAvailableInPATH

func (toolkit BashToolkit) IsToolAvailableInPATH() bool

IsToolAvailableInPATH ...

func (BashToolkit) PrepareForStepRun

func (toolkit BashToolkit) PrepareForStepRun(step stepmanModels.StepModel, sIDData models.StepIDData, stepAbsDirPath string) error

PrepareForStepRun ...

func (BashToolkit) StepRunCommandArguments

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

StepRunCommandArguments ...

func (BashToolkit) ToolkitName

func (toolkit BashToolkit) ToolkitName() string

ToolkitName ...

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
}

GoConfigurationModel ...

type GoToolkit

type GoToolkit struct {
}

GoToolkit ...

func (GoToolkit) Bootstrap

func (toolkit GoToolkit) Bootstrap() error

Bootstrap ...

func (GoToolkit) Check

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

Check ...

func (GoToolkit) Install

func (toolkit GoToolkit) Install() error

Install ...

func (GoToolkit) IsToolAvailableInPATH

func (toolkit GoToolkit) IsToolAvailableInPATH() bool

IsToolAvailableInPATH ...

func (GoToolkit) PrepareForStepRun

func (toolkit GoToolkit) PrepareForStepRun(step stepmanModels.StepModel, sIDData models.StepIDData, stepAbsDirPath string) error

PrepareForStepRun ...

func (GoToolkit) StepRunCommandArguments

func (toolkit GoToolkit) StepRunCommandArguments(step stepmanModels.StepModel, sIDData models.StepIDData, stepAbsDirPath string) ([]string, error)

StepRunCommandArguments ...

func (GoToolkit) ToolkitName

func (toolkit GoToolkit) ToolkitName() string

ToolkitName ...

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 stepmanModels.StepModel, sIDData models.StepIDData, stepAbsDirPath string) error

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

Toolkit ...

func AllSupportedToolkits

func AllSupportedToolkits() []Toolkit

AllSupportedToolkits ...

func ToolkitForStep

func ToolkitForStep(step stepmanModels.StepModel) Toolkit

ToolkitForStep ...

type ToolkitCheckResult

type ToolkitCheckResult struct {
	Path    string
	Version string
}

ToolkitCheckResult ...

Jump to

Keyboard shortcuts

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