typbuildtool

package
v0.9.50 Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultReleaseFolder is default value for release folder location
	DefaultReleaseFolder = "release"

	// DefaultBinFolder is default value for bin folder
	DefaultBinFolder = "bin"

	// DefaultCmdFolder is default value for cmd folder
	DefaultCmdFolder = "cmd"

	// DefaultConfigFile is default config file path
	DefaultConfigFile = ".env"

	// DefaultEnablePrecondition is default precondition flag
	DefaultEnablePrecondition = true

	// Linux as releast target
	Linux ReleaseTarget = "linux/amd64"

	// Darwin as releast target
	Darwin ReleaseTarget = "darwin/amd64"
)

Functions

func Publish added in v0.9.50

func Publish(c *CliContext) (err error)

Publish project

Types

type BuildTool added in v0.9.33

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

BuildTool is typical Build Tool for golang project

func BuildSequences added in v0.9.45

func BuildSequences(buildSequences ...interface{}) *BuildTool

BuildSequences create new instance of BuildTool with build-sequence

func (*BuildTool) Commands added in v0.9.36

func (b *BuildTool) Commands(c *Context) (cmds []*cli.Command)

Commands to return command

func (*BuildTool) Configurations added in v0.9.48

func (b *BuildTool) Configurations() (cfgs []*typcfg.Configuration)

Configurations of Build-Tool

func (*BuildTool) EnablePrecondition added in v0.9.48

func (b *BuildTool) EnablePrecondition(enablePrecondition bool) *BuildTool

EnablePrecondition define whether execute precondition or not. By default if true

func (*BuildTool) Precondition added in v0.9.47

func (b *BuildTool) Precondition(c *PreconditionContext) (err error)

Precondition for this project

func (*BuildTool) RunBuildTool added in v0.9.47

func (b *BuildTool) RunBuildTool(c *typcore.Context) (err error)

RunBuildTool to run the build-tool

func (*BuildTool) Utilities added in v0.9.48

func (b *BuildTool) Utilities(utilities ...Utility) *BuildTool

Utilities return build-tool with new utilities

func (*BuildTool) Validate added in v0.9.33

func (b *BuildTool) Validate() (err error)

Validate build

type Cleaner added in v0.9.38

type Cleaner interface {
	Clean(*CliContext) error
}

Cleaner responsible to clean the project

type CliContext added in v0.9.50

type CliContext struct {
	*cli.Context
	typlog.Logger
	Name      string
	Core      *typcore.Context
	BuildTool *BuildTool
}

CliContext is context of build

type CliFunc added in v0.9.50

type CliFunc func(*CliContext) error

CliFunc is command line function

type Context added in v0.9.36

type Context struct {
	*BuildTool
	Core *typcore.Context
}

Context of buildtool

func (*Context) ActionFunc added in v0.9.36

func (c *Context) ActionFunc(name string, fn CliFunc) func(*cli.Context) error

ActionFunc to return related action func

type GithubModule added in v0.9.43

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

GithubModule publisher

func Github added in v0.9.38

func Github(owner, repo string) *GithubModule

Github module

func (*GithubModule) Filter added in v0.9.48

func (g *GithubModule) Filter(filter ReleaseFilter) *GithubModule

Filter define filter message

func (*GithubModule) Publish added in v0.9.43

func (g *GithubModule) Publish(c *PublishContext) (err error)

Publish to github

func (*GithubModule) ReleaseFilter added in v0.9.43

func (g *GithubModule) ReleaseFilter(msg string) string

ReleaseFilter to filter the message

type NoPrefixFilter added in v0.9.38

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

NoPrefixFilter is filter no-prefix

func DefaultNoPrefix added in v0.9.38

func DefaultNoPrefix() *NoPrefixFilter

DefaultNoPrefix return filter with no-prefix

func NoPrefix added in v0.9.38

func NoPrefix(prefixes ...string) *NoPrefixFilter

NoPrefix return filter with no-prefix

func (*NoPrefixFilter) Append added in v0.9.38

func (f *NoPrefixFilter) Append(prefixes ...string) *NoPrefixFilter

Append to return NoPrefixFilter with appended prefix

func (*NoPrefixFilter) ReleaseFilter added in v0.9.38

func (f *NoPrefixFilter) ReleaseFilter(msg string) string

ReleaseFilter to filter the messages

type PreconditionContext added in v0.9.50

type PreconditionContext struct {
	typtmpl.Precond
	Logger typlog.Logger
	Core   *typcore.Context
	Ctx    context.Context
	// contains filtered or unexported fields
}

PreconditionContext is context of preconditioning

func (*PreconditionContext) ASTStore added in v0.9.50

func (c *PreconditionContext) ASTStore() *typast.ASTStore

ASTStore return the ast store

func (*PreconditionContext) Info added in v0.9.50

func (c *PreconditionContext) Info(args ...interface{})

Info logger

func (*PreconditionContext) Infof added in v0.9.50

func (c *PreconditionContext) Infof(format string, args ...interface{})

Infof logger

func (*PreconditionContext) SetASTStore added in v0.9.50

func (c *PreconditionContext) SetASTStore(astStore *typast.ASTStore)

SetASTStore to set ast store

func (*PreconditionContext) Warn added in v0.9.50

func (c *PreconditionContext) Warn(args ...interface{})

Warn logger

func (*PreconditionContext) Warnf added in v0.9.50

func (c *PreconditionContext) Warnf(format string, args ...interface{})

Warnf logger

type Preconditioner added in v0.9.42

type Preconditioner interface {
	Precondition(c *PreconditionContext) error
}

Preconditioner responsible to precondition

type PublishContext added in v0.9.38

type PublishContext struct {
	*ReleaseContext
	ReleaseFiles []string
}

PublishContext is context of publish

type Publisher added in v0.9.38

type Publisher interface {
	Publish(*PublishContext) error
}

Publisher responsible to publish the release to external source

type ReleaseContext added in v0.9.38

type ReleaseContext struct {
	*CliContext
	Alpha   bool
	Tag     string
	GitLogs []*git.Log
}

ReleaseContext is context of release

type ReleaseFilter added in v0.9.38

type ReleaseFilter interface {
	ReleaseFilter(string) string
}

ReleaseFilter responsible to filter the commit message

type ReleaseTarget added in v0.9.38

type ReleaseTarget string

ReleaseTarget contain OS and Arch as target of release operation

func (ReleaseTarget) Arch added in v0.9.38

func (t ReleaseTarget) Arch() string

Arch return the system architecture information

func (ReleaseTarget) OS added in v0.9.38

func (t ReleaseTarget) OS() string

OS return the operating system information

func (ReleaseTarget) Validate added in v0.9.38

func (t ReleaseTarget) Validate() (err error)

Validate release target

type Releaser added in v0.9.38

type Releaser interface {
	Release(*ReleaseContext) (files []string, err error)
}

Releaser responsible to release

type Runner added in v0.9.49

type Runner interface {
	Run(c *CliContext) error
}

Runner responsible to run the project in local environment

type SimpleUtility added in v0.9.47

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

SimpleUtility return command based on command function

func NewUtility added in v0.9.47

func NewUtility(fn UtilityFn) *SimpleUtility

NewUtility return new instance SimpleUtility

func (*SimpleUtility) Commands added in v0.9.47

func (s *SimpleUtility) Commands(ctx *Context) (cmds []*cli.Command)

Commands return list of command

func (*SimpleUtility) Configurations added in v0.9.48

func (s *SimpleUtility) Configurations() (cfgs []*typcfg.Configuration)

Configurations of utility

func (*SimpleUtility) Configure added in v0.9.48

func (s *SimpleUtility) Configure(configurer typcfg.Configurer) *SimpleUtility

Configure the utility

type StdBuild added in v0.9.49

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

StdBuild is standard build module for go project

func StandardBuild added in v0.9.43

func StandardBuild() *StdBuild

StandardBuild return new instance of Module

func (*StdBuild) Clean added in v0.9.49

func (b *StdBuild) Clean(c *CliContext) (err error)

Clean build result

func (*StdBuild) Release added in v0.9.49

func (b *StdBuild) Release(c *ReleaseContext) (files []string, err error)

Release this project

func (*StdBuild) Run added in v0.9.49

func (b *StdBuild) Run(c *CliContext) (err error)

Run the project locally

func (*StdBuild) Test added in v0.9.49

func (b *StdBuild) Test(c *CliContext) (err error)

Test the project

func (*StdBuild) Validate added in v0.9.49

func (b *StdBuild) Validate() (err error)

Validate the releaser

type Tester added in v0.9.38

type Tester interface {
	Test(*CliContext) error
}

Tester responsible to test the project

type Utility added in v0.9.47

type Utility interface {
	Commands(c *Context) []*cli.Command
}

Utility of build-tool

type UtilityFn added in v0.9.47

type UtilityFn func(ctx *Context) []*cli.Command

UtilityFn is a function to return command

Jump to

Keyboard shortcuts

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