build

package
v2.0.0-alpha.45 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

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

Build the project!

func GetModeAsString

func GetModeAsString(mode Mode) string

GetModeAsString returns the current mode as a string

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) ExtractAssets

func (b *BaseBuilder) ExtractAssets() (*html.AssetBundle, error)

ExtractAssets gets the assets from the index.html file

func (*BaseBuilder) NpmInstall

func (b *BaseBuilder) NpmInstall(sourceDir string) error

NpmInstall runs "npm install" in the given directory

func (*BaseBuilder) NpmInstallUsingCommand

func (b *BaseBuilder) NpmInstallUsingCommand(sourceDir string, installCommand string) 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) 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
	BuildRuntime(*Options) error
	CompileProject(*Options) error
	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

func (*DesktopBuilder) BuildBaseAssets

func (d *DesktopBuilder) BuildBaseAssets(assets *html.AssetBundle, options *Options) error

BuildBaseAssets builds the assets for the desktop application

func (*DesktopBuilder) BuildRuntime

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

BuildRuntime builds the Wails javascript runtime and then converts it into a C file

type HybridBuilder

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

HybridBuilder builds applications as a server

func (*HybridBuilder) BuildAssets

func (b *HybridBuilder) BuildAssets(options *Options) error

BuildAssets builds the assets for the desktop application

func (*HybridBuilder) BuildBaseAssets

func (b *HybridBuilder) BuildBaseAssets(options *Options) error

BuildAssets builds the assets for the desktop application

func (*HybridBuilder) BuildFrontend

func (b *HybridBuilder) BuildFrontend(_ *clilogger.CLILogger) error

BuildFrontend builds the assets for the desktop application

func (*HybridBuilder) BuildRuntime

func (b *HybridBuilder) BuildRuntime(options *Options) error

func (*HybridBuilder) CleanUp

func (b *HybridBuilder) CleanUp()

func (*HybridBuilder) CompileProject

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

func (*HybridBuilder) SetProjectData

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

type Mode

type Mode int

Mode is the type used to indicate the build modes

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

type Options

type Options struct {
	LDFlags        string               // Optional flags to pass to linker
	Logger         *clilogger.CLILogger // All output to the logger
	OutputType     string               // EG: desktop, server....
	Mode           Mode                 // release or debug
	ProjectData    *project.Project     // The project data
	Pack           bool                 // Create a package for the app after building
	Platform       string               // The platform to build for
	Compiler       string               // The compiler command to use
	IgnoreFrontend bool                 // Indicates if the frontend does not need building
	OutputFile     string               // Override the output filename
	BuildDirectory string               // Directory to use for building the application
	CompiledBinary string               // Fully qualified path to the compiled binary
	KeepAssets     bool                 // /Keep the generated assets/files
	AppleIdentity  string
}

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

type ServerBuilder

type ServerBuilder struct {
	*BaseBuilder
}

ServerBuilder builds applications as a server

func (*ServerBuilder) BuildAssets

func (s *ServerBuilder) BuildAssets(_ *Options) error

BuildAssets builds the assets for the desktop application

func (*ServerBuilder) BuildBaseAssets

func (s *ServerBuilder) BuildBaseAssets(assets *html.AssetBundle) error

BuildBaseAssets builds the base assets

func (*ServerBuilder) BuildRuntime

func (s *ServerBuilder) BuildRuntime(options *Options) error

BuildRuntime builds the javascript runtime used by the HTML client to connect to the websocket

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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