supermake

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseInterpreterCommand

func ParseInterpreterCommand(variables Variables, entrypoint, commands []string) (string, []string)

Types

type Command

type Command interface {
	GetShellCommands() []string
}

type CommandExecutor

type CommandExecutor interface {
	Execute(ctx context.Context, execCtx ExecutorContext, command Command) error
}

type CommandGroup

type CommandGroup []string

func (CommandGroup) GetShellCommands

func (c CommandGroup) GetShellCommands() []string

type DockerEnvironment

type DockerEnvironment struct {
	Image      string
	Entrypoint []string
}

func (*DockerEnvironment) Execute

func (d *DockerEnvironment) Execute(ctx context.Context, execCtx ExecutorContext, command Command) error

type ExecutorContext

type ExecutorContext struct {
	EnvVars       Variables
	Targets       Targets
	ParentTargets Targets
	WorkingDir    string
	Logger        *log.Logger
	Scheduler     Scheduler
}

type LocalEnvironment

type LocalEnvironment struct {
	Entrypoint []string
}

func NewLocalEnvironment

func NewLocalEnvironment() *LocalEnvironment

func (*LocalEnvironment) Execute

func (l *LocalEnvironment) Execute(ctx context.Context, execCtx ExecutorContext, command Command) error

type LocalScheduler

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

func NewLocalScheduler

func NewLocalScheduler() *LocalScheduler

func (*LocalScheduler) ResetTarget

func (s *LocalScheduler) ResetTarget(ctx context.Context, target *Target) error

func (*LocalScheduler) ScheduleTarget

func (s *LocalScheduler) ScheduleTarget(ctx context.Context, execCtx ExecutorContext, target *Target) error

func (*LocalScheduler) TargetDone

func (s *LocalScheduler) TargetDone(ctx context.Context, target *Target) error

type ParallelCommands

type ParallelCommands struct {
	Environment CommandExecutor
	Steps       []Command
}

func (*ParallelCommands) FQN

func (c *ParallelCommands) FQN() string

func (*ParallelCommands) GetShellCommands

func (c *ParallelCommands) GetShellCommands() []string

func (*ParallelCommands) Name

func (c *ParallelCommands) Name() string

func (*ParallelCommands) Run

func (c *ParallelCommands) Run(ctx context.Context, execCtx ExecutorContext) error

type Runable

type Runable interface {
	Run(ctx context.Context, execCtx ExecutorContext) error
	Name() string
}

type Scheduler

type Scheduler interface {
	ScheduleTarget(ctx context.Context, execCtx ExecutorContext, target *Target) error
	TargetDone(ctx context.Context, target *Target) error
	ResetTarget(ctx context.Context, target *Target) error
}

type SerialCommands

type SerialCommands struct {
	Environment CommandExecutor
	Steps       []Command
}

func (*SerialCommands) FQN

func (c *SerialCommands) FQN() string

func (*SerialCommands) GetShellCommands

func (c *SerialCommands) GetShellCommands() []string

func (*SerialCommands) Name

func (c *SerialCommands) Name() string

func (*SerialCommands) Run

func (c *SerialCommands) Run(ctx context.Context, execCtx ExecutorContext) error

type ShellCommand

type ShellCommand struct {
	Command string
}

func (*ShellCommand) GetShellCommands

func (c *ShellCommand) GetShellCommands() []string

type SupermakeFile

type SupermakeFile struct {
	Targets   Targets
	Variables Variables
}

func (*SupermakeFile) GetDoneFileTargets

func (s *SupermakeFile) GetDoneFileTargets() []*Target

func (*SupermakeFile) Help

func (s *SupermakeFile) Help() string

func (*SupermakeFile) Run

func (s *SupermakeFile) Run(ctx context.Context, scheduler Scheduler, cwd string, targets ...string) error

type Target

type Target struct {
	Node         string
	Dependencies []string
	Variables    Variables
	Executor     CommandExecutor
	Steps        []Command
	// contains filtered or unexported fields
}

func NewTarget

func NewTarget(name, node string, dependencies []string, executor CommandExecutor, steps []Command, variables Variables) *Target

func (*Target) FQN

func (t *Target) FQN() string

func (*Target) Name

func (t *Target) Name() string

func (*Target) Run

func (t *Target) Run(ctx context.Context, execCtx ExecutorContext) error

type Targets

type Targets map[string]*Target

type Variable

type Variable struct {
	Name           string
	EvaluationType VariableEvaluationType
	Export         bool
	// contains filtered or unexported fields
}

func NewVariable

func NewVariable(name string, evaluationType VariableEvaluationType, export bool, value string) *Variable

func (*Variable) EnvString

func (v *Variable) EnvString() string

func (*Variable) Value

func (v *Variable) Value() string

type VariableEvaluationType

type VariableEvaluationType int
const (
	RECURSIVE VariableEvaluationType = iota
	FALLBACK
)

type Variables

type Variables map[string]*Variable

func (Variables) EnvStrings

func (v Variables) EnvStrings() []string

Returns a list of strings like K=V.

func (Variables) EnvStringsInherited

func (v Variables) EnvStringsInherited() []string

Returns a list of strings like K=V. Including those inherited by the calling shell.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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