paket

package module
v0.0.0-...-6278b43 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: BSL-1.0 Imports: 11 Imported by: 0

README

Paket

License codecov Test Pre-Commit Hooks Go Reference Go Report Card

Work in progress.

Cross-platform meta installer generator. Primarily targets Windows InnoSetup & macOS pkgbuild/productbuild.

Quick Start

Application
name       = "Example App"
vendor     = "Modern Circuits"
version    = "0.1.0"
license    = "LICENSE.txt"
identifier = "com.modern-circuits.example-app"

installer "macOS" "macos-pkg" {
  artifact "App" {
    payload     = "macOS/${project.name}.app"
    destination = "/Application"
  }
}

installer "Windows" "innosetup" {
  artifact "App" {
    payload     = "Windows/${project.name}.exe"
    destination = "{commonpf64}/${project.vendor}"
  }
}
Audio Effect
name       = "Example Effect"
vendor     = "Modern Circuits"
version    = "0.1.0"
license    = "LICENSE.txt"
identifier = "com.modern-circuits.example-effect"

installer "macOS" "macos-pkg" {
  artifact "AU" {
    name        = "Audio Unit"
    version     = "0.1.1"
    payload     = "macOS/AU/${project.name}.component"
    destination = "/Library/Audio/Plug-Ins/AU"
  }

  artifact "VST3" {
    payload     = "macOS/VST3/${project.name}.vst3"
    destination = "/Library/Audio/Plug-Ins/VST3"
  }

  artifact "CLAP" {
    payload     = "macOS/CLAP/${project.name}.clap"
    destination = "/Library/Audio/Plug-Ins/CLAP"
  }
}

installer "Windows" "innosetup" {
  artifact "VST3" {
    payload     = "Windows/VST3/${project.name}.vst3"
    destination = "{commoncf64}/VST3"
  }

  artifact "CLAP" {
    payload     = "Windows/CLAP/${project.name}.clap"
    destination = "{commoncf64}/CLAP"
  }
}

Resources

Text Formats
macOS

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatHTML

func FormatHTML(html []byte) []byte

FormatHTML converts HTML to pretty HTML.

func MarkdownFileToHTML

func MarkdownFileToHTML(file string) []byte

MarkdownFileToHTML converts a markdown file to HTML. The output is sanitized using bluemonday.

func MarkdownToHTML

func MarkdownToHTML(md []byte) []byte

MarkdownToHTML converts a markdown byte slice to HTML. The output is sanitized using bluemonday.

Types

type Artifact

type Artifact struct {
	Tag         string `hcl:"tag,label" json:"tag"`
	Name        string `hcl:"name,optional" json:"name,omitempty"`
	Version     string `hcl:"version,optional" json:"version,omitempty"`
	Payload     string `hcl:"payload" json:"payload"`
	Destination string `hcl:"destination" json:"destination"`
}

type Generator

type Generator interface {
	// Info describes the generator.
	Info() GeneratorInfo

	// Converts the hcl installer block configuration into a more specific form
	// understood by this generator.
	Configure(Project, *hcl.EvalContext, hcl.Body) error

	// Creates the build  environment including folders and configuration files
	// needed by the generator.
	Build(io.Writer) error

	// Runs the generator. This may be a no-op for some generators.
	Run(io.Writer) error

	// Import a platform specific configuration from a reader. The reader will
	// probably come from a configuration file like an InnoSetup *.iss file or
	// a pkgbuild/productbuild *.xml distribution file. Roundtrip import/export
	// is most likely lossy.
	Import(io.Reader) (*Project, error)

	// Export a platform specific configuration to a writer. Roundtrip
	// import/export is most likely lossy.
	Export(Project, io.Writer) error
}

An installer generator backend. e.g. InnoSetup on windows or pkgbuild/productbuild on macOS.

type GeneratorInfo

type GeneratorInfo struct {
	Tag        string
	RunnableOn []string
}

type NullGenerator

type NullGenerator struct {
}

NullGenerator implements paket.Generator. Does nothing. Fails never.

func (NullGenerator) Build

func (ng NullGenerator) Build(io.Writer) error

Configure implements paket.Generator

func (NullGenerator) Configure

func (ng NullGenerator) Configure(Project, *hcl.EvalContext, hcl.Body) error

Export implements paket.Generator

func (NullGenerator) Export

func (ng NullGenerator) Export(Project, io.Writer) error

Import implements paket.Generator

func (NullGenerator) Import

func (ng NullGenerator) Import(io.Reader) (*Project, error)

Run implements paket.Generator

func (NullGenerator) Info

func (ng NullGenerator) Info() GeneratorInfo

Info implements paket.Generator

func (NullGenerator) Run

func (ng NullGenerator) Run(io.Writer) error

Build implements paket.Generator

type Project

type Project struct {
	Name       string
	Vendor     string
	Identifier string
	Version    string
	License    string
	WorkDir    string
	Installers []Generator
}

type Runner

type Runner struct {
	WorkDir string
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner() *Runner

func (*Runner) ReadProject

func (r *Runner) ReadProject(buf []byte, path string) (*Project, error)

func (*Runner) ReadProjectFile

func (r *Runner) ReadProjectFile(path string) (*Project, error)

func (*Runner) RegisterGenerator

func (r *Runner) RegisterGenerator(g Generator) error

func (*Runner) RegisterGenerators

func (r *Runner) RegisterGenerators(generators []Generator) error

Directories

Path Synopsis
cmd
windows

Jump to

Keyboard shortcuts

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