packman

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package packman provides utilities for managing apps and packages that use the GoKi framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppName

func AppName(pkgPath string) string

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

func ArgsString

func ArgsString(args []string) string

ArgsString returns a string representation of the given command arguments.

func Build

func Build(c *config.Config) error

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

func BuildPath

func BuildPath(pkgPath string) string

BuildPath returns the path to the build binary output directory from the given package path.

func CmdString

func CmdString(cmd *exec.Cmd) string

CmdString returns a string representation of the given command.

func GenerateColorScheme

func GenerateColorScheme(c *config.Config) error

GenerateColorScheme generates a Go color scheme declaration file from a Material Theme Builder Android Views XML file located at the config source file path. It stores the resulting Go file at the config destination file path. The generated file is part of the config package and puts the config comment as the comment for the ColorSchemes variable.

func Install

func Install(c *config.Config) error

Install installs the package the config ID by looking for it in the list of supported packages. If the config ID is a filepath, it calls InstallLocal instead.

func InstallLocal

func InstallLocal(c *config.Config) error

InstallLocal installs a local package from the filesystem on the user's device for the config target operating systems.

func InstallPackage

func InstallPackage(pkg Package) error

InstallPackage installs the given package object.

func Log

func Log(c *config.Config) error

Log prints the logs from your app running on the config operating system (android or ios) to the terminal

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

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 config project by calling ReleaseApp if it is an app and ReleaseLibrary if it is a library.

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 RunCmd added in v0.1.2

func RunCmd(cmd *exec.Cmd) ([]byte, error)

RunCmd runs the given command and returns the combined output and any error encountered. If there is an error running the command, RunCmd wraps it and includes the output of the command in the resulting error message.

func UpdateVersion added in v0.1.10

func UpdateVersion(c *config.Config) error

UpdateVersion updates the version file of the config project based on the given config info and commits and pushes the changes.

func VersionFileString

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

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

Types

type ColorSchemeColor

type ColorSchemeColor struct {
	XMLName xml.Name `xml:"color"`
	Name    string   `xml:"name,attr"`
	Color   string   `xml:",chardata"`
}

ColorSchemeColor contains the data for one color in a ColorSchemeData object.

func (*ColorSchemeColor) FixName

func (c *ColorSchemeColor) FixName()

Camel fixes the name of the color to be correctly formatted camel case with any prefixes removed

func (*ColorSchemeColor) IsDark

func (c *ColorSchemeColor) IsDark() bool

IsDark returns whether the color scheme color is a color for dark mode. It also removes the Light/Dark prefix from the color's name. It panics if it the color is for neither light nor dark mode.

func (*ColorSchemeColor) IsValid

func (c *ColorSchemeColor) IsValid() bool

IsValid returns whether the color is a valid color that can be used in a color scheme.

type ColorSchemeData

type ColorSchemeData struct {
	XMLName xml.Name           `xml:"resources"`
	Colors  []ColorSchemeColor `xml:",any"`
}

ColorSchemeData contains the data of a color scheme Material Theme Builder Android Views XML file.

func GetColorSchemeData

func GetColorSchemeData(fpath string) (ColorSchemeData, error)

GetColorSchemeData gets the ColorSchemeData from the XML file located at the given filepath.

type Command

type Command struct {
	Name string
	Args []string
}

Command is a command that can be used for installing and updating a package

type Commands

type Commands map[string][]*Command

Commands contains a set of commands for each operating system

type Package

type Package struct {
	ID              string   // the unique name of the package (ex: dev)
	Name            string   // the user friendly name of the package (ex: The GoKi Developer Tools)
	InstallCommands Commands // the set of commands to run for each operating system to install the package
}

Package contains all of the information about a package.

func LoadPackages

func LoadPackages() ([]Package, error)

LoadPackages loads all of the packages from the packages.json file

Jump to

Keyboard shortcuts

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