Documentation
¶
Index ¶
- Constants
- func Build(options *Options) (string, error)
- func GenerateNSISInstaller(options *Options, amd64Binary string, arm64Binary string) error
- type BaseBuilder
- func (b *BaseBuilder) BuildFrontend(outputLogger *clilogger.CLILogger) error
- func (b *BaseBuilder) CleanUp()
- func (b *BaseBuilder) CompileProject(options *Options) error
- func (b *BaseBuilder) NpmInstall(sourceDir string, verbose bool) error
- func (b *BaseBuilder) NpmInstallUsingCommand(sourceDir string, installCommand string, verbose bool) error
- func (b *BaseBuilder) NpmRun(projectDir, buildTarget string, verbose bool) error
- func (b *BaseBuilder) NpmRunWithEnvironment(projectDir, buildTarget string, verbose bool, envvars []string) error
- func (b *BaseBuilder) OutputFilename(options *Options) string
- func (b *BaseBuilder) SetProjectData(projectData *project.Project)
- type Builder
- type DesktopBuilder
- type Mode
- type Options
Constants ¶
const (
VERBOSE int = 2
)
Variables ¶
This section is empty.
Functions ¶
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) 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 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