xgobuild

package
v0.60.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// StaticLoad is a mode flag that disables dynamic Importer creation.
	// When StaticLoad is set, the Context will use only the base Loader
	// for package imports instead of creating a dynamic ixgo.Importer.
	// This mode is useful for scenarios where all packages are pre-loaded
	// or when dynamic importing is not needed.
	StaticLoad = ixgo.LastMode * 2
	// NormalizeExport is a mode flag that normalizes package patch exports.
	// When NormalizeExport is set, objects from package patches are re-exported
	// with the base package as their owner, rather than the patch package.
	// This allows patch symbols to appear as if they belong to the original package
	// (e.g., gsh.Point instead of gsh@patch.Point), providing a cleaner API.
	NormalizeExport = ixgo.LastMode * 4
)

Variables

This section is empty.

Functions

func BuildDir

func BuildDir(ctx *ixgo.Context, dir string) (data []byte, err error)

func BuildFSDir

func BuildFSDir(ctx *ixgo.Context, fs parser.FileSystem, dir string) (data []byte, err error)

func BuildFile

func BuildFile(ctx *ixgo.Context, filename string, src interface{}) (data []byte, err error)

func ClassKind

func ClassKind(fname string) (isProj, ok bool)

func RegisterClassFileType

func RegisterClassFileType(ext string, class string, works []*modfile.Class, pkgPaths ...string)

func RegisterPackagePatch

func RegisterPackagePatch(ctx *ixgo.Context, path string, src interface{}) error

func RegisterProject

func RegisterProject(proj *modfile.Project)

Types

type Class

type Class = modfile.Class

type Context

type Context struct {
	Context  *ixgo.Context
	FileSet  *token.FileSet
	Importer types.Importer
	Loader   ixgo.Loader
	// contains filtered or unexported fields
}

func NewContext

func NewContext(ctx *ixgo.Context) *Context

func (*Context) Import

func (c *Context) Import(path string) (*types.Package, error)

func (*Context) ParseDir

func (c *Context) ParseDir(dir string) (*Package, error)

func (*Context) ParseFSDir

func (c *Context) ParseFSDir(fs parser.FileSystem, dir string) (*Package, error)

func (*Context) ParseFile

func (c *Context) ParseFile(fname string, src interface{}) (*Package, error)

type Import

type Import = modfile.Import

type Package

type Package struct {
	Fset *token.FileSet
	Pkgs []*gogen.Package
}

func (*Package) ForEachFile

func (p *Package) ForEachFile(fn func(pkg *gogen.Package, fname string))

func (*Package) MainPkg

func (p *Package) MainPkg() *gogen.Package

func (*Package) ToAst

func (p *Package) ToAst() (*goast.File, error)

func (*Package) ToSource

func (p *Package) ToSource() ([]byte, error)

type Project

type Project = modfile.Project

Directories

Path Synopsis
pkg
gsh
tpl
xgo

Jump to

Keyboard shortcuts

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