Documentation ¶
Index ¶
- func Build(options *Options) (string, error)
- func GetModeAsString(mode Mode) string
- type BaseBuilder
- func (b *BaseBuilder) BuildFrontend(outputLogger *clilogger.CLILogger) error
- func (b *BaseBuilder) CleanUp()
- func (b *BaseBuilder) CompileProject(options *Options) error
- func (b *BaseBuilder) ExtractAssets() (*html.AssetBundle, error)
- func (b *BaseBuilder) NpmInstall(sourceDir string) error
- func (b *BaseBuilder) NpmInstallUsingCommand(sourceDir string, installCommand string) 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) SetProjectData(projectData *project.Project)
- type Builder
- type DesktopBuilder
- type HybridBuilder
- func (b *HybridBuilder) BuildAssets(options *Options) error
- func (b *HybridBuilder) BuildBaseAssets(options *Options) error
- func (b *HybridBuilder) BuildFrontend(_ *clilogger.CLILogger) error
- func (b *HybridBuilder) BuildRuntime(options *Options) error
- func (b *HybridBuilder) CleanUp()
- func (b *HybridBuilder) CompileProject(options *Options) error
- func (b *HybridBuilder) SetProjectData(projectData *project.Project)
- type Mode
- type Options
- type ServerBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetModeAsString ¶
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) 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 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 }
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