goals

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package goals provides tools for working with plugin goals and defining the built-in goals.

Index

Constants

View Source
const (
	NameBuild    = "build"
	NameDeploy   = "deploy"
	NameGenerate = "generate"
	NameInfo     = "info"
	NameInit     = "init"
	NameInstall  = "install"
	NameLint     = "lint"
	NameRelease  = "release"
	NameRequest  = "request"
	NameTest     = "test"
)
View Source
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

View Source
var DefaultInfoOutputFormatter = WriteOutProperties

DefaultInfoOutputFormatter is the default output format.

View Source
var OutputFormats = map[string]OutputFormatter{
	"properties": WriteOutProperties,
	"yaml":       WriteOutYaml,
}

OutputFormats defines the available output formats.

Functions

func ExportPropertyName

func ExportPropertyName(
	ctx context.Context,
	propertyName string,
)

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

func GetPropertyInfoOutputAll(ctx context.Context) bool

GetPropertyInfoOutputAll returns the value of info.outputAll.

func GetPropertyInfoOutputFormat

func GetPropertyInfoOutputFormat(ctx context.Context) string

GetPropertyInfoOutputFormat returns the value of info.outputFormat. If not found, this will return DefaultInfoOutputFormat.

func GetPropertyInfoVersion

func GetPropertyInfoVersion(ctx context.Context) string

GetPropertyInfoVersion returns the value of info.version.

func GetPropertyLintPreRelease

func GetPropertyLintPreRelease(ctx context.Context) bool

GetPropertyLintPreRelease gets the lint.prerelease property.

func GetPropertyLintRelease

func GetPropertyLintRelease(ctx context.Context) bool

GetPropertyLintRelease gets the lint.release property.

func GetPropertyReleaseDate

func GetPropertyReleaseDate(ctx context.Context) time.Time

GetPropertyReleaseDate gets the value of release.date.

func GetPropertyReleaseDescription

func GetPropertyReleaseDescription(ctx context.Context) string

GetPropertyReleaseDescription returns the value of release.description.

func GetPropertyReleaseTag added in v0.1.0

func GetPropertyReleaseTag(ctx context.Context) (string, error)

GetPropertyReleaseTag gets the release.tag property.

func GetPropertyReleaseVersion

func GetPropertyReleaseVersion(ctx context.Context) (string, error)

GetPropertyReleaseVersion gets the value of release.version.

func SetPropertyLintPreRelease

func SetPropertyLintPreRelease(ctx context.Context, value bool)

SetPropertyLintPreRelease sets the lint.prerelease property.

func SetPropertyLintRelease

func SetPropertyLintRelease(ctx context.Context, value bool)

SetPropertyLintRelease sets the lint.release property.

func SetPropertyReleaseDate

func SetPropertyReleaseDate(ctx context.Context, date time.Time)

SetPropertyReleaseDate sets the value of release.date.

func SetPropertyReleaseDescription

func SetPropertyReleaseDescription(
	ctx context.Context,
	description string,
)

SetPropertyReleaseDescription sets the release.description property to the given description.

func SetPropertyReleaseVersion

func SetPropertyReleaseVersion(ctx context.Context, version string)

SetPropertyReleaseVersion sets the value of release.version.

func WriteOutProperties

func WriteOutProperties(w io.Writer, values storage.KV) error

WriteOutProperties outputs the given storage values as a properties list.

func WriteOutYaml

func WriteOutYaml(w io.Writer, values storage.KV) error

WriteOutYaml outputs the given storage values in YAML format.

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

type OutputFormatter func(io.Writer, storage.KV) error

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.

Jump to

Keyboard shortcuts

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