buildconfig

package
v0.0.0-...-9febfc8 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 34 Imported by: 0

Documentation

Overview

Package buildconfig provides build config for `siso ninja`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Metadata contains key-value metadata for the build.
	Metadata metadata.Metadata
	// contains filtered or unexported fields
}

Config is a build config.

func New

func New(ctx context.Context, fname string, flags map[string]string, repos map[string]fs.FS) (*Config, error)

New returns new build config.

func (*Config) Func

func (cfg *Config) Func(ctx context.Context, handler string) (starlark.Value, bool)

Func returns a function for the handler name.

func (*Config) Handle

func (cfg *Config) Handle(ctx context.Context, handler string, bpath *build.Path, cmd *execute.Cmd, expandedInputs func() []string) (err error)

Handle runs handler for the cmd.

func (*Config) Init

func (cfg *Config) Init(ctx context.Context, hashFS *hashfs.HashFS, buildPath *build.Path) (string, error)

Init initializes config by running `init`.

func (*Config) UpdateFilegroups

func (cfg *Config) UpdateFilegroups(ctx context.Context, hashFS *hashfs.HashFS, buildPath *build.Path, filegroups Filegroups) (Filegroups, error)

UpdateFilegroups returns updated filegroups. It takes cached filegroups that were generated by the previous build. When a given filegroup is valid, it is reused. Otherwise, gets the file list by the filegroup operation. e.g. glob.

type Filegroups

type Filegroups struct {
	// Etags are opaque identifiers map by label.
	// Each etag is assigned to specific version of a filegroup
	// for the label.
	ETags map[string]string `json:"etags"`

	// Filegroups are filegroup's map by label.
	// It can be used to ninjabuild.InputDeps as is.
	Filegroups map[string][]string `json:"filegroups"`
}

Filegroups is serialized filegoups information for cache.

type HandlerError

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

HandlerError is error of handler.

func (HandlerError) Backtrace

func (e HandlerError) Backtrace() string

func (HandlerError) Error

func (e HandlerError) Error() string

func (HandlerError) Unwrap

func (e HandlerError) Unwrap() error

Jump to

Keyboard shortcuts

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