compiler

package
v0.0.0-...-4a443f2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package compiler provides an API for acquiring the compiler binaries and compiling Pawn code

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileSource

func CompileSource(
	ctx context.Context,
	request CompileRequest,
) (
	problems build.Problems,
	result build.Result,
	err error,
)

CompileSource compiles a given input script to the specified output path using compiler version

func CompileWithCommand

func CompileWithCommand(
	cmd *exec.Cmd,
	workingDir,
	errorDir string,
	relative bool,
) (problems build.Problems, result build.Result, err error)

CompileWithCommand takes a prepared command and executes it

func FromCache

func FromCache(request CompilerFetchRequest) (download.Compiler, bool, error)

FromCache attempts to get a compiler package from the cache, `hit` represents success

func FromCacheContext

func FromCacheContext(ctx context.Context, request CompilerFetchRequest) (download.Compiler, bool, error)

func FromNet

func FromNet(ctx context.Context, request CompilerFetchRequest) (download.Compiler, error)

FromNet downloads a compiler package to the cache

func GetCompilerFilename

func GetCompilerFilename(version, platform, method string) string

GetCompilerFilename returns the path to a compiler given its platform and version number.

func GetCompilerPackage

func GetCompilerPackage(ctx context.Context, request CompilerFetchRequest) (download.Compiler, error)

GetCompilerPackage downloads and installs a Pawn compiler to a user directory

func GetCompilerPackageInfo

func GetCompilerPackageInfo(cacheDir, platform string) (compiler download.Compiler, err error)

GetCompilerPackageInfo returns the URL for a specific compiler version

func GetCompilerPackageInfoContext

func GetCompilerPackageInfoContext(ctx context.Context, cacheDir, platform string) (compiler download.Compiler, err error)

func PrepareCommand

func PrepareCommand(ctx context.Context, request PrepareCommandRequest) (cmd *exec.Cmd, err error)

PrepareCommand prepares a build command for compiling the given input script

func RunPostBuildCommands

func RunPostBuildCommands(ctx context.Context, cfg build.Config, output io.Writer) (err error)

RunPostBuildCommands executes commands after a build is ran for a certain build config

func RunPreBuildCommands

func RunPreBuildCommands(ctx context.Context, cfg build.Config, output io.Writer) (err error)

RunPreBuildCommands executes commands before a build is ran for a certain build config

Types

type CompileRequest

type CompileRequest struct {
	GitHub   *github.Client
	ExecDir  string
	ErrorDir string
	CacheDir string
	Platform string
	Config   build.Config
	Relative bool
}

type CompilerFetchRequest

type CompilerFetchRequest struct {
	GitHub   *github.Client
	Meta     versioning.DependencyMeta
	Dir      string
	Platform string
	CacheDir string
}

type PrepareCommandRequest

type PrepareCommandRequest struct {
	GitHub   *github.Client
	ExecDir  string
	CacheDir string
	Platform string
	Config   build.Config
}

Jump to

Keyboard shortcuts

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