Documentation
¶
Overview ¶
Package ccgo implements the ccgo command.
Index ¶
- Constants
- func AbsCwd() (string, error)
- func Compile(args ...string) ([]byte, error)
- func CopyDir(dst, src string, canOverwrite func(fn string, fi os.FileInfo) bool) (files int, bytes int64, rerr error)
- func CopyFile(dst, src string, canOverwrite func(fn string, fi os.FileInfo) bool) (n int64, rerr error)
- func Env(key, dflt string) string
- func Fatal(stackTrace bool, args ...interface{})
- func Fatalf(stackTrace bool, s string, args ...interface{})
- func InDir(dir string, f func() error) (err error)
- func Mkdirs(paths ...string) error
- func MustAbsCwd(stackTrace bool) string
- func MustCompile(stackTrace bool, args ...string) []byte
- func MustCopyDir(stackTrace bool, dst, src string, ...) (files int, bytes int64)
- func MustCopyFile(stackTrace bool, dst, src string, ...) int64
- func MustInDir(stackTrace bool, dir string, f func() error)
- func MustMkdirs(stackTrace bool, paths ...string)
- func MustRun(stackTrace bool, args ...string) []byte
- func MustShell(stackTrace bool, cmd string, args ...string) []byte
- func MustTempDir(stackTrace bool, dir, name string) string
- func MustUntar(stackTrace bool, dst string, r io.Reader, ...)
- func MustUntarFile(stackTrace bool, dst, src string, ...)
- func Run(args ...string) ([]byte, error)
- func Shell(cmd string, args ...string) ([]byte, error)
- func Untar(dst string, r io.Reader, canOverwrite func(fn string, fi os.FileInfo) bool) error
- func UntarFile(dst, src string, canOverwrite func(fn string, fi os.FileInfo) bool) error
- type Task
Constants ¶
const (
Version = "3.12.6-20210922111124"
)
Variables ¶
This section is empty.
Functions ¶
func CopyDir ¶ added in v3.8.19
func CopyDir(dst, src string, canOverwrite func(fn string, fi os.FileInfo) bool) (files int, bytes int64, rerr error)
CopyDir recursively copies src to dest, preserving permissions and times where/when possible. If canOverwrite is not nil, it is consulted whether a destination file can be overwritten. If canOverwrite is nil then destination is overwritten if permissions allow that, otherwise the function fails.
Src and dst must be in the slash form.
func CopyFile ¶ added in v3.8.19
func CopyFile(dst, src string, canOverwrite func(fn string, fi os.FileInfo) bool) (n int64, rerr error)
CopyFile copies src to dest, preserving permissions and times where/when possible. If canOverwrite is not nil, it is consulted whether a destination file can be overwritten. If canOverwrite is nil then destination is overwritten if permissions allow that, otherwise the function fails.
Src and dst must be in the slash form.
func Fatal ¶ added in v3.8.19
func Fatal(stackTrace bool, args ...interface{})
Fatal prints its argumenst to os.Stderr and performs os.Exit(1). A stack trace is added if stackTrace is true.
func Fatalf ¶ added in v3.8.19
Fatalf prints a formatted message to os.Stderr and performs os.Exit(1). A stack trace is added if stackTrace is true.
func MustAbsCwd ¶ added in v3.8.19
MustAbsCwd is like AbsCwd but executes Fatal(stackTrace, err) if it fails.
func MustCompile ¶ added in v3.8.19
MustCompile is like Compile but if executes Fatal(stackTrace, err) if it fails.
func MustCopyDir ¶ added in v3.8.19
func MustCopyDir(stackTrace bool, dst, src string, canOverwrite func(fn string, fi os.FileInfo) bool) (files int, bytes int64)
MustCopyDir is like CopyDir, but it executes Fatal(stackTrace, errú if it fails.
func MustCopyFile ¶ added in v3.8.19
func MustCopyFile(stackTrace bool, dst, src string, canOverwrite func(fn string, fi os.FileInfo) bool) int64
MustCopyFile is like CopyFile but it executes Fatal(stackTrace, err) if it fails.
func MustInDir ¶ added in v3.8.19
MustInDir is like InDir but it executes Fatal(stackTrace, err) if it fails.
func MustMkdirs ¶ added in v3.8.19
MustMkdirs is like Mkdir but if executes Fatal(stackTrace, err) if it fails.
func MustRun ¶ added in v3.12.43
MustRun is like Run but if executes Fatal(stackTrace, err) if it fails.
func MustShell ¶ added in v3.8.19
MustShell is like Shell but it executes Fatal(stackTrace, err) if it fails.
func MustTempDir ¶ added in v3.8.19
MustTempDir is like ioutil.TempDir but executes Fatal(stackTrace, err) if it fails. The returned path is absolute.
func MustUntar ¶ added in v3.8.19
func MustUntar(stackTrace bool, dst string, r io.Reader, canOverwrite func(fn string, fi os.FileInfo) bool)
MustUntar is like Untar but it executes Fatal(stackTrace, err) if it fails.
func MustUntarFile ¶ added in v3.8.19
func MustUntarFile(stackTrace bool, dst, src string, canOverwrite func(fn string, fi os.FileInfo) bool)
MustUntarFile is like UntarFile but it executes Fatal(stackTrace, err) if it fails.
func Shell ¶ added in v3.8.19
Shell echoes and executes cmd with args and returns the combined output if the command.
func Untar ¶ added in v3.8.19
Untar extracts a tar.gz archive into dst. If canOverwrite is not nil, it is consulted whether a destination file can be overwritten. If canOverwrite is nil then destination is overwritten if permissions allow that, otherwise the function fails.
Dst must be in the slash form.
func UntarFile ¶ added in v3.8.19
UntarFile extracts a named tar.gz archive into dst. If canOverwrite is not nil, it is consulted whether a destination file can be overwritten. If canOverwrite is nil then destination is overwritten if permissions allow that, otherwise the function fails.
Src and dst must be in the slash form.
Types ¶
type Task ¶
type Task struct { D []string // -D I []string // -I U []string // -U // Path to a binary that will be called instead of executing // Task.Main(). Intended to support TestGenerate in stable vs latest // modes. This is _not_ supposed to be used when the Task instance is // constructed by a ccgo _command_ (ccgo/v3) - it should never set this // field. Only programs importing ccgo/v3/lib that opt-in into this // feature should ever set it. CallOutBinary string E bool // -E // contains filtered or unexported fields }
Task represents a compilation job.