compiler

package
v0.0.0-...-e289d49 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: GPL-3.0 Imports: 20 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,
	gh *github.Client,
	execDir,
	errorDir,
	cacheDir,
	platform string,
	config build.Config,
	relative bool,
) (
	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(
	meta versioning.DependencyMeta,
	dir string,
	platform string,
	cacheDir string,
) (compiler download.Compiler, hit bool, err error)

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

func FromNet

func FromNet(
	ctx context.Context,
	gh *github.Client,
	meta versioning.DependencyMeta,
	dir string,
	platform string,
	cacheDir string,
) (compiler download.Compiler, err 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,
	gh *github.Client,
	config build.Config,
	dir string,
	platform string,
	cacheDir string,
) (compiler download.Compiler, err 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 PrepareCommand

func PrepareCommand(
	ctx context.Context,
	gh *github.Client,
	execDir,
	cacheDir,
	platform string,
	config build.Config,
) (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

This section is empty.

Jump to

Keyboard shortcuts

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