sevki.org/build

Package build defines build target and build context structures

Index

Package Files

build.go

type Context

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

Context defines the context in which a target will be built, it provide helper functions for shelling out without having to worry about stdout or stderr outputs.

func NewContext

func NewContext(dir string) *Context

NewContext initializes and returns a new build.Context

func (*Context) Create

func (c *Context) Create(name string) (*os.File, error)

Create creates and returns a new file with the given name in the context

func (*Context) Exec

func (c *Context) Exec(cmd string, env, params []string) error

Exec executes a command writing it's outputs to the context

func (*Context) Mkdir

func (c *Context) Mkdir(name string) error

func (*Context) Open

func (c *Context) Open(name string) (*os.File, error)

Open creates and returns a new file with the given name in the context

func (*Context) Printf

func (c *Context) Printf(format string, v ...interface{})

func (*Context) Println

func (c *Context) Println(v ...interface{})

func (*Context) Run

func (c *Context) Run(ctx context.Context, cmd string, env, params []string) *exec.Cmd

Run executes a command writing it's outputs to the context

func (*Context) StdErr

func (c *Context) StdErr() io.Reader

func (*Context) Stdout

func (c *Context) Stdout() io.Reader

type Target

type Target interface {
    GetName() string
    GetDependencies() []string

    Hash() []byte
    Build(*Context) error
    Installs() map[string]string
}

Target defines the interface that rules must implement for becoming build targets.

Subdirectories

ast
builder
cmd
internal
lexer
parser
postprocessor
preprocessor
processor
targets
token
util