cmd

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 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 GetVersion

func GetVersion(c *config.Config) error

GetVersion prints the version of the project.

func Init

func Init(c *config.Config) error

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

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 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 PushGitRelease

func PushGitRelease(c *config.Config) error

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

func PushVersionFileGit(c *config.Config) error

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

func Release(c *config.Config) error

Release releases the project as a git tag. It should be called after update-version or similar.

func ReleaseApp

func ReleaseApp(c *config.Config) error

ReleaseApp releases the config app.

func ReleaseLibrary

func ReleaseLibrary(c *config.Config) error

ReleaseLibrary releases the config library.

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 SetVersion

func SetVersion(c *config.Config) error

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

func UpdateVersion(c *config.Config) error

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

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

VersionFileString returns the version file string for a project with the given config info.

func VersionRelease

func VersionRelease(c *config.Config) error

VersionRelease calls update-version and then release. It is the standard release path.

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