Help us shape the future of Go! Take the 2026 Go Developer Survey

exec

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeTaskHash

func ComputeTaskHash(task *ast.Task, baseDir string) (string, error)

func ExecuteParallel

func ExecuteParallel(ctx context.Context, tasks []*ast.Task, execFn func(context.Context, *ast.Task) error, maxWorkers int) error

func RecordRun

func RecordRun(taskName string)

Types

type Executor

type Executor struct {
	Taskfile   *ast.Taskfile
	Dir        string
	Level      report.Verbosity
	Reporter   report.Reporter
	MaxWorkers int
	Cache      *TaskCache
	// Parallel toggles the in-task dep-fanout. When true, each task's
	// `deps:` are executed concurrently (matching Taskfile semantics);
	// when false, sequentially.
	Parallel bool
	// Force, when true, makes every task re-run regardless of cache state.
	// Wired up from WAKE_FORCE=true (or a `wails3 build --clean` flag) at
	// the wake.Execute boundary. Bypasses both the Taskfile-declared cache
	// check (sources/generates/status) and the implicit native-Go cache.
	Force bool
	// contains filtered or unexported fields
}

func (*Executor) Execute

func (e *Executor) Execute(ctx context.Context, target string) error

func (*Executor) ExecuteWithVars

func (e *Executor) ExecuteWithVars(ctx context.Context, target string, extraVars map[string]*ast.Var) error

func (*Executor) FailureReported

func (e *Executor) FailureReported() bool

FailureReported reports whether the executor has rendered at least one StepFailed panel during this run. wake.go uses it to decide whether to surface the top-level error itself — when nothing has been rendered, the user gets no diagnostic unless wake echoes the error message.

type TaskCache

type TaskCache struct {
	Dir     string                    `json:"-"`
	Entries map[string]TaskCacheEntry `json:"entries"`
	// contains filtered or unexported fields
}

TaskCache is shared across parallel workers: ShouldSkip / ShouldSkipGoCmd read Entries while RecordTask / RecordGoCmd write to it, and Save serialises the whole map. All access goes through mu.

func LoadTaskCache

func LoadTaskCache(baseDir string) (*TaskCache, error)

func (*TaskCache) RecordGoCmd

func (tc *TaskCache) RecordGoCmd(name, expandedCmd string) error

RecordGoCmd stores the implicit cache entry for a native Go command after a successful run.

func (*TaskCache) RecordTask

func (tc *TaskCache) RecordTask(task *ast.Task, baseDir string) error

func (*TaskCache) Save

func (tc *TaskCache) Save() error

func (*TaskCache) ShouldSkip

func (tc *TaskCache) ShouldSkip(task *ast.Task, baseDir string) bool

func (*TaskCache) ShouldSkipGoCmd

func (tc *TaskCache) ShouldSkipGoCmd(name, expandedCmd string, sources []string, output string) bool

ShouldSkipGoCmd reports whether a previously-cached native Go command can be skipped: the command (flags) is unchanged, the expected output still exists, and no input file has been modified since the last successful run.

type TaskCacheEntry

type TaskCacheEntry struct {
	Hash    string    `json:"hash"`
	LastRun time.Time `json:"last_run"`
}

Jump to

Keyboard shortcuts

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