Documentation ¶
Index ¶
- Constants
- func BuildApplication(binaryName string, forceRebuild bool, buildMode string, packageApp bool, ...) error
- func BuildDocker(binaryName string, buildMode string, projectOptions *ProjectOptions) error
- func BuildFrontend(projectOptions *ProjectOptions) error
- func BuildNative(binaryName string, forceRebuild bool, buildMode string, ...) error
- func CheckDependencies(logger *Logger) (bool, error)
- func CheckDependenciesSilent(logger *Logger) (bool, error)
- func CheckIfInstalled(application string) (err error)
- func CheckMewn(verbose bool) (err error)
- func CheckWindres() (err error)
- func DpkgInstalled(packageName string) (bool, error)
- func EOpkgInstalled(packageName string) (bool, error)
- func EmbedAssets() ([]string, error)
- func EqueryInstalled(packageName string) (bool, error)
- func GetCurrentVersion() (*semver.Version, error)
- func GetWailsVersion() (*semver.Version, error)
- func GoModOutOfSync() (bool, error)
- func InitializeCrossCompilation(verbose bool) error
- func InstallBridge(projectDir string, projectOptions *ProjectOptions) error
- func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forceRebuild bool, ...) error
- func InstallGoDependencies(verbose bool) error
- func InstallProdRuntime(projectDir string, projectOptions *ProjectOptions) error
- func InstallRuntime(caller string, projectDir string, projectOptions *ProjectOptions) error
- func PackageApplication(projectOptions *ProjectOptions) error
- func PacmanInstalled(packageName string) (bool, error)
- func Prompt(question string, defaultValue ...string) string
- func PromptRequired(question string, defaultValue ...string) string
- func PromptSelection(question string, options []string, optionalDefaultValue ...int) int
- func RequestSupportForDistribution(distroInfo *DistroInfo) error
- func RpmInstalled(packageName string) (bool, error)
- func ServeProject(projectOptions *ProjectOptions, logger *Logger) error
- func UpdateGoModVersion() error
- func ValidateFrontendConfig(projectOptions *ProjectOptions) error
- func XbpsInstalled(packageName string) (bool, error)
- type Action
- type CheckPkgInstalled
- type Cli
- func (c *Cli) BoolFlag(name, description string, variable *bool) *Command
- func (c *Cli) Command(name, description string) *Command
- func (c *Cli) DefaultCommand(defaultCommand *Command) *Cli
- func (c *Cli) PreRun(callback func(*Cli) error)
- func (c *Cli) PrintHelp()
- func (c *Cli) Run(args ...string) error
- func (c *Cli) StringFlag(name, description string, variable *string) *Command
- func (c *Cli) Version(version string)
- type Command
- func (c *Command) Action(callback Action) *Command
- func (c *Command) BoolFlag(name, description string, variable *bool) *Command
- func (c *Command) Command(name, description string) *Command
- func (c *Command) Hidden()
- func (c *Command) LongDescription(Longdescription string) *Command
- func (c *Command) PrintHelp()
- func (c *Command) Run(args []string) error
- func (c *Command) StringFlag(name, description string, variable *string) *Command
- type Dir
- type Distribution
- type DistroInfo
- type FSHelper
- func (fs *FSHelper) CopyFile(source, target string) error
- func (fs *FSHelper) CreateFile(filename string, data []byte) error
- func (fs *FSHelper) Cwd() string
- func (fs *FSHelper) DirExists(path string) bool
- func (fs *FSHelper) Directory(dir string) (*Dir, error)
- func (fs *FSHelper) FileExists(path string) bool
- func (fs *FSHelper) FileMD5(filename string) (string, error)
- func (fs *FSHelper) FindFile(path, match string) (string, error)
- func (fs *FSHelper) LoadAsBytes(filename string) ([]byte, error)
- func (fs *FSHelper) LoadAsString(filename string) (string, error)
- func (fs *FSHelper) LoadRelativeFile(relativePath string) ([]byte, error)
- func (fs *FSHelper) LocalDir(dir string) (*Dir, error)
- func (fs *FSHelper) MkDir(dir string) error
- func (fs *FSHelper) MkDirs(fullPath string, mode ...os.FileMode) error
- func (fs *FSHelper) RemoveFile(filename string) error
- func (fs *FSHelper) RemoveFiles(files []string, continueOnError bool) error
- func (fs *FSHelper) SaveAsJSON(data interface{}, filename string) error
- type GitHubHelper
- func (g *GitHubHelper) GetLatestPreRelease() (result *SemanticVersion, err error)
- func (g *GitHubHelper) GetLatestStableRelease() (result *SemanticVersion, err error)
- func (g *GitHubHelper) GetVersionTags() ([]*SemanticVersion, error)
- func (g *GitHubHelper) IsValidTag(tagVersion string) (bool, error)
- type LinuxDB
- type LinuxDistribution
- type Logger
- func (l *Logger) Error(format string, a ...interface{})
- func (l *Logger) Green(format string, a ...interface{})
- func (l *Logger) PrintBanner() error
- func (l *Logger) PrintSmallBanner(message ...string)
- func (l *Logger) Red(format string, a ...interface{})
- func (l *Logger) SetErrorOnly(errorOnly bool)
- func (l *Logger) White(format string, a ...interface{})
- func (l *Logger) WhiteUnderline(format string, a ...interface{})
- func (l *Logger) Yellow(format string, a ...interface{})
- func (l *Logger) YellowUnderline(format string, a ...interface{})
- func (l *Logger) Yellowf(format string, a ...interface{})
- type PackageHelper
- type PackageManager
- type Prerequisite
- type Prerequisites
- type Program
- type ProgramHelper
- func (p *ProgramHelper) FindProgram(programName string) *Program
- func (p *ProgramHelper) InstallGoPackage(packageName string) error
- func (p *ProgramHelper) InstallNPMPackage(packageName string, save bool) error
- func (p *ProgramHelper) IsInstalled(programName string) bool
- func (p *ProgramHelper) RunCommand(command string) error
- func (p *ProgramHelper) RunCommandArray(args []string, dir ...string) error
- type ProjectHelper
- type ProjectOptions
- func (po *ProjectOptions) Defaults()
- func (po *ProjectOptions) GetNPMBinaryName() (PackageManager, error)
- func (po *ProjectOptions) LoadConfig(projectDir string) error
- func (po *ProjectOptions) PromptForInputs() error
- func (po *ProjectOptions) SetTypescriptDefsFilename(filename string)
- func (po *ProjectOptions) WriteProjectConfig() error
- type Release
- type SemanticVersion
- func (s *SemanticVersion) IsGreaterThan(version *SemanticVersion) (bool, error)
- func (s *SemanticVersion) IsGreaterThanOrEqual(version *SemanticVersion) (bool, error)
- func (s *SemanticVersion) IsPreRelease() bool
- func (s *SemanticVersion) IsRelease() bool
- func (s *SemanticVersion) MainVersion() *SemanticVersion
- func (s *SemanticVersion) String() string
- type SemverCollection
- type ShellHelper
- type SystemConfig
- type SystemHelper
- func (s *SystemHelper) BackupConfig() (string, error)
- func (s *SystemHelper) CheckInitialised() error
- func (s *SystemHelper) ConfigFileExists() bool
- func (s *SystemHelper) ConfigFileIsValid() bool
- func (s *SystemHelper) GetAuthor() (string, error)
- func (s *SystemHelper) Initialise() error
- func (s *SystemHelper) LoadConfig() (*SystemConfig, error)
- type TemplateDependency
- type TemplateDetails
- type TemplateHelper
- func (t *TemplateHelper) CreateNewTemplate(dirname string, details *TemplateMetadata) (string, error)
- func (t *TemplateHelper) GetTemplateDetails() (map[string]*TemplateDetails, error)
- func (t *TemplateHelper) GetTemplateFilenames(template *TemplateDetails) (*slicer.StringSlicer, error)
- func (t *TemplateHelper) InstallTemplate(projectPath string, projectOptions *ProjectOptions) error
- func (t *TemplateHelper) IsValidTemplate(templateName string) bool
- func (t *TemplateHelper) LoadMetadata(dir string) (*TemplateMetadata, error)
- func (t *TemplateHelper) SanitizeFilename(name string) string
- type TemplateMetadata
Constants ¶
const ( // BuildModeProd indicates we are building for prod mode BuildModeProd = "prod" // BuildModeDebug indicates we are building for debug mode BuildModeDebug = "debug" // BuildModeBridge indicates we are building for bridge mode BuildModeBridge = "bridge" )
const Version = "v1.7.1"
Version - Wails version
Variables ¶
This section is empty.
Functions ¶
func BuildApplication ¶
func BuildApplication(binaryName string, forceRebuild bool, buildMode string, packageApp bool, projectOptions *ProjectOptions) error
BuildApplication will attempt to build the project based on the given inputs
func BuildDocker ¶ added in v1.5.0
func BuildDocker(binaryName string, buildMode string, projectOptions *ProjectOptions) error
BuildDocker builds the project using the cross compiling wailsapp/xgo:latest container
func BuildFrontend ¶
func BuildFrontend(projectOptions *ProjectOptions) error
BuildFrontend runs the given build command
func BuildNative ¶ added in v1.5.0
func BuildNative(binaryName string, forceRebuild bool, buildMode string, projectOptions *ProjectOptions) error
BuildNative builds on the target platform itself.
func CheckDependencies ¶
CheckDependencies will look for Wails dependencies on the system Errors are reported in error and the bool return value is whether the dependencies are all installed.
func CheckDependenciesSilent ¶
CheckDependenciesSilent checks for dependencies but only outputs if there's an error
func CheckIfInstalled ¶ added in v1.5.0
CheckIfInstalled returns if application is installed
func CheckWindres ¶
func CheckWindres() (err error)
CheckWindres checks if Windres is installed and if not, aborts
func DpkgInstalled ¶
DpkgInstalled uses dpkg to see if a package is installed
func EOpkgInstalled ¶ added in v1.6.0
EOpkgInstalled uses dpkg to see if a package is installed
func EmbedAssets ¶ added in v1.5.0
EmbedAssets will embed the built frontend assets via mewn.
func EqueryInstalled ¶ added in v0.18.0
EqueryInstalled uses equery to see if a package is installed
func GetCurrentVersion ¶ added in v1.0.2
func GetWailsVersion ¶ added in v1.0.2
func GoModOutOfSync ¶ added in v1.0.2
func InitializeCrossCompilation ¶ added in v1.5.0
func InstallBridge ¶ added in v0.11.7
func InstallBridge(projectDir string, projectOptions *ProjectOptions) error
InstallBridge installs the relevant bridge javascript library
func InstallFrontendDeps ¶
func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forceRebuild bool, caller string) error
InstallFrontendDeps attempts to install the frontend dependencies based on the given options
func InstallGoDependencies ¶
InstallGoDependencies will run go get in the current directory
func InstallProdRuntime ¶ added in v0.18.0
func InstallProdRuntime(projectDir string, projectOptions *ProjectOptions) error
InstallProdRuntime installs the production runtime
func InstallRuntime ¶ added in v0.18.0
func InstallRuntime(caller string, projectDir string, projectOptions *ProjectOptions) error
InstallRuntime installs the correct runtime for the type of build
func PackageApplication ¶
func PackageApplication(projectOptions *ProjectOptions) error
PackageApplication will attempt to package the application in a platform dependent way
func PacmanInstalled ¶ added in v0.12.1
PacmanInstalled uses pacman to see if a package is installed.
func PromptRequired ¶
PromptRequired calls Prompt repeatedly until a value is given
func PromptSelection ¶
PromptSelection asks the user to choose an option
func RequestSupportForDistribution ¶ added in v0.17.0
func RequestSupportForDistribution(distroInfo *DistroInfo) error
RequestSupportForDistribution promts the user to submit a request to support their currently unsupported distribution
func RpmInstalled ¶ added in v0.13.0
RpmInstalled uses rpm to see if a package is installed
func ServeProject ¶
func ServeProject(projectOptions *ProjectOptions, logger *Logger) error
ServeProject attempts to serve up the current project so that it may be connected to via the Wails bridge
func UpdateGoModVersion ¶ added in v1.0.2
func UpdateGoModVersion() error
func ValidateFrontendConfig ¶
func ValidateFrontendConfig(projectOptions *ProjectOptions) error
ValidateFrontendConfig checks if the frontend config is valid
func XbpsInstalled ¶ added in v0.18.0
XbpsInstalled uses pacman to see if a package is installed.
Types ¶
type Action ¶
type Action func() error
Action represents a function that gets calls when the command is called by the user
type CheckPkgInstalled ¶ added in v0.18.0
CheckPkgInstalled is all functions that use local programs to see if a package is installed
type Cli ¶
type Cli struct {
// contains filtered or unexported fields
}
Cli - The main application object
func (*Cli) DefaultCommand ¶
DefaultCommand - Sets the given command as the command to run when no other commands given
func (*Cli) StringFlag ¶
StringFlag - Adds a string flag to the root command
type Command ¶
type Command struct { Name string CommandPath string Shortdescription string Longdescription string AppVersion string SubCommands []*Command SubCommandsMap map[string]*Command ActionCallback Action App *Cli Flags *flag.FlagSet // contains filtered or unexported fields }
Command represents a command that may be run by the user
func NewCommand ¶
NewCommand creates a new Command
func (*Command) Hidden ¶ added in v0.15.0
func (c *Command) Hidden()
Hidden hides the command from the Help system
func (*Command) LongDescription ¶
LongDescription - Sets the long description for the command
func (*Command) PrintHelp ¶
func (c *Command) PrintHelp()
PrintHelp - Output the help text for this command
type Dir ¶ added in v0.15.0
type Dir struct {
// contains filtered or unexported fields
}
Dir holds information about a directory
func (*Dir) GetAllFilenames ¶ added in v0.15.0
func (d *Dir) GetAllFilenames() (*slicer.StringSlicer, error)
GetAllFilenames returns all filename in and below this directory
type Distribution ¶ added in v0.18.0
Distribution holds the os-release ID and a map of releases.
func (*Distribution) GetRelease ¶ added in v0.18.0
func (d *Distribution) GetRelease(version string) *Release
GetRelease attempts to return the specific Release information for the given release name. If there is no specific match, the default release data is returned.
type DistroInfo ¶
type DistroInfo struct { Distribution LinuxDistribution Name string ID string Description string Release string }
DistroInfo contains all the information relating to a linux distribution
func GetLinuxDistroInfo ¶
func GetLinuxDistroInfo() *DistroInfo
GetLinuxDistroInfo returns information about the running linux distribution
type FSHelper ¶
type FSHelper struct { }
FSHelper - Wrapper struct for File System utility commands
func (*FSHelper) CreateFile ¶ added in v0.9.5
CreateFile creates a file at the given filename location with the contents set to the given data. It will create intermediary directories if needed.
func (*FSHelper) DirExists ¶
DirExists - Returns true if the given path resolves to a directory on the filesystem
func (*FSHelper) Directory ¶ added in v0.15.0
Directory creates a new Dir struct with the given directory path
func (*FSHelper) FileExists ¶
FileExists returns a boolean value indicating whether the given file exists
func (*FSHelper) FindFile ¶ added in v1.5.0
FindFile returns the first occurrence of match inside path.
func (*FSHelper) LoadAsBytes ¶ added in v0.15.0
LoadAsBytes returns the contents of the file as a byte slice
func (*FSHelper) LoadAsString ¶
LoadAsString will attempt to load the given file and return its contents as a string
func (*FSHelper) LoadRelativeFile ¶ added in v1.0.2
LoadRelativeFile loads the given file relative to the caller's directory
func (*FSHelper) LocalDir ¶ added in v0.15.0
LocalDir creates a new Dir struct based on a path relative to the caller
func (*FSHelper) RemoveFile ¶
RemoveFile removes the given filename
func (*FSHelper) RemoveFiles ¶
RemoveFiles removes the given filenames
func (*FSHelper) SaveAsJSON ¶ added in v0.15.0
SaveAsJSON saves the JSON representation of the given data to the given filename
type GitHubHelper ¶ added in v0.13.0
type GitHubHelper struct { }
GitHubHelper is a utility class for interacting with GitHub
func NewGitHubHelper ¶ added in v0.13.0
func NewGitHubHelper() *GitHubHelper
NewGitHubHelper returns a new GitHub Helper
func (*GitHubHelper) GetLatestPreRelease ¶ added in v0.13.0
func (g *GitHubHelper) GetLatestPreRelease() (result *SemanticVersion, err error)
GetLatestPreRelease gets the latest prerelease on GitHub
func (*GitHubHelper) GetLatestStableRelease ¶ added in v0.13.0
func (g *GitHubHelper) GetLatestStableRelease() (result *SemanticVersion, err error)
GetLatestStableRelease gets the latest stable release on GitHub
func (*GitHubHelper) GetVersionTags ¶ added in v0.13.0
func (g *GitHubHelper) GetVersionTags() ([]*SemanticVersion, error)
GetVersionTags gets the list of tags on the Wails repo It returns a list of sorted tags in descending order
func (*GitHubHelper) IsValidTag ¶ added in v0.13.0
func (g *GitHubHelper) IsValidTag(tagVersion string) (bool, error)
IsValidTag returns true if the given string is a valid tag
type LinuxDB ¶ added in v0.18.0
type LinuxDB struct {
Distributions map[string]*Distribution `yaml:"distributions"`
}
LinuxDB is the database for linux distribution data.
func NewLinuxDB ¶ added in v0.18.0
func NewLinuxDB() *LinuxDB
NewLinuxDB creates a new LinuxDB instance from the bundled linuxdb.yaml file.
func (*LinuxDB) GetDistro ¶ added in v0.18.0
func (l *LinuxDB) GetDistro(distro string) *Distribution
GetDistro returns the Distribution information for the given distribution name. If the distribution is not supported, nil is returned.
func (*LinuxDB) ImportData ¶ added in v0.18.0
ImportData will unmarshal the given YAML formatted data into the LinuxDB
type LinuxDistribution ¶
type LinuxDistribution int
LinuxDistribution is of type int
const ( // Unknown is the catch-all distro Unknown LinuxDistribution = iota // Debian distribution Debian // Ubuntu distribution Ubuntu // Arch linux distribution Arch // CentOS linux distribution CentOS // Fedora linux distribution Fedora // Gentoo distribution Gentoo // Zorin distribution Zorin // Parrot distribution Parrot // Linuxmint distribution Linuxmint // VoidLinux distribution VoidLinux // Elementary distribution Elementary // Kali distribution Kali // Neon distribution Neon // ArcoLinux distribution ArcoLinux // Manjaro distribution Manjaro // ManjaroARM distribution ManjaroARM // Deepin distribution Deepin // Raspbian distribution Raspbian // Tumbleweed (OpenSUSE) distribution Tumbleweed // Leap (OpenSUSE) distribution Leap // ArchLabs distribution ArchLabs // PopOS distribution PopOS // Solus distribution Solus )
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger struct
func (*Logger) PrintBanner ¶
PrintBanner prints the Wails banner before running commands
func (*Logger) PrintSmallBanner ¶
PrintSmallBanner prints a condensed banner
func (*Logger) SetErrorOnly ¶
SetErrorOnly ensures that only errors are logged out
func (*Logger) WhiteUnderline ¶
WhiteUnderline - Outputs White text with underline
func (*Logger) YellowUnderline ¶
YellowUnderline - Outputs Yellow text with underline
type PackageHelper ¶
type PackageHelper struct {
// contains filtered or unexported fields
}
PackageHelper helps with the 'wails package' command
func NewPackageHelper ¶
func NewPackageHelper(platform string) *PackageHelper
NewPackageHelper creates a new PackageHelper!
func (*PackageHelper) CleanWindows ¶ added in v1.5.0
func (b *PackageHelper) CleanWindows(po *ProjectOptions)
CleanWindows removes any windows related files found in the directory
func (*PackageHelper) Package ¶
func (b *PackageHelper) Package(po *ProjectOptions) error
Package the application into a platform specific package
func (*PackageHelper) PackageWindows ¶
func (b *PackageHelper) PackageWindows(po *ProjectOptions, cleanUp bool) error
PackageWindows packages the application for windows platforms
type PackageManager ¶ added in v0.19.0
type PackageManager int
PackageManager indicates different package managers
const ( // UNKNOWN package manager UNKNOWN PackageManager = iota // NPM package manager NPM // YARN package manager YARN )
type Prerequisite ¶
Prerequisite is a simple struct containing a program/library name plus the distribution specific help text indicating how to install it.
type Prerequisites ¶
type Prerequisites []*Prerequisite
Prerequisites is a list of things required to use Wails
func GetRequiredLibraries ¶
func GetRequiredLibraries() (*Prerequisites, error)
GetRequiredLibraries returns a list of libraries (packages) required for the platform
func GetRequiredPrograms ¶
func GetRequiredPrograms() (*Prerequisites, error)
GetRequiredPrograms returns a list of programs required for the platform
func (*Prerequisites) Add ¶
func (p *Prerequisites) Add(prereq *Prerequisite)
Add given prereq object to list
type Program ¶
type Program struct { Name string `json:"name"` Path string `json:"path"` // contains filtered or unexported fields }
Program - A struct to define an installed application/binary
func (*Program) GetFullPathToBinary ¶
GetFullPathToBinary returns the full path the the current binary
type ProgramHelper ¶
type ProgramHelper struct {
// contains filtered or unexported fields
}
ProgramHelper - Utility functions around installed applications
func NewProgramHelper ¶
func NewProgramHelper(verbose ...bool) *ProgramHelper
NewProgramHelper - Creates a new ProgramHelper
func (*ProgramHelper) FindProgram ¶
func (p *ProgramHelper) FindProgram(programName string) *Program
FindProgram attempts to find the given program on the system.FindProgram Returns a struct with the name and path to the program
func (*ProgramHelper) InstallGoPackage ¶
func (p *ProgramHelper) InstallGoPackage(packageName string) error
InstallGoPackage installs the given Go package
func (*ProgramHelper) InstallNPMPackage ¶ added in v0.19.0
func (p *ProgramHelper) InstallNPMPackage(packageName string, save bool) error
InstallNPMPackage installs the given npm package
func (*ProgramHelper) IsInstalled ¶
func (p *ProgramHelper) IsInstalled(programName string) bool
IsInstalled tries to determine if the given binary name is installed
func (*ProgramHelper) RunCommand ¶
func (p *ProgramHelper) RunCommand(command string) error
RunCommand runs the given command
func (*ProgramHelper) RunCommandArray ¶
func (p *ProgramHelper) RunCommandArray(args []string, dir ...string) error
RunCommandArray runs the command specified in the array
type ProjectHelper ¶
type ProjectHelper struct {
// contains filtered or unexported fields
}
ProjectHelper is a helper struct for managing projects
func NewProjectHelper ¶
func NewProjectHelper() *ProjectHelper
NewProjectHelper creates a new Project helper struct
func (*ProjectHelper) GenerateProject ¶
func (ph *ProjectHelper) GenerateProject(projectOptions *ProjectOptions) error
GenerateProject generates a new project using the options given
func (*ProjectHelper) LoadProjectConfig ¶
func (ph *ProjectHelper) LoadProjectConfig(dir string) (*ProjectOptions, error)
LoadProjectConfig loads the project config from the given directory
func (*ProjectHelper) NewProjectOptions ¶
func (ph *ProjectHelper) NewProjectOptions() *ProjectOptions
NewProjectOptions creates a new default set of project options
type ProjectOptions ¶
type ProjectOptions struct { Name string `json:"name"` Description string `json:"description"` Author *author `json:"author,omitempty"` Version string `json:"version"` OutputDirectory string `json:"-"` UseDefaults bool `json:"-"` Template string `json:"-"` BinaryName string `json:"binaryname"` FrontEnd *frontend `json:"frontend,omitempty"` NPMProjectName string `json:"-"` WailsVersion string Verbose bool `json:"-"` CrossCompile bool Platform string Architecture string LdFlags string // contains filtered or unexported fields }
ProjectOptions holds all the options available for a project
func (*ProjectOptions) Defaults ¶
func (po *ProjectOptions) Defaults()
Defaults sets the default project template
func (*ProjectOptions) GetNPMBinaryName ¶ added in v0.19.0
func (po *ProjectOptions) GetNPMBinaryName() (PackageManager, error)
GetNPMBinaryName returns the type of package manager used by the project
func (*ProjectOptions) LoadConfig ¶
func (po *ProjectOptions) LoadConfig(projectDir string) error
LoadConfig loads the project configuration file from the given directory
func (*ProjectOptions) PromptForInputs ¶
func (po *ProjectOptions) PromptForInputs() error
PromptForInputs asks the user to input project details
func (*ProjectOptions) SetTypescriptDefsFilename ¶ added in v1.0.2
func (po *ProjectOptions) SetTypescriptDefsFilename(filename string)
SetTypescriptDefsFilename indicates that we want to generate typescript bindings to the given file
func (*ProjectOptions) WriteProjectConfig ¶
func (po *ProjectOptions) WriteProjectConfig() error
WriteProjectConfig writes the project configuration into the project directory
type Release ¶ added in v0.18.0
type Release struct { Name string `yaml:"name"` Version string `yaml:"version"` GccVersionCommand string `yaml:"gccversioncommand"` Programs []*Prerequisite `yaml:"programs"` Libraries []*Prerequisite `yaml:"libraries"` }
Release holds the name and version of the release as given by os-release. Programs is a slice of dependant programs required to be present on the local installation for Wails to function. Libraries is a slice of libraries that must be present for Wails applications to compile.
type SemanticVersion ¶ added in v0.13.0
SemanticVersion is a struct containing a semantic version
func NewSemanticVersion ¶ added in v0.13.0
func NewSemanticVersion(version string) (*SemanticVersion, error)
NewSemanticVersion creates a new SemanticVersion object with the given version string
func (*SemanticVersion) IsGreaterThan ¶ added in v0.13.0
func (s *SemanticVersion) IsGreaterThan(version *SemanticVersion) (bool, error)
IsGreaterThan returns true if this version is greater than the given version
func (*SemanticVersion) IsGreaterThanOrEqual ¶ added in v0.13.0
func (s *SemanticVersion) IsGreaterThanOrEqual(version *SemanticVersion) (bool, error)
IsGreaterThanOrEqual returns true if this version is greater than or equal the given version
func (*SemanticVersion) IsPreRelease ¶ added in v0.13.0
func (s *SemanticVersion) IsPreRelease() bool
IsPreRelease returns true if it's a prerelease version
func (*SemanticVersion) IsRelease ¶ added in v0.13.0
func (s *SemanticVersion) IsRelease() bool
IsRelease returns true if it's a release version
func (*SemanticVersion) MainVersion ¶ added in v0.13.0
func (s *SemanticVersion) MainVersion() *SemanticVersion
MainVersion returns the main version of any version+prerelease+metadata EG: MainVersion("1.2.3-pre") => "1.2.3"
func (*SemanticVersion) String ¶ added in v0.13.0
func (s *SemanticVersion) String() string
type SemverCollection ¶ added in v0.13.0
type SemverCollection []*SemanticVersion
SemverCollection is a collection of SemanticVersion objects
func (SemverCollection) Len ¶ added in v0.13.0
func (c SemverCollection) Len() int
Len returns the length of a collection. The number of Version instances on the slice.
func (SemverCollection) Less ¶ added in v0.13.0
func (c SemverCollection) Less(i, j int) bool
Less is needed for the sort interface to compare two Version objects on the slice. If checks if one is less than the other.
func (SemverCollection) Swap ¶ added in v0.13.0
func (c SemverCollection) Swap(i, j int)
Swap is needed for the sort interface to replace the Version objects at two different positions in the slice.
type ShellHelper ¶
type ShellHelper struct {
// contains filtered or unexported fields
}
ShellHelper helps with Shell commands
func (*ShellHelper) Run ¶
func (sh *ShellHelper) Run(command string, vars ...string) (stdout, stderr string, err error)
Run the given command
func (*ShellHelper) RunInDirectory ¶ added in v0.12.3
func (sh *ShellHelper) RunInDirectory(dir string, command string, vars ...string) (stdout, stderr string, err error)
RunInDirectory runs the given command in the given directory
func (*ShellHelper) SetVerbose ¶ added in v1.5.0
func (sh *ShellHelper) SetVerbose()
SetVerbose sets the verbose flag
type SystemConfig ¶
SystemConfig - Defines system wode configuration data
func NewSystemConfig ¶
func NewSystemConfig(filename string) (*SystemConfig, error)
NewSystemConfig - Creates a new SystemConfig helper object
func (*SystemConfig) Save ¶
func (sc *SystemConfig) Save(filename string) error
Save - Saves the system config to the given filename
type SystemHelper ¶
type SystemHelper struct {
// contains filtered or unexported fields
}
SystemHelper - Defines everything related to the system
func NewSystemHelper ¶
func NewSystemHelper() *SystemHelper
NewSystemHelper - Creates a new System Helper
func (*SystemHelper) BackupConfig ¶
func (s *SystemHelper) BackupConfig() (string, error)
BackupConfig attempts to backup the system config file
func (*SystemHelper) CheckInitialised ¶
func (s *SystemHelper) CheckInitialised() error
CheckInitialised checks if the system has been set up and if not, runs setup
func (*SystemHelper) ConfigFileExists ¶
func (s *SystemHelper) ConfigFileExists() bool
ConfigFileExists - Returns true if it does!
func (*SystemHelper) ConfigFileIsValid ¶
func (s *SystemHelper) ConfigFileIsValid() bool
ConfigFileIsValid checks if the config file is valid
func (*SystemHelper) GetAuthor ¶ added in v0.15.0
func (s *SystemHelper) GetAuthor() (string, error)
GetAuthor returns a formatted string of the user's name and email
func (*SystemHelper) Initialise ¶
func (s *SystemHelper) Initialise() error
Initialise attempts to set up the Wails system. An error is returns if there is a problem
func (*SystemHelper) LoadConfig ¶
func (s *SystemHelper) LoadConfig() (*SystemConfig, error)
LoadConfig attempts to load the Wails system config
type TemplateDependency ¶ added in v0.17.0
TemplateDependency defines a binary dependency for the template EG: ng for angular
type TemplateDetails ¶ added in v0.9.5
type TemplateDetails struct { Name string Path string Metadata *TemplateMetadata // contains filtered or unexported fields }
TemplateDetails holds information about a specific template
type TemplateHelper ¶
type TemplateHelper struct {
// contains filtered or unexported fields
}
TemplateHelper is a utility object to help with processing templates
func NewTemplateHelper ¶
func NewTemplateHelper() *TemplateHelper
NewTemplateHelper creates a new template helper
func (*TemplateHelper) CreateNewTemplate ¶ added in v0.15.0
func (t *TemplateHelper) CreateNewTemplate(dirname string, details *TemplateMetadata) (string, error)
CreateNewTemplate creates a new template based on the given directory name and string
func (*TemplateHelper) GetTemplateDetails ¶
func (t *TemplateHelper) GetTemplateDetails() (map[string]*TemplateDetails, error)
GetTemplateDetails returns a map of Template structs containing details of the found templates
func (*TemplateHelper) GetTemplateFilenames ¶ added in v0.15.0
func (t *TemplateHelper) GetTemplateFilenames(template *TemplateDetails) (*slicer.StringSlicer, error)
GetTemplateFilenames returns all the filenames of the given template
func (*TemplateHelper) InstallTemplate ¶
func (t *TemplateHelper) InstallTemplate(projectPath string, projectOptions *ProjectOptions) error
InstallTemplate installs the template given in the project options to the project path given
func (*TemplateHelper) IsValidTemplate ¶ added in v0.15.0
func (t *TemplateHelper) IsValidTemplate(templateName string) bool
IsValidTemplate returns true if the given template name resides on disk
func (*TemplateHelper) LoadMetadata ¶
func (t *TemplateHelper) LoadMetadata(dir string) (*TemplateMetadata, error)
LoadMetadata loads the template's 'metadata.json' file
func (*TemplateHelper) SanitizeFilename ¶ added in v0.15.0
func (t *TemplateHelper) SanitizeFilename(name string) string
SanitizeFilename sanitizes the given string to make a valid filename
type TemplateMetadata ¶ added in v0.9.5
type TemplateMetadata struct { Name string `json:"name"` Version string `json:"version"` ShortDescription string `json:"shortdescription"` Description string `json:"description"` Install string `json:"install"` Build string `json:"build"` Author string `json:"author"` Created string `json:"created"` FrontendDir string `json:"frontenddir"` Serve string `json:"serve"` Bridge string `json:"bridge"` WailsDir string `json:"wailsdir"` TemplateDependencies []*TemplateDependency `json:"dependencies,omitempty"` }
TemplateMetadata holds all the metadata for a Wails template