Documentation
¶
Overview ¶
Package goals provides tools for working with plugin goals and defining the built-in goals.
Index ¶
- Constants
- Variables
- func ExportPropertyName(ctx context.Context, propertyName string)
- func GetPropertyInfoOutputAll(ctx context.Context) bool
- func GetPropertyInfoOutputFormat(ctx context.Context) string
- func GetPropertyInfoVersion(ctx context.Context) string
- func GetPropertyLintPreRelease(ctx context.Context) bool
- func GetPropertyLintRelease(ctx context.Context) bool
- func GetPropertyReleaseDate(ctx context.Context) time.Time
- func GetPropertyReleaseDescription(ctx context.Context) string
- func GetPropertyReleaseTag(ctx context.Context) (string, error)
- func GetPropertyReleaseVersion(ctx context.Context) (string, error)
- func SetPropertyLintPreRelease(ctx context.Context, value bool)
- func SetPropertyLintRelease(ctx context.Context, value bool)
- func SetPropertyReleaseDate(ctx context.Context, date time.Time)
- func SetPropertyReleaseDescription(ctx context.Context, description string)
- func SetPropertyReleaseVersion(ctx context.Context, version string)
- func WriteOutProperties(w io.Writer, values storage.KV) error
- func WriteOutYaml(w io.Writer, values storage.KV) error
- type GoalDescription
- func DescribeBuild() *GoalDescription
- func DescribeDeploy() *GoalDescription
- func DescribeGenerate() *GoalDescription
- func DescribeInfo() *GoalDescription
- func DescribeInit() *GoalDescription
- func DescribeInstall() *GoalDescription
- func DescribeLint() *GoalDescription
- func DescribeRelease() *GoalDescription
- func DescribeRequest() *GoalDescription
- func DescribeTest() *GoalDescription
- func NewGoalDescription(name, short string, aliases ...string) *GoalDescription
- type OutputFormatter
- type TaskDescription
Constants ¶
const ( NameBuild = "build" NameDeploy = "deploy" NameGenerate = "generate" NameInfo = "info" NameInit = "init" NameInstall = "install" NameLint = "lint" NameRelease = "release" NameRequest = "request" NameTest = "test" )
const ( PropertyReleaseTagPrefix = "v" PropertyExportPrefix = storage.ExportPrefix PropertyReleaseDescription = "release.description" PropertyReleaseVersion = "release.version" PropertyReleaseDate = "release.date" PropertyReleaseTag = "release.tag" PropertyLintPreRelease = "lint.prerelease" PropertyLintRelease = "lint.release" PropertyInfoVersion = "info.version" PropertyInfoOutputFormat = "info.outputFormat" PropertyInfoOutputAll = "info.outputAll" DefaultInfoOutputFormat = "properties" )
Variables ¶
var DefaultInfoOutputFormatter = WriteOutProperties
DefaultInfoOutputFormatter is the default output format.
var OutputFormats = map[string]OutputFormatter{ "properties": WriteOutProperties, "yaml": WriteOutYaml, }
OutputFormats defines the available output formats.
Functions ¶
func ExportPropertyName ¶
ExportPropertyName sets the given property name with the PropertyExprotPrefix so that it will be rendered by the /info/display task when the info goal is complete.
func GetPropertyInfoOutputAll ¶
GetPropertyInfoOutputAll returns the value of info.outputAll.
func GetPropertyInfoOutputFormat ¶
GetPropertyInfoOutputFormat returns the value of info.outputFormat. If not found, this will return DefaultInfoOutputFormat.
func GetPropertyInfoVersion ¶
GetPropertyInfoVersion returns the value of info.version.
func GetPropertyLintPreRelease ¶
GetPropertyLintPreRelease gets the lint.prerelease property.
func GetPropertyLintRelease ¶
GetPropertyLintRelease gets the lint.release property.
func GetPropertyReleaseDate ¶
GetPropertyReleaseDate gets the value of release.date.
func GetPropertyReleaseDescription ¶
GetPropertyReleaseDescription returns the value of release.description.
func GetPropertyReleaseTag ¶ added in v0.1.0
GetPropertyReleaseTag gets the release.tag property.
func GetPropertyReleaseVersion ¶
GetPropertyReleaseVersion gets the value of release.version.
func SetPropertyLintPreRelease ¶
SetPropertyLintPreRelease sets the lint.prerelease property.
func SetPropertyLintRelease ¶
SetPropertyLintRelease sets the lint.release property.
func SetPropertyReleaseDate ¶
SetPropertyReleaseDate sets the value of release.date.
func SetPropertyReleaseDescription ¶
SetPropertyReleaseDescription sets the release.description property to the given description.
func SetPropertyReleaseVersion ¶
SetPropertyReleaseVersion sets the value of release.version.
func WriteOutProperties ¶
WriteOutProperties outputs the given storage values as a properties list.
Types ¶
type GoalDescription ¶
type GoalDescription struct {
// contains filtered or unexported fields
}
GoalDescription provides a generic, concrete implementation of plugin.GoalDescription.
func DescribeBuild ¶
func DescribeBuild() *GoalDescription
DescribeBuild describes the build goal, which is primarily aimed at checking syntax of source files.
func DescribeDeploy ¶
func DescribeDeploy() *GoalDescription
DescribeDeploy describes the deploy goal, which is aimed at saving or pushing artifacts prior to release.
func DescribeGenerate ¶
func DescribeGenerate() *GoalDescription
DescribeGenerate describes the generate goal, which handles generated source code from other source code annotations and templates.
func DescribeInfo ¶
func DescribeInfo() *GoalDescription
DescribeInfo describes the info goal, which is used to extract data from zedpm for informational purposes or for use with outside tooling.
func DescribeInit ¶
func DescribeInit() *GoalDescription
DescribeInit describes the init goal, which performs functions to initialize new projects.
func DescribeInstall ¶
func DescribeInstall() *GoalDescription
DescribeInstall describes the install goal, which installs artifacts onto the developer's local system.
func DescribeLint ¶
func DescribeLint() *GoalDescription
DescribeLint describes the lint goal, which performs analysis of files to check for errors and identify anti-patterns.
func DescribeRelease ¶
func DescribeRelease() *GoalDescription
DescribeRelease describes the release goal, which performs the action of releasing a new software version.
func DescribeRequest ¶
func DescribeRequest() *GoalDescription
DescribeRequest describes the request goal, which provides tooling for creating pull-request/merge-request type operations.
func DescribeTest ¶
func DescribeTest() *GoalDescription
DescribeTest describes the test goal, which performs the action of testing that the software is working correctly.
func NewGoalDescription ¶
func NewGoalDescription(name, short string, aliases ...string) *GoalDescription
NewGoalDescription constructs a new GoalDescription.
func (*GoalDescription) Aliases ¶
func (g *GoalDescription) Aliases() []string
Aliases returns zero or more alternate names for this goal.
func (*GoalDescription) Name ¶
func (g *GoalDescription) Name() string
Name returns the name of the goal.
func (*GoalDescription) Short ¶
func (g *GoalDescription) Short() string
Short returns a short description of the goal.
func (*GoalDescription) Task ¶
func (g *GoalDescription) Task(phaseName, taskName, short string, requires ...string) *TaskDescription
Task creates a TaskDescription as a sub-task of this goal.
func (*GoalDescription) TaskName ¶
func (g *GoalDescription) TaskName(phaseName, taskName string) string
TaskName returns the goal as a task path.
type OutputFormatter ¶
OutputFormatter is a function that can output a storage.KV to the given io.Writer.
func InfoOutputFormatter ¶
func InfoOutputFormatter(ctx context.Context) OutputFormatter
InfoOutputFormatter tries to determine which output formatter to use based upon the info.outputFormat property. If the property is not set or set to an invalid value, this will return DefaultInfoOutputFormatter.
type TaskDescription ¶
type TaskDescription struct {
// contains filtered or unexported fields
}
TaskDescription is a generic implementation of plugin.TaskDescription.
func NewTaskDescription ¶
func NewTaskDescription(name, short string, requires []string) *TaskDescription
NewTaskDescription constructs a new TaskDescription.
func (*TaskDescription) Name ¶
func (t *TaskDescription) Name() string
Name is the task path of the task described.
func (*TaskDescription) Requires ¶
func (t *TaskDescription) Requires() []string
Requires is a list of zero or more task paths that this task requires to run prior to the current task.
func (*TaskDescription) Short ¶
func (t *TaskDescription) Short() string
Short is a short description of the task.