golang

package
Version: v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package golang provides golang toolchain (go) support for dukkha

Index

Constants

View Source
const TaskKindBuild = "build"
View Source
const TaskKindTest = "test"
View Source
const ToolKind = "golang"

Variables

This section is empty.

Functions

This section is empty.

Types

type CGOSepc

type CGOSepc struct {
	rs.BaseField `yaml:"-"`

	// Enable cgo
	Enabled bool `yaml:"enabled"`

	// CPPFlags (env CGO_CPPFLAGS) C preprocessor flags
	CPPFlags []string `yaml:"cppflags"`

	// CFlags (env CGO_CFLAGS) C flags
	CFlags []string `yaml:"cflags"`

	// CXXFlags (env CGO_CXXFLAGS)
	CXXFlags []string `yaml:"cxxflags"`

	// FFlags (env CGO_FFLAGS) Fortran flags
	FFlags []string `yaml:"fflags"`

	// LDFlags (env CGO_LDFLAGS) ldflags
	LDFlags []string `yaml:"ldflags"`

	// CC sets C compiler path or executable name
	CC string `yaml:"cc"`

	// CXX sets C++ compiler path or executable name
	CXX string `yaml:"cxx"`

	// FC sets Fortan compiler path or executable name
	FC string `yaml:"fc"`
}

type TaskBuild

type TaskBuild struct {
	rs.BaseField `yaml:"-"`

	TaskName string `yaml:"name"`

	tools.BaseTask `yaml:",inline"`

	// Chdir into a different dir when running go command while keep `dukkha.WorkDir` unchanged
	// this can be helpful when you are managing multiple go modules in one workspace
	Chdir string `yaml:"chdir"`

	// Path is the import path of the source code to be built
	// it will be the last argument of this go command execution
	//
	// see `go help packages` for more information about import path
	Path string `yaml:"path"`

	// Outputs of the go build command, when multiple entries specified, will build multiple times with same
	// arguments
	Outputs []string `yaml:"outputs"`

	BuildOptions buildOptions `yaml:",inline"`

	// CGo options
	CGo CGOSepc `yaml:"cgo"`

	// ExtraArgs for go build (inserted before `Path`)
	ExtraArgs []string `yaml:"extra_args"`
}

func (*TaskBuild) GetExecSpecs

func (*TaskBuild) Key added in v0.7.0

func (c *TaskBuild) Key() dukkha.TaskKey

func (*TaskBuild) Kind added in v0.7.0

func (c *TaskBuild) Kind() dukkha.TaskKind

func (*TaskBuild) Name added in v0.7.0

func (c *TaskBuild) Name() dukkha.TaskName

type TaskTest

type TaskTest struct {
	rs.BaseField `yaml:"-"`

	TaskName string `yaml:"name"`

	tools.BaseTask `yaml:",inline"`

	CGO CGOSepc `yaml:"cgo"`

	Path  string `yaml:"path"`
	Chdir string `yaml:"chdir"`

	BuildOptions buildOptions `yaml:",inline"`
	Test         testSpec     `yaml:",inline"`

	Benchmark testBenchmarkSpec `yaml:"benchmark"`
	Profile   testProfileSpec   `yaml:"profile"`

	// ExtraArgs for go test (inserted before `Path`)
	ExtraArgs []string `yaml:"extra_args"`

	// CustomCmdPrefix to run compiled test file with this cmd prefix
	// e.g. built xxx.test, usually will run in local host as ./xxx.test
	//      but with `custom_cmd_prefx=[ssh, testsrv]`, will run as `ssh testsrv xxx.test`
	CustomCmdPrefix []string `yaml:"custom_cmd_prefix"`

	// CustomArgs appended when running the test
	CustomArgs []string `yaml:"custom_args"`
}

func (*TaskTest) GetExecSpecs

func (c *TaskTest) GetExecSpecs(
	rc dukkha.TaskExecContext, options dukkha.TaskMatrixExecOptions,
) ([]dukkha.TaskExecSpec, error)

func (*TaskTest) Key added in v0.7.0

func (c *TaskTest) Key() dukkha.TaskKey

func (*TaskTest) Kind added in v0.7.0

func (c *TaskTest) Kind() dukkha.TaskKind

func (*TaskTest) Name added in v0.7.0

func (c *TaskTest) Name() dukkha.TaskName

type Tool

type Tool struct {
	rs.BaseField `yaml:"-"`

	ToolName dukkha.ToolName `yaml:"name"`

	tools.BaseTool `yaml:",inline"`
}

func (*Tool) Init

func (t *Tool) Init(cacheFS *fshelper.OSFS) error

func (*Tool) Key added in v0.7.0

func (t *Tool) Key() dukkha.ToolKey

func (*Tool) Kind added in v0.7.0

func (t *Tool) Kind() dukkha.ToolKind

func (*Tool) Name added in v0.7.0

func (t *Tool) Name() dukkha.ToolName

Jump to

Keyboard shortcuts

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