buffalo: github.com/gobuffalo/buffalo/genny/build Index | Files | Directories

package build

import "github.com/gobuffalo/buffalo/genny/build"

You can use the "packr clean" command to clean up this, and any other packr generated files.


Package Files

apkg.go archived_assets.go assets.go bin.go build-packr.go build.go build_deps.go cleanup.go events.go options.go template_walker.go transform_main.go validate.go


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"

func Cleanup Uses

func Cleanup(opts *Options) genny.RunFn

Cleanup all of the generated files

func GoTemplateValidator Uses

func GoTemplateValidator(f genny.File) error

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

func New Uses

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 Uses

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 Uses

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

type Options Uses

type Options struct {
    // 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 Uses

func (opts *Options) Validate() error

Validate that options are usuable

type TemplateValidator Uses

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



Package build imports 30 packages (graph) and is imported by 4 packages. Updated 2019-11-07. Refresh now. Tools for package owners.