Documentation
¶
Overview ¶
Package compiler provides an API for acquiring the compiler binaries and compiling Pawn code
Index ¶
- func CompileSource(ctx context.Context, request CompileRequest) (problems build.Problems, result build.Result, err error)
- func CompileWithCommand(cmd *exec.Cmd, workingDir, errorDir string, relative bool) (problems build.Problems, result build.Result, err error)
- func FromCache(request CompilerFetchRequest) (download.Compiler, bool, error)
- func FromCacheContext(ctx context.Context, request CompilerFetchRequest) (download.Compiler, bool, error)
- func FromNet(ctx context.Context, request CompilerFetchRequest) (download.Compiler, error)
- func GetCompilerFilename(version, platform, method string) string
- func GetCompilerPackage(ctx context.Context, request CompilerFetchRequest) (download.Compiler, error)
- func GetCompilerPackageInfo(cacheDir, platform string) (compiler download.Compiler, err error)
- func GetCompilerPackageInfoContext(ctx context.Context, cacheDir, platform string) (compiler download.Compiler, err error)
- func PrepareCommand(ctx context.Context, request PrepareCommandRequest) (cmd *exec.Cmd, err error)
- func RunPostBuildCommands(ctx context.Context, cfg build.Config, output io.Writer) (err error)
- func RunPreBuildCommands(ctx context.Context, cfg build.Config, output io.Writer) (err error)
- type CompileRequest
- type CompilerFetchRequest
- type PrepareCommandRequest
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 GetCompilerFilename ¶
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 ¶
GetCompilerPackageInfo returns the URL for a specific compiler version
func PrepareCommand ¶
PrepareCommand prepares a build command for compiling the given input script
func RunPostBuildCommands ¶
RunPostBuildCommands executes commands after a build is ran for a certain build config
Types ¶
type CompileRequest ¶
type CompilerFetchRequest ¶
type CompilerFetchRequest struct {
GitHub *github.Client
Meta versioning.DependencyMeta
Dir string
Platform string
CacheDir string
}