project

package
v2.5.17 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 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

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

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"`
}

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"`

	// 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 forwared 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"`

	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

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

Parse the given JSON data into a Project struct

func (*Project) GetBuildDir

func (p *Project) GetBuildDir() string

func (*Project) GetDevBuildCommand

func (p *Project) GetDevBuildCommand() string

func (*Project) GetDevInstallerCommand

func (p *Project) GetDevInstallerCommand() string

func (*Project) GetFrontendDir

func (p *Project) GetFrontendDir() string

func (*Project) GetWailsJSDir

func (p *Project) GetWailsJSDir() string

func (*Project) IsFrontendDevServerURLAutoDiscovery

func (p *Project) IsFrontendDevServerURLAutoDiscovery() bool

func (*Project) Save

func (p *Project) Save() error

type TsGeneration

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

Jump to

Keyboard shortcuts

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