gazelle

package
v0.0.0-...-9f81d63 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

README

Starzelle BUILD generator

A BUILD generator where plugins implemented in Starlark can be used to generate BUILD files for bazel projects.

See Starlark spec, core Starlark data types, Starlark github-linguist for general Starlark docs and information.

See Public Docsite for the plugin Starzelle API and documentation.

Plugins via env

Additional plugins will be loaded from ${STARZELLE_PLUGINS}/*.lang.star glob.

FOR TESTING ONLY: by default STARZELLE_PLUGINS=${RUNFILES_DIR}/aspect_silo/plugins/*.lang.star for unit tests.

TODO:

Documentation

Index

Constants

View Source
const GazelleLanguageName = "aspect-configure"
View Source
const (
	// TODO: move to common
	MaxWorkerCount = 12
)

Variables

This section is empty.

Functions

func NewLanguage

func NewLanguage(plugins ...string) gazelleLanguage.Language

Types

type BUILDConfig

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

func NewRootConfig

func NewRootConfig(repoName string) *BUILDConfig

func (*BUILDConfig) GetResolution

func (c *BUILDConfig) GetResolution(imprt string) *label.Label

func (*BUILDConfig) IsPluginEnabled

func (c *BUILDConfig) IsPluginEnabled(pluginId plugin.PluginId) bool

func (*BUILDConfig) NewChildConfig

func (c *BUILDConfig) NewChildConfig(rel string) *BUILDConfig

type GazelleHost

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

A gazelle

func (*GazelleHost) AddKind

func (h *GazelleHost) AddKind(k plugin.RuleKind)

func (*GazelleHost) AddPlugin

func (h *GazelleHost) AddPlugin(plugin plugin.Plugin)

func (*GazelleHost) ApparentLoads

func (h *GazelleHost) ApparentLoads(moduleToApparentName func(string) string) []rule.LoadInfo

func (*GazelleHost) CheckFlags

func (c *GazelleHost) CheckFlags(fs *flag.FlagSet, cfg *config.Config) error

func (*GazelleHost) Configure

func (configurer *GazelleHost) Configure(c *config.Config, rel string, f *rule.File)

func (*GazelleHost) CrossResolve

func (ts *GazelleHost) CrossResolve(c *config.Config, ix *resolve.RuleIndex, imp resolve.ImportSpec, lang string) []resolve.FindResult

Support imports from other gazelle extensions resolving to symbols provided by starzelle plugins.

func (*GazelleHost) Embeds

func (re *GazelleHost) Embeds(r *rule.Rule, f label.Label) []label.Label

Extra targets embedded within rules.

func (*GazelleHost) Fix

func (*GazelleHost) Fix(c *config.Config, f *rule.File)

func (*GazelleHost) GenerateRules

Gazelle GenerateRules phase - declare:

  • which rules to delete (GenerateResult.Empty)
  • which rules to create (or merge with existing) and their associated metadata (GenerateResult.Gen + GenerateResult.Imports)

func (*GazelleHost) Imports

func (re *GazelleHost) Imports(c *config.Config, r *rule.Rule, f *rule.File) []resolve.ImportSpec

Determine what rule (r) outputs which can be imported.

func (*GazelleHost) Kinds

func (h *GazelleHost) Kinds() map[string]rule.KindInfo

func (*GazelleHost) KnownDirectives

func (c *GazelleHost) KnownDirectives() []string

func (*GazelleHost) LoadPlugin

func (h *GazelleHost) LoadPlugin(pluginDir, pluginPath string)

func (*GazelleHost) Loads

func (h *GazelleHost) Loads() []rule.LoadInfo

func (*GazelleHost) Name

func (*GazelleHost) Name() string

func (*GazelleHost) RegisterFlags

func (c *GazelleHost) RegisterFlags(fs *flag.FlagSet, cmd string, cfg *config.Config)

func (*GazelleHost) Resolve

func (re *GazelleHost) Resolve(c *config.Config, ix *resolve.RuleIndex, rc *repo.RemoteCache, r *rule.Rule, importData interface{}, from label.Label)

Resolve the dependencies of a rule and apply them to the necessary rule attributes.

type ResolutionType

type ResolutionType = int
const (
	Resolution_Error ResolutionType = iota
	Resolution_None
	Resolution_NotFound
	Resolution_Label
	Resolution_Native
	Resolution_Override
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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