builder

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package builder implements launchr functionality to build itself.

Package builder implements a plugin to build launchr with plugins.

Index

Constants

View Source
const ID = "builder"

ID is a plugin id.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context, flags *builderInput) error

Execute runs launchr and executes build of launchr.

Types

type BuildOptions

type BuildOptions struct {
	LaunchrVersion *launchr.AppVersion
	CorePkg        UsePluginInfo
	PkgName        string
	ModReplace     map[string]string
	Plugins        []UsePluginInfo
	BuildOutput    string
	Debug          bool
}

BuildOptions stores launchr build parameters.

func (*BuildOptions) Validate added in v0.0.6

func (opts *BuildOptions) Validate() error

Validate verifies build options.

type Builder

type Builder struct {
	*BuildOptions
	// contains filtered or unexported fields
}

Builder is the orchestrator to fetch dependencies and build launchr.

func NewBuilder

func NewBuilder(opts *BuildOptions) (*Builder, error)

NewBuilder creates build environment.

func (*Builder) Build

func (b *Builder) Build(ctx context.Context) error

Build prepares build environment, generates go files and build the binary.

func (*Builder) Close

func (b *Builder) Close() error

Close does cleanup after build.

type Plugin

type Plugin struct {
}

Plugin is a plugin to build launchr application.

func (*Plugin) CobraAddCommands

func (p *Plugin) CobraAddCommands(rootCmd *cobra.Command) error

CobraAddCommands implements launchr.CobraPlugin interface to provide build functionality.

func (*Plugin) InitApp

func (p *Plugin) InitApp(*launchr.App) error

InitApp implements launchr.Plugin interface.

func (*Plugin) PluginInfo

func (p *Plugin) PluginInfo() launchr.PluginInfo

PluginInfo implements launchr.Plugin interface.

type ReplacePluginInfo added in v0.0.6

type ReplacePluginInfo struct {
	Path    string
	Version string
}

ReplacePluginInfo has mod replace information.

type UsePluginInfo

type UsePluginInfo struct {
	Path    string
	Version string
	Replace ReplacePluginInfo
}

UsePluginInfo stores plugin info.

func UsePluginInfoFromString added in v0.0.6

func UsePluginInfoFromString(s string) UsePluginInfo

UsePluginInfoFromString constructs mod plugin info.

func (UsePluginInfo) GetVersion added in v0.0.6

func (p UsePluginInfo) GetVersion() string

GetVersion returns package version.

func (UsePluginInfo) GoGetString added in v0.0.3

func (p UsePluginInfo) GoGetString() string

GoGetString provides a package path for a go get.

func (UsePluginInfo) String

func (p UsePluginInfo) String() string

Jump to

Keyboard shortcuts

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