releaseplan

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package releaseplan plans and formats `nsgo build` release invocations and credits checks shared by `cmd/game release` and the scene editor's Export panel.

Index

Constants

View Source
const DefaultOutput = "dist"

DefaultOutput is the directory nsgo build writes to when nsgo.yaml's build.output is empty, from NSGo v0.3.0's cmd/nsgo/project.go.

View Source
const NoCreditsNote = "game release: note: game.yaml has no assets section, so no " + credits.FileName + " is written; credit the assets the game ships yourself"

NoCreditsNote is what game release prints when game.yaml has no assets section, and so no credits file is written.

Variables

View Source
var Channels = []string{"direct", "store", "steam", "none"}

Channels are the distribution channels nsgo build accepts for -channel.

View Source
var DefaultPlatforms = []string{"macos", "windows", "linux", "web", "ios", "android"}

DefaultPlatforms are what game release builds when neither -target nor game.yaml's export presets say otherwise, as nsgo build -target names them: macos, windows, linux and android expand to their architectures, and ios and web are one target each.

View Source
var ErrInvalidTarget = errors.New("invalid target")

ErrInvalidTarget is wrapped when Options.Targets contains an empty target entry.

View Source
var SteamPlatforms = []string{"macos", "windows", "linux"}

SteamPlatforms are what game release builds by default for the steam channel, whose depots nsgo build makes only of desktop targets.

Functions

func Args

func Args(dir string, opts Options, settings Settings, nsgo NSGoSettings) ([]string, error)

Args returns the arguments of the go command that builds the project in dir: go -C dir tool nsgo build with the targets and output resolved from opts, then game.yaml's settings, then the defaults, the channel coming from opts, then nsgo.yaml. nsgo.yaml's build.targets is not a default: it is plain nsgo build's everyday list, which in the starter holds a simulator build and leaves out Linux. Paths in opts are relative to the working directory, and game.yaml's output to dir.

func OutputDir

func OutputDir(dir string, opts Options, settings Settings, nsgo NSGoSettings) (string, error)

OutputDir returns the absolute directory nsgo build writes the release to, as Args passes it and nsgo resolves it: -output, relative to the working directory, else game.yaml's export.output, else nsgo.yaml's build.output, else dist, these relative to dir.

func ShellQuote

func ShellQuote(args []string) string

ShellQuote writes args as one line a POSIX shell reads back as the same arguments.

func WriteDryRun

func WriteDryRun(w io.Writer, p *Plan)

WriteDryRun writes the exact dry-run lines printed by `game release -dry-run` for p.

Types

type NSGoSettings

type NSGoSettings struct {
	// Channel is updates.channel, the channel nsgo build hands the packages out through when -channel does not say.
	Channel string
	// Output is build.output, the directory nsgo build writes to when neither -output nor game.yaml's export.output says, relative to the project unless absolute; empty is nsgo's default, dist.
	Output string
}

NSGoSettings are the parts of nsgo.yaml that game release reads.

func ReadNSGoSettings

func ReadNSGoSettings(dir string) (NSGoSettings, error)

ReadNSGoSettings reads dir's nsgo.yaml. The file is nsgo's, which validates it when it builds, so fields game release does not read are left alone rather than refused.

type Options

type Options struct {
	// Targets is -target, comma-separated; empty takes game.yaml's presets, else SteamPlatforms for the steam channel, else DefaultPlatforms.
	Targets string
	// Output is -output; empty takes game.yaml's export.output, else nsgo.yaml's build.output.
	Output string
	// Channel is -channel, which nsgo build takes as the channel the packages are handed out through.
	Channel string
	// Notes is -release-notes, a Markdown file nsgo build puts in the appcasts.
	Notes string
	// Jobs is -jobs, how many targets build at once; 0 leaves nsgo's default.
	Jobs int
}

Options are game release's build flags.

type Plan

type Plan struct {
	// Dir is the absolute project directory.
	Dir string
	// Args are the arguments passed to the `go` command.
	Args []string
	// CommandLine is the POSIX-quoted `go ...` command printed by -dry-run.
	CommandLine string
	// OutputDir is the resolved absolute directory where release packages are written.
	OutputDir string
	// AssetsConfigured reports whether game.yaml declared an assets section.
	AssetsConfigured bool
	// Credits are the collected asset credits when AssetsConfigured is true.
	Credits []credits.Entry
	// CreditsPath is the full path where CREDITS.md will be written, or empty when AssetsConfigured is false.
	CreditsPath string
}

Plan is a validated release build plan ready for dry-run printing or execution.

func Build

func Build(dir string, opts Options, settings Settings) (*Plan, error)

Build resolves nsgo.yaml, command arguments, output directory, and asset credits for a release build in dir. It fails before building when nsgo.yaml is missing, options are invalid, or any declared asset has no credit (*credits.MissingError).

type Settings

type Settings struct {
	// Output is export.output, a slash-separated directory inside the project; empty leaves nsgo.yaml's build.output.
	Output string
	// Targets are the presets' targets in order, a preset without targets giving its platform name; nil without presets.
	Targets []string
	// Assets is the assets section as package project parses it with the whole file; nil when game.yaml has none, and then no credits file is written.
	Assets *project.Assets
}

Settings are the parts of game.yaml that game release reads: the build output directory, the build targets of the export presets and the assets section, whose assets the credits file lists.

func SettingsFromProject

func SettingsFromProject(f *project.File) Settings

SettingsFromProject extracts release Settings from an in-memory project.File.

Jump to

Keyboard shortcuts

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