buildcfg

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFileName       = "velo.json"
	LegacyConfigFileName = "app-config.json"
)

Variables

This section is empty.

Functions

func GenerateDarwinPlist

func GenerateDarwinPlist(cfg *Config, outDir string) error

func GenerateGoreleaser

func GenerateGoreleaser(cfg *Config, outDir string) error

func GenerateIcons

func GenerateIcons(cfg *Config, baseDir, outDir string) error

func GenerateLinuxDesktop

func GenerateLinuxDesktop(cfg *Config, outDir string) error

func GenerateWinres

func GenerateWinres(cfg *Config, baseDir, outDir string) error

func ResolveConfigPath added in v1.0.1

func ResolveConfigPath(dir string) (path string, legacy bool, err error)

ResolveConfigPath returns the preferred Velo configuration file in dir. app-config.json remains supported as a compatibility fallback.

Types

type AppSection

type AppSection struct {
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
	Description string `json:"description"`
	Version     string `json:"version"`
	Author      string `json:"author"`
	Icon        string `json:"icon"`
	TrayIcon    string `json:"tray_icon"`
}

type BinarySection

type BinarySection struct {
	ProjectName string `json:"project_name"`
}

type BuildSection

type BuildSection struct {
	ConfigFiles  []ConfigFile `json:"config_files"`
	ExcludeFiles []string     `json:"exclude_files"`
}

type Config

type Config struct {
	App       AppSection    `json:"app"`
	Binary    BinarySection `json:"binary"`
	Platforms struct {
		MacOS   MacOSSection   `json:"macos"`
		Windows WindowsSection `json:"windows"`
		Linux   LinuxSection   `json:"linux"`
		IOS     IOSSection     `json:"ios"`
	} `json:"platforms"`
	Build   BuildSection   `json:"build"`
	Desktop DesktopSection `json:"desktop"`
	Release ReleaseSection `json:"release"`
	Update  UpdateSection  `json:"update"`
}

func Load

func Load(path string) (*Config, error)

func (*Config) DisplayName

func (c *Config) DisplayName() string

func (*Config) ProjectName

func (c *Config) ProjectName() string

func (*Config) Validate

func (c *Config) Validate() error

type ConfigFile

type ConfigFile struct {
	Src string `json:"src"`
	Dst string `json:"dst"`
}

type DMGSection

type DMGSection struct {
	WindowSize struct {
		Width  int `json:"width"`
		Height int `json:"height"`
	} `json:"window_size"`
	IconSize  int `json:"icon_size"`
	Positions struct {
		App          Position `json:"app"`
		Applications Position `json:"applications"`
	} `json:"positions"`
	Background struct {
		AutoGenerate bool   `json:"auto_generate"`
		CustomPath   string `json:"custom_path"`
	} `json:"background"`
}

type DesktopSection

type DesktopSection struct {
	Engine   string          `json:"engine"`
	Electron ElectronSection `json:"electron"`
}

type ElectronSection

type ElectronSection struct {
	Enabled        bool   `json:"enabled"`
	PackageManager string `json:"package_manager"`
	Command        string `json:"command"`
}

type IOSSection

type IOSSection struct {
	BundleID         string `json:"bundle_id"`
	IconFile         string `json:"icon_file"`
	MinimumOSVersion string `json:"minimum_os_version"`
	Xcassets         string `json:"xcassets"`
}

type LinuxSection

type LinuxSection struct {
	IconFile     string `json:"icon_file"`
	DesktopEntry struct {
		Categories string `json:"categories"`
		Keywords   string `json:"keywords"`
	} `json:"desktop_entry"`
}

type MacOSSection

type MacOSSection struct {
	BundleID         string          `json:"bundle_id"`
	IconFile         string          `json:"icon_file"`
	MinSystemVersion string          `json:"min_system_version"`
	Category         string          `json:"category"`
	Entitlements     map[string]bool `json:"entitlements"`
	APSEnvironment   string          `json:"aps_environment"`
	DMG              DMGSection      `json:"dmg"`
}

type Position

type Position struct {
	X int `json:"x"`
	Y int `json:"y"`
}

type ReleaseSection

type ReleaseSection struct {
	Footer string `json:"footer"`
}

type UpdateSection

type UpdateSection struct {
	Enabled        bool                 `json:"enabled"`
	CheckFrequency string               `json:"check_frequency"`
	Channel        string               `json:"channel"`
	AutoDownload   bool                 `json:"auto_download"`
	Timeout        int                  `json:"timeout"`
	Sources        []UpdateSourceConfig `json:"sources"`
}

func (*UpdateSection) ToUpdaterConfig

func (u *UpdateSection) ToUpdaterConfig() *types.UpdateConfig

type UpdateSourceConfig

type UpdateSourceConfig struct {
	Type              string `json:"type"`
	Priority          int    `json:"priority"`
	Enabled           bool   `json:"enabled"`
	NeedCheckChecksum bool   `json:"need_check_checksum"`
	GitHubRepo        string `json:"github_repo,omitempty"`
	GitHubToken       string `json:"github_token,omitempty"`
	ManifestURL       string `json:"manifest_url,omitempty"`
	SelfURL           string `json:"self_url,omitempty"`
}

type WindowsSection

type WindowsSection struct {
	CompanyName      string `json:"company_name"`
	ProductName      string `json:"product_name"`
	FileDescription  string `json:"file_description"`
	InternalName     string `json:"internal_name"`
	OriginalFilename string `json:"original_filename"`
	IconFiles        struct {
		PNG   string `json:"png"`
		PNG16 string `json:"png16"`
	} `json:"icon_files"`
}

Jump to

Keyboard shortcuts

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