Documentation
¶
Overview ¶
Package toolchain resolves and installs tools selected by a project's pinned SDK.
Package toolchain resolves tools selected by a project's pinned SDK.
Index ¶
- func EnsureHost(ctx context.Context, manifest sdk.Manifest, target string) (string, error)
- func EnsureMaterialize(ctx context.Context, manifest sdk.Manifest, override string) (string, error)
- func Go(ctx context.Context, options GoOptions) (string, error)
- func Host(version, target string) (string, error)
- func InstallHost(ctx context.Context, version, target string, artifact sdk.ToolArtifact) (string, error)
- func InstallMaterialTool(ctx context.Context, options InstallMaterialToolOptions) (string, error)
- func InstallTinyGo(ctx context.Context, options InstallTinyGoOptions) (string, error)
- func InstallWasmTools(ctx context.Context, options InstallWasmToolsOptions) (string, error)
- func NativeHostName(platform string) string
- func NativePlatform(platform string) (string, error)
- func TinyGo(options TinyGoOptions) (string, error)
- func WasmTools(version string) (string, error)
- type EnsureOptions
- type EnsurePaths
- type GoOptions
- type InstallMaterialToolOptions
- type InstallTinyGoOptions
- type InstallWasmToolsOptions
- type MaterialTool
- type MaterialToolArtifact
- type MaterialToolSpec
- type TinyGoOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureHost ¶
EnsureHost installs the host selected by the project SDK when that SDK publishes a checksum-pinned release artifact.
func EnsureMaterialize ¶ added in v0.0.2
EnsureMaterialize selects only SDK-pinned release binaries or an explicit executable override. It never searches PATH, builds source or executes tools.
func InstallHost ¶
func InstallHost(ctx context.Context, version, target string, artifact sdk.ToolArtifact) (string, error)
InstallHost downloads, verifies, and atomically installs a raw host artifact.
func InstallMaterialTool ¶ added in v0.0.2
func InstallMaterialTool(ctx context.Context, options InstallMaterialToolOptions) (string, error)
InstallMaterialTool installs only the explicitly supplied verified binary. It never invokes a compiler, executes downloaded code, or resolves PATH. The verified archive is retained to recheck every file on warm installs; damaged caches fail closed and must be removed before reinstalling.
func InstallTinyGo ¶
func InstallTinyGo(ctx context.Context, options InstallTinyGoOptions) (string, error)
InstallTinyGo downloads, verifies, and atomically installs TinyGo.
func InstallWasmTools ¶
func InstallWasmTools(ctx context.Context, options InstallWasmToolsOptions) (string, error)
InstallWasmTools downloads, verifies, and atomically installs wasm-tools.
func NativeHostName ¶ added in v0.0.2
NativeHostName uses the destination OS, not the build machine's OS.
func NativePlatform ¶ added in v0.0.2
NativePlatform validates a game distribution target independently of installed tools.
func TinyGo ¶
func TinyGo(options TinyGoOptions) (string, error)
TinyGo returns the selected TinyGo executable. Selection order is explicit override, KARTY_TINYGO, then the CLI-managed user cache.
Types ¶
type EnsureOptions ¶
type EnsureOptions struct {
GoOverride string
TinyGoOverride string
WasmToolsOverride string
MaterializeOverride string
NeedGo bool
NeedTinyGo bool
NeedWasmTools bool
NeedMaterialize bool
}
EnsureOptions selects the SDK tools needed by a command. An explicit tool path is deliberately never downloaded or replaced.
type EnsurePaths ¶
EnsurePaths reports the resolved locations of tools that Ensure checked.
func Ensure ¶
func Ensure(ctx context.Context, manifest sdk.Manifest, options EnsureOptions) (EnsurePaths, error)
Ensure verifies that the selected SDK tools are ready to run, downloading missing managed tools into the checksum-verified Karty cache. It does not download tools supplied through command-line or environment overrides.
type InstallMaterialToolOptions ¶ added in v0.0.2
type InstallMaterialToolOptions struct {
Spec MaterialToolSpec
CacheDir string
Platform string // Empty selects runtime.GOOS + "-" + runtime.GOARCH.
Download func(context.Context, string) (io.ReadCloser, error)
}
type InstallTinyGoOptions ¶
type InstallTinyGoOptions struct {
Version string
Artifact sdk.ToolArtifact
CacheDir string
Platform string
Download func(context.Context, string) (io.ReadCloser, error)
}
InstallTinyGoOptions identifies a TinyGo release and where to install it.
type InstallWasmToolsOptions ¶
type InstallWasmToolsOptions struct {
Version string
Artifact sdk.ToolArtifact
CacheDir string
Platform string
Download func(context.Context, string) (io.ReadCloser, error)
}
InstallWasmToolsOptions identifies a wasm-tools release and where to install it.
type MaterialTool ¶ added in v0.0.2
type MaterialTool string
MaterialTool identifies a binary tool, not a source build or the Unity editor.
const (
MaterialToolMaterialize MaterialTool = "materialize-cli" // AiGameKit Materialize Rust CLI.
)
type MaterialToolArtifact ¶ added in v0.0.2
type MaterialToolArtifact struct {
URL string
SHA256 string
Format string // "zip"; never inferred from the URL.
Executable string
}
MaterialToolArtifact describes a publisher-supplied, checksum-pinned archive. Executable is its exact slash-separated member path; all other regular files (including licenses and notices) are preserved alongside it.
type MaterialToolSpec ¶ added in v0.0.2
type MaterialToolSpec struct {
Tool MaterialTool
Revision string
Artifacts map[string]MaterialToolArtifact
}
MaterialToolSpec pins a full Git commit and per-developer-platform artifacts. MaterializeSpec adapts optional released SDK pins to this installer contract; released SDKs select Materialize. No PATH fallback exists.
func MaterializeSpec ¶ added in v0.0.2
func MaterializeSpec(manifest sdk.Manifest) (MaterialToolSpec, error)
MaterializeSpec adapts a complete SDK pin without changing installer bounds. An absent pin is valid SDK metadata, but cannot select a managed installation.