Documentation ¶
Overview ¶
Package cmd provides utilities for managing apps and packages that use the Cogent Core framework.
Index ¶
- Variables
- func AppName(pkgPath string) string
- func Build(c *config.Config) error
- func BuildDesktop(c *config.Config, platform config.Platform) error
- func Changed(c *config.Config) error
- func GetVersion(c *config.Config) error
- func Init(c *config.Config) error
- func Install(c *config.Config) error
- func Log(c *config.Config) error
- func Pack(c *config.Config) error
- func PackDarwin(c *config.Config) error
- func PackLinux(c *config.Config) error
- func PackWindows(c *config.Config) error
- func Pull(c *config.Config) error
- func PushGitRelease(c *config.Config) error
- func PushVersionFileGit(c *config.Config) error
- func Release(c *config.Config) error
- func ReleaseApp(c *config.Config) error
- func ReleaseLibrary(c *config.Config) error
- func Run(c *config.Config) error
- func SetVersion(c *config.Config) error
- func UpdateVersion(c *config.Config) error
- func VersionFileString(c *config.Config) (string, error)
- func VersionRelease(c *config.Config) error
- type DebianControlData
- type DesktopFileData
- type DmgBuildData
- type InfoPlistData
- type WindowsInstallerData
Constants ¶
This section is empty.
Variables ¶
var DebianControlTmpl = template.Must(template.New("DebianControlTmpl").Parse(
`Package: {{.Name}}
Version: {{.Version}}
Section: base
Priority: optional
Architecture: all
Maintainer: Your Name <you@email.com>
Description: {{.Desc}}
`))
DebianControlTmpl is the template for the Linux DEBIAN/control file
var DesktopFileTmpl = template.Must(template.New("DesktopFileTmpl").Parse(
`[Desktop Entry]
Type=Application
Version=1.0
Name={{.Name}}
Comment={{.Desc}}
Exec={{.Exec}}
Icon={{.Exec}}
Terminal=false
`))
DesktopFileTmpl is the template for the Linux .desktop file
var DmgBuildTmpl = template.Must(template.New("DmgBuildTmpl").Parse(
`files = ['{{.AppPath}}']
symlinks = {"Applications": "/Applications"}
icon = '{{.IconPath}}'
icon_locations = {'{{.AppName}}': (140, 120), "Applications": (500, 120)}
background = "builtin-arrow"
`))
DmgBuildTmpl is the template for the dmgbuild python settings file
var InfoPlistTmpl = template.Must(template.New("InfoPlistTmpl").Parse(
`<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>{{ .Name }}</string>
<key>CFBundleExecutable</key>
<string>{{ .Executable }}</string>
<key>CFBundleIdentifier</key>
<string>{{ .Identifier }}</string>
<key>CFBundleVersion</key>
<string>{{ .Version }}</string>
<key>CFBundleGetInfoString</key>
<string>{{ .InfoString }}</string>
<key>CFBundleShortVersionString</key>
<string>{{ .ShortVersionString }}</string>
<key>CFBundleIconFile</key>
<string>{{ .IconFile }}</string>
</dict>
</plist>
`))
InfoPlistTmpl is the template for the macOS .app Info.plist
var WindowsInstallerTmpl = template.Must(template.New("WindowsInstallerTmpl").Parse(windowsInstallerTmplString))
WindowsInstallerTmpl is the template for the Windows installer Go file
Functions ¶
func Build ¶
Build builds an executable for the package at the config path for the config platforms.
func BuildDesktop ¶
BuildDesktop builds an executable for the config package for the given desktop platform. BuildDesktop does not check whether platforms are valid, so it should be called through Build in almost all cases.
func Changed ¶ added in v0.0.3
Changed concurrently prints all of the repositories within this directory that have been changed and need to be updated in Git.
func GetVersion ¶
GetVersion prints the version of the project.
func Init ¶
Init initializes the ".core" directory and a "config.toml" file inside it. The "config.toml" file has the given config info. Init also sets the config name to the current directory if it is unset.
func Install ¶
Install installs the package on the local system. It uses the same config info as build.
func Log ¶
Log prints the logs from your app running on Android to the terminal. Android is the only supported platform for log; use the -debug flag on run for other platforms.
func Pack ¶
Pack builds and packages the app for the target platform. For android, ios, and web, it is equivalent to build.
func PackDarwin ¶
PackDarwin packages the app for macOS by generating a .app and .dmg file.
func PackWindows ¶
PackWindows packages the app for Windows by generating a .msi file.
func Pull ¶ added in v0.0.3
Pull concurrently pulls all of the Git repositories within the current directory.
func PushGitRelease ¶
PushGitRelease commits a release commit using Git, adds a version tag, and pushes the code and tags based on the given config info.
func PushVersionFileGit ¶
PushVersionFileGit makes and pushes a Git commit updating the version file based on the given config info. It does not actually update the version file; it only commits and pushes the changes that should have already been made by UpdateVersion.
func Release ¶
Release releases the project as a git tag. It should be called after update-version or similar.
func ReleaseLibrary ¶
ReleaseLibrary releases the config library.
func Run ¶
Run builds and runs the config package. It also displays the logs generated by the app. It uses the same config info as build.
func SetVersion ¶
SetVersion updates the config and version file of the config project based on the config version and commits and pushes the changes. After it, release or similar should be called to push the git tags.
func UpdateVersion ¶
UpdateVersion updates the version of the project by one patch version. After it, release or similar should be called to push the git tags.
func VersionFileString ¶
VersionFileString returns the version file string for a project with the given config info.
func VersionRelease ¶
VersionRelease calls update-version and then release. It is the standard release path.
Types ¶
type DebianControlData ¶
DebianControlData is the data passed to DebianControlTmpl
type DesktopFileData ¶
DesktopFileData is the data passed to DesktopFileTmpl
type DmgBuildData ¶
DmgBuildData is the data passed to DmgBuildTmpl
type InfoPlistData ¶
type InfoPlistData struct { Name string Executable string Identifier string Version string InfoString string ShortVersionString string IconFile string }
InfoPlistData is the data passed to InfoPlistTmpl
type WindowsInstallerData ¶
WindowsInstallerData is the data passed to WindowsInstallerTmpl