build

package
v2.0.0-...-21d7e90 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERBOSE int = 2
)

Variables

This section is empty.

Functions

func Build

func Build(options *Options) (string, error)

Build the project!

func GenerateNSISInstaller

func GenerateNSISInstaller(options *Options, amd64Binary string, arm64Binary string) error

Types

type BaseBuilder

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

BaseBuilder is the common builder struct

func NewBaseBuilder

func NewBaseBuilder(options *Options) *BaseBuilder

NewBaseBuilder creates a new BaseBuilder

func (*BaseBuilder) BuildFrontend

func (b *BaseBuilder) BuildFrontend(outputLogger *clilogger.CLILogger) error

BuildFrontend executes the `npm build` command for the frontend directory

func (*BaseBuilder) CleanUp

func (b *BaseBuilder) CleanUp()

CleanUp does post-build housekeeping

func (*BaseBuilder) CompileProject

func (b *BaseBuilder) CompileProject(options *Options) error

CompileProject compiles the project

func (*BaseBuilder) NpmInstall

func (b *BaseBuilder) NpmInstall(sourceDir string, verbose bool) error

NpmInstall runs "npm install" in the given directory

func (*BaseBuilder) NpmInstallUsingCommand

func (b *BaseBuilder) NpmInstallUsingCommand(sourceDir string, installCommand string, verbose bool) error

NpmInstallUsingCommand runs the given install command in the specified npm project directory

func (*BaseBuilder) NpmRun

func (b *BaseBuilder) NpmRun(projectDir, buildTarget string, verbose bool) error

NpmRun executes the npm target in the provided directory

func (*BaseBuilder) NpmRunWithEnvironment

func (b *BaseBuilder) NpmRunWithEnvironment(projectDir, buildTarget string, verbose bool, envvars []string) error

NpmRunWithEnvironment executes the npm target in the provided directory, with the given environment variables

func (*BaseBuilder) OutputFilename

func (b *BaseBuilder) OutputFilename(options *Options) string

func (*BaseBuilder) SetProjectData

func (b *BaseBuilder) SetProjectData(projectData *project.Project)

SetProjectData sets the project data for this builder

type Builder

type Builder interface {
	SetProjectData(projectData *project.Project)
	BuildAssets(*Options) error
	BuildFrontend(*clilogger.CLILogger) error
	CompileProject(*Options) error
	OutputFilename(*Options) string
	CleanUp()
}

Builder defines a builder that can build Wails applications

type DesktopBuilder

type DesktopBuilder struct {
	*BaseBuilder
}

DesktopBuilder builds applications for the desktop

func (*DesktopBuilder) BuildAssets

func (d *DesktopBuilder) BuildAssets(options *Options) error

BuildAssets builds the assets for the desktop application

type Mode

type Mode int

Mode is the type used to indicate the build modes

const (
	// Dev mode
	Dev Mode = iota
	// Production mode
	Production
	// Debug build
	Debug
)

type Options

type Options struct {
	LDFlags             string               // Optional flags to pass to linker
	UserTags            []string             // Tags to pass to the Go compiler
	Logger              *clilogger.CLILogger // All output to the logger
	OutputType          string               // EG: desktop, server....
	Mode                Mode                 // release or dev
	ProjectData         *project.Project     // The project data
	Pack                bool                 // Create a package for the app after building
	Platform            string               // The platform to build for
	Arch                string               // The architecture to build for
	Compiler            string               // The compiler command to use
	SkipModTidy         bool                 //  Skip mod tidy before compile
	IgnoreFrontend      bool                 // Indicates if the frontend does not need building
	IgnoreApplication   bool                 // Indicates if the application does not need building
	OutputFile          string               // Override the output filename
	BuildDirectory      string               // Directory to use for building the application
	CleanBuildDirectory bool                 // Indicates if the build directory should be cleaned before building
	CompiledBinary      string               // Fully qualified path to the compiled binary
	KeepAssets          bool                 // Keep the generated assets/files
	Verbosity           int                  // Verbosity level (0 - silent, 1 - default, 2 - verbose)
	Compress            bool                 // Compress the final binary
	CompressFlags       string               // Flags to pass to UPX
	WebView2Strategy    string               // WebView2 installer strategy
	RunDelve            bool                 // Indicates if we should run delve after the build
	WailsJSDir          string               // Directory to generate the wailsjs module
	ForceBuild          bool                 // Force
	BundleName          string               // Bundlename for Mac
	TrimPath            bool                 // Use Go's trimpath compiler flag
	RaceDetector        bool                 // Build with Go's race detector
	WindowsConsole      bool                 // Indicates that the windows console should be kept
	Obfuscate           bool                 // Indicates that bound methods should be obfuscated
	GarbleArgs          string               // The arguments for Garble
}

Options contains all the build options as well as the project data

Jump to

Keyboard shortcuts

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