build

package
v0.0.0-...-e758773 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2011 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package build provides tools for building Go packages.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = os.NewError("package could not be found locally")
View Source
var Path []*Tree

Path is a validated list of Trees derived from $GOPATH at init.

Functions

func ArchChar

func ArchChar(goarch string) (string, os.Error)

ArchChar returns the architecture character for the given goarch. For example, ArchChar("amd64") returns "6".

Types

type Cmd

type Cmd struct {
	Args   []string // command-line
	Stdout string   // write standard output to this file, "" is passthrough
	Input  []string // file paths (dependencies)
	Output []string // file paths
}

func (*Cmd) Clean

func (c *Cmd) Clean(dir string) (err os.Error)

func (*Cmd) Run

func (c *Cmd) Run(dir string) os.Error

func (*Cmd) String

func (c *Cmd) String() string

type DirInfo

type DirInfo struct {
	GoFiles  []string // .go files in dir (excluding CgoFiles)
	CgoFiles []string // .go files that import "C"
	CFiles   []string // .c files in dir
	SFiles   []string // .s files in dir
	Imports  []string // All packages imported by goFiles
	PkgName  string   // Name of package in dir
}

func ScanDir

func ScanDir(dir string, allowMain bool) (info *DirInfo, err os.Error)

ScanDir returns a structure with details about the Go content found in the given directory. The file lists exclude:

  • files in package main (unless allowMain is true)
  • files in package documentation
  • files ending in _test.go
  • files starting with _ or .

Only files that satisfy the goodOSArch function are included.

func (*DirInfo) Build

func (d *DirInfo) Build(targ string) ([]*Cmd, os.Error)

func (*DirInfo) IsCommand

func (d *DirInfo) IsCommand() bool

type Tree

type Tree struct {
	Path   string
	Goroot bool
}

Tree describes a Go source tree, either $GOROOT or one from $GOPATH.

func FindTree

func FindTree(path string) (tree *Tree, pkg string, err os.Error)

FindTree takes an import or filesystem path and returns the tree where the package source should be and the package import path.

func (*Tree) BinDir

func (t *Tree) BinDir() string

BinDir returns the tree's binary executable directory.

func (*Tree) HasPkg

func (t *Tree) HasPkg(pkg string) bool

HasPkg returns whether the given package's object file can be found inside this Tree.

func (*Tree) HasSrc

func (t *Tree) HasSrc(pkg string) bool

HasSrc returns whether the given package's source can be found inside this Tree.

func (*Tree) PkgDir

func (t *Tree) PkgDir() string

PkgDir returns the tree's package object directory.

func (*Tree) SrcDir

func (t *Tree) SrcDir() string

SrcDir returns the tree's package source directory.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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