Help us shape the future of Go! Take the 2026 Go Developer Survey

project

package
v2.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

Author stores details about the application author

type Bindings added in v2.3.0

type Bindings struct {
	TsGeneration TsGeneration `json:"ts_generation"`
}

type FileAssociation added in v2.7.0

type FileAssociation struct {
	Ext         string `json:"ext"`
	Name        string `json:"name"`
	Description string `json:"description"`
	IconName    string `json:"iconName"`
	Role        string `json:"role"`
}

type Info

type Info struct {
	CompanyName      string            `json:"companyName"`
	ProductName      string            `json:"productName"`
	ProductVersion   string            `json:"productVersion"`
	Copyright        *string           `json:"copyright"`
	Comments         *string           `json:"comments"`
	FileAssociations []FileAssociation `json:"fileAssociations"`
	Protocols        []Protocol        `json:"protocols"`
}

type Project

type Project struct {
	/*** Application Data ***/
	Name           string `json:"name"`
	AssetDirectory string `json:"assetdir,omitempty"`

	ReloadDirectories string `json:"reloaddirs,omitempty"`

	BuildCommand   string `json:"frontend:build"`
	InstallCommand string `json:"frontend:install"`

	// Commands used in `wails dev`
	DevCommand        string `json:"frontend:dev"`
	DevBuildCommand   string `json:"frontend:dev:build"`
	DevInstallCommand string `json:"frontend:dev:install"`
	DevWatcherCommand string `json:"frontend:dev:watcher"`
	// The url of the external wails dev server. If this is set, this server is used for the frontend. Default ""
	FrontendDevServerURL string `json:"frontend:dev:serverUrl"`

	// Directory to generate the API Module
	WailsJSDir string `json:"wailsjsdir"`

	Version string `json:"version"`

	// The path to the project directory
	Path string `json:"projectdir"`

	// Build directory
	BuildDir string `json:"build:dir"`

	// BuildTags Extra tags to process during build
	BuildTags string `json:"build:tags"`

	// The output filename
	OutputFilename string `json:"outputfilename"`

	// The type of application. EG: Desktop, Server, etc
	OutputType string

	// The platform to target
	Platform string

	// RunNonNativeBuildHooks will run build hooks though they are defined for a GOOS which is not equal to the host os
	RunNonNativeBuildHooks bool `json:"runNonNativeBuildHooks"`

	// Build hooks for different targets, the hooks are executed in the following order
	// Key: GOOS/GOARCH - Executed at build level before/after a build of the specific platform and arch
	// Key: GOOS/*      - Executed at build level before/after a build of the specific platform
	// Key: */*         - Executed at build level before/after a build
	// The following keys are not yet supported.
	// Key: GOOS        - Executed at platform level before/after all builds of the specific platform
	// Key: *           - Executed at platform level before/after all builds of a platform
	// Key: [empty]     - Executed at global level before/after all builds of all platforms
	PostBuildHooks map[string]string `json:"postBuildHooks"`
	PreBuildHooks  map[string]string `json:"preBuildHooks"`

	// The application author
	Author Author

	// The application information
	Info Info

	// The debounce time for hot-reload of the built-in dev server. Default 100
	DebounceMS int `json:"debounceMS"`

	// The address to bind the wails dev server to. Default "localhost:34115"
	DevServer string `json:"devServer"`

	// Arguments that are forward to the application in dev mode
	AppArgs string `json:"appargs"`

	// NSISType to be build
	NSISType string `json:"nsisType"`

	// Garble
	Obfuscated bool   `json:"obfuscated"`
	GarbleArgs string `json:"garbleargs"`

	// Frontend directory
	FrontendDir string `json:"frontend:dir"`

	// The timeout in seconds for Vite server detection. Default 10
	ViteServerTimeout int `json:"viteServerTimeout"`

	Bindings Bindings `json:"bindings"`
	// contains filtered or unexported fields
}

Project holds the data related to a Wails project

func Load

func Load(projectPath string) (*Project, error)

Load the project from the current working directory

func Parse added in v2.2.0

func Parse(projectData []byte) (*Project, error)

Parse the given JSON data into a Project struct

func (*Project) GetBuildDir added in v2.2.0

func (p *Project) GetBuildDir() string

func (*Project) GetDevBuildCommand

func (p *Project) GetDevBuildCommand() string

func (*Project) GetDevInstallerCommand

func (p *Project) GetDevInstallerCommand() string

func (*Project) GetFrontendDir added in v2.2.0

func (p *Project) GetFrontendDir() string

func (*Project) GetWailsJSDir added in v2.2.0

func (p *Project) GetWailsJSDir() string

func (*Project) IsFrontendDevServerURLAutoDiscovery

func (p *Project) IsFrontendDevServerURLAutoDiscovery() bool

func (*Project) Save

func (p *Project) Save() error

type Protocol added in v2.7.0

type Protocol struct {
	Scheme      string `json:"scheme"`
	Description string `json:"description"`
	Role        string `json:"role"`
}

type TsGeneration added in v2.3.0

type TsGeneration struct {
	Prefix     string `json:"prefix"`
	Suffix     string `json:"suffix"`
	OutputType string `json:"outputType"`
}

Jump to

Keyboard shortcuts

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