build

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EvtBuildStart is emitted when building starts
	EvtBuildStart = "buffalo:build:start"
	// EvtBuildStop is emitted when building stops
	EvtBuildStop = "buffalo:build:stop"
	// EvtBuildStopErr is emitted when building is stopped due to an error
	EvtBuildStopErr = "buffalo:build:stop:err"
)

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(opts *Options) genny.RunFn

Cleanup all of the generated files

func GoTemplateValidator

func GoTemplateValidator(f genny.File) error

GoTemplateValidator validates the file is a valid Go text/template file if the extension is .tmpl

func New

func New(opts *Options) (*genny.Generator, error)

New generator for building a Buffalo application This powers the `buffalo build` command and can be used to programatically build/compile Buffalo applications.

func PlushValidator

func PlushValidator(f genny.File) error

PlushValidator validates the file is a valid Plush file if the extension is .md, .html, or .plush

func ValidateTemplates

func ValidateTemplates(walk packd.Walker, tvs []TemplateValidator) genny.RunFn

ValidateTemplates returns a genny.RunFn that will walk the given box and run each of the files found through each of the template validators

Types

type Options

type Options struct {
	meta.App
	// the "timestamp" of the build. defaults to time.Now()
	BuildTime time.Time `json:"build_time,omitempty"`
	// the "version" of the build. defaults to
	// a) git sha of last commit or
	// b) to time.RFC3339 of BuildTime
	BuildVersion string `json:"build_version,omitempty"`
	// CleanAssets will remove the public/assets folder build compiling
	CleanAssets   bool `json:"clean_assets"`
	WithAssets    bool `json:"with_assets,omitempty"`
	WithBuildDeps bool `json:"with_build_deps,omitempty"`
	// places ./public/assets into ./bin/assets.zip.
	// requires WithAssets = true
	ExtractAssets bool `json:"extract_assets,omitempty"`
	// LDFlags to be passed to the final `go build` command
	LDFlags string `json:"ld_flags,omitempty"`
	// Tags to be passed to the final `go build` command
	Tags meta.BuildTags `json:"tags,omitempty"`
	// BuildFlags to be passed to the final `go build` command
	BuildFlags []string `json:"build_flags,omitempty"`
	// Static sets the following flags for the final `go build` command:
	// -linkmode external
	// -extldflags "-static"
	Static bool `json:"static,omitempty"`
	// Environment the binary is meant for. defaults to "development"
	Environment string `json:"environment,omitempty"`
	// TemplateValidators can be used to validate the applications templates.
	// Empty by default
	TemplateValidators []TemplateValidator `json:"-"`
	// Mod is the -mod flag
	Mod string `json:"mod"`
	// GoCommand is the `go X` command to be used. Default is "build".
	GoCommand string `json:"go_command"`
	// contains filtered or unexported fields
}

Options for building a Buffalo application

func (*Options) Validate

func (opts *Options) Validate() error

Validate that options are usuable

type TemplateValidator

type TemplateValidator func(f genny.File) error

TemplateValidator is given a file and returns an effort if there is a template validation error with the template

Directories

Path Synopsis
_fixtures

Jump to

Keyboard shortcuts

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