cmd

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Overview

Package cmd provides utilities for managing apps and packages that use the Cogent Core framework.

Index

Constants

This section is empty.

Variables

View Source
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

View Source
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

View Source
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

View Source
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

View Source
var WindowsInstallerTmpl = template.Must(template.New("WindowsInstallerTmpl").Parse(windowsInstallerTmplString))

WindowsInstallerTmpl is the template for the Windows installer Go file

Functions

func AppName

func AppName(pkgPath string) string

AppName returns the app name for the package at the given path

func Build

func Build(c *config.Config) error

Build builds an executable for the package at the config path for the config platforms.

func BuildDesktop

func BuildDesktop(c *config.Config, platform config.Platform) error

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

func Changed(c *config.Config) error

Changed concurrently prints all of the repositories within this directory that have been changed and need to be updated in Git.

func Install

func Install(c *config.Config) error

Install installs the package on the local system. It uses the same config info as build.

func Log

func Log(c *config.Config) error

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 NextRelease added in v0.0.5

func NextRelease(c *config.Config) error

NextRelease releases the project with the current git version tag incremented by one patch version.

func NextVersion added in v0.0.5

func NextVersion(c *config.Config) (string, error)

NextVersion returns the version of the project incremented by one patch version.

func Pack

func Pack(c *config.Config) error

Pack builds and packages the app for the target platform. For android, ios, and web, it is equivalent to build.

func PackDarwin

func PackDarwin(c *config.Config) error

PackDarwin packages the app for macOS by generating a .app and .dmg file.

func PackLinux

func PackLinux(c *config.Config) error

PackLinux packages the app for Linux by generating a .deb file.

func PackWindows

func PackWindows(c *config.Config) error

PackWindows packages the app for Windows by generating a .msi file.

func Pull added in v0.0.3

func Pull(c *config.Config) error

Pull concurrently pulls all of the Git repositories within the current directory.

func Release

func Release(c *config.Config) error

Release releases the project with the specified git version tag.

func Run

func Run(c *config.Config) error

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 Setup

func Setup(c *config.Config) error

Setup installs platform-specific dependencies for the current platform. It only needs to be called once per system.

Types

type DebianControlData

type DebianControlData struct {
	Name    string
	Version string
	Desc    string
}

DebianControlData is the data passed to DebianControlTmpl

type DesktopFileData

type DesktopFileData struct {
	Name string
	Desc string
	Exec string
}

DesktopFileData is the data passed to DesktopFileTmpl

type DmgBuildData

type DmgBuildData struct {
	AppPath  string
	AppName  string
	IconPath string
}

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

type WindowsInstallerData struct {
	Name string
	Desc string
}

WindowsInstallerData is the data passed to WindowsInstallerTmpl

Jump to

Keyboard shortcuts

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