build

package
v0.0.0-...-4152256 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2017 License: BSD-2-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuildContext

func NewBuildContext(installSuffix string, buildTags []string) *build.Context

func NewMappingCallback

func NewMappingCallback(m *sourcemap.Map, goroot, gopath string, localMap bool) func(generatedLine, generatedColumn int, originalPos token.Position)

Types

type ImportCError

type ImportCError struct {
	// contains filtered or unexported fields
}

func (*ImportCError) Error

func (e *ImportCError) Error() string

type Options

type Options struct {
	GOROOT         string
	GOPATH         string
	Verbose        bool
	Quiet          bool
	Watch          bool
	CreateMapFile  bool
	MapToLocalDisk bool
	Minify         bool
	Color          bool
	BuildTags      []string
}

func (*Options) PrintError

func (o *Options) PrintError(format string, a ...interface{})

func (*Options) PrintSuccess

func (o *Options) PrintSuccess(format string, a ...interface{})

type PackageData

type PackageData struct {
	*build.Package
	JSFiles    []string
	IsTest     bool // IsTest is true if the package is being built for running tests.
	SrcModTime time.Time
	UpToDate   bool
}

func Import

func Import(path string, mode build.ImportMode, installSuffix string, buildTags []string) (*PackageData, error)

Import returns details about the Go package named by the import path. If the path is a local import path naming a package that can be imported using a standard import path, the returned package will set p.ImportPath to that path.

In the directory containing the package, .go and .inc.js files are considered part of the package except for:

  • .go files in package documentation
  • files starting with _ or . (likely editor temporary files)
  • files with build constraints not satisfied by the context

If an error occurs, Import returns a non-nil error and a nil *PackageData.

func ImportDir

func ImportDir(dir string, mode build.ImportMode, installSuffix string, buildTags []string) (*PackageData, error)

ImportDir is like Import but processes the Go package found in the named directory.

type Session

type Session struct {
	Archives map[string]*compiler.Archive
	Types    map[string]*types.Package
	Watcher  *fsnotify.Watcher
	// contains filtered or unexported fields
}

func NewSession

func NewSession(options *Options) *Session

func (*Session) BuildDir

func (s *Session) BuildDir(packagePath string, importPath string, pkgObj string) error

func (*Session) BuildFiles

func (s *Session) BuildFiles(filenames []string, pkgObj string, packagePath string) error

func (*Session) BuildImportPath

func (s *Session) BuildImportPath(path string) (*compiler.Archive, error)

func (*Session) BuildPackage

func (s *Session) BuildPackage(pkg *PackageData) (*compiler.Archive, error)

func (*Session) InstallSuffix

func (s *Session) InstallSuffix() string

func (*Session) WaitForChange

func (s *Session) WaitForChange()

func (*Session) WriteCommandPackage

func (s *Session) WriteCommandPackage(archive *compiler.Archive, pkgObj string) error

Jump to

Keyboard shortcuts

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