Documentation ¶
Index ¶
- type JavaProvider
- func (p *JavaProvider) CanProvide(dep *resolver.ImportLabel, expr build.Expr, ...) bool
- func (p *JavaProvider) CheckFlags(fs *flag.FlagSet, c *config.Config, scope resolver.Scope) error
- func (p *JavaProvider) Name() string
- func (p *JavaProvider) OnEnd() error
- func (p *JavaProvider) OnResolve() error
- func (p *JavaProvider) RegisterFlags(fs *flag.FlagSet, cmd string, c *config.Config)
- type MavenProvider
- func (p *MavenProvider) CanProvide(dep *resolver.ImportLabel, expr build.Expr, ...) bool
- func (p *MavenProvider) CheckFlags(fs *flag.FlagSet, c *config.Config, scope resolver.Scope) error
- func (p *MavenProvider) Name() string
- func (p *MavenProvider) OnEnd() error
- func (p *MavenProvider) OnResolve() error
- func (p *MavenProvider) RegisterFlags(fs *flag.FlagSet, cmd string, c *config.Config)
- type ProtobufProvider
- func (p *ProtobufProvider) CanProvide(dep *resolver.ImportLabel, expr build.Expr, ...) bool
- func (p *ProtobufProvider) CheckFlags(fs *flag.FlagSet, c *config.Config, scope resolver.Scope) error
- func (p *ProtobufProvider) Name() string
- func (p *ProtobufProvider) OnEnd() error
- func (p *ProtobufProvider) OnResolve() error
- func (p *ProtobufProvider) RegisterFlags(fs *flag.FlagSet, cmd string, c *config.Config)
- type ProvidedImports
- type SemanticdbProvider
- func (cr *SemanticdbProvider) CanProvide(dep *resolver.ImportLabel, expr build.Expr, ...) bool
- func (r *SemanticdbProvider) CheckFlags(flags *flag.FlagSet, c *config.Config, scope resolver.Scope) error
- func (r *SemanticdbProvider) LoadScalaRule(from label.Label, rule *sppb.Rule) error
- func (r *SemanticdbProvider) Name() string
- func (r *SemanticdbProvider) OnEnd() error
- func (r *SemanticdbProvider) OnResolve() error
- func (r *SemanticdbProvider) ParseScalaRule(kind string, from label.Label, dir string, srcs ...string) (*sppb.Rule, error)
- func (r *SemanticdbProvider) RegisterFlags(flags *flag.FlagSet, cmd string, c *config.Config)
- type SourceProvider
- func (cr *SourceProvider) CanProvide(dep *resolver.ImportLabel, expr build.Expr, ...) bool
- func (r *SourceProvider) CheckFlags(flags *flag.FlagSet, c *config.Config, scope resolver.Scope) error
- func (r *SourceProvider) LoadScalaRule(from label.Label, rule *sppb.Rule) error
- func (r *SourceProvider) Name() string
- func (r *SourceProvider) OnEnd() error
- func (r *SourceProvider) OnResolve() error
- func (r *SourceProvider) ParseScalaRule(kind string, from label.Label, dir string, srcs ...string) (*sppb.Rule, error)
- func (r *SourceProvider) RegisterFlags(flags *flag.FlagSet, cmd string, c *config.Config)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JavaProvider ¶
type JavaProvider struct {
// contains filtered or unexported fields
}
JavaProvider is a provider of symbols for a set of jarindex protos.
func NewJavaProvider ¶
func NewJavaProvider() *JavaProvider
NewJavaProvider constructs a new provider.
func (*JavaProvider) CanProvide ¶
func (p *JavaProvider) CanProvide(dep *resolver.ImportLabel, expr build.Expr, knownRule func(from label.Label) (*rule.Rule, bool)) bool
CanProvide implements part of the resolver.SymbolProvider interface.
func (*JavaProvider) CheckFlags ¶
CheckFlags implements part of the resolver.SymbolProvider interface.
func (*JavaProvider) Name ¶
func (p *JavaProvider) Name() string
Name implements part of the resolver.SymbolProvider interface.
func (*JavaProvider) OnEnd ¶
func (p *JavaProvider) OnEnd() error
OnEnd implements part of the resolver.SymbolProvider interface.
func (*JavaProvider) OnResolve ¶
func (p *JavaProvider) OnResolve() error
OnResolve implements part of the resolver.SymbolProvider interface.
func (*JavaProvider) RegisterFlags ¶
RegisterFlags implements part of the resolver.SymbolProvider interface.
Example (Printdefaults) ¶
package main import ( "flag" "os" "github.com/bazelbuild/bazel-gazelle/config" "github.com/stackb/scala-gazelle/pkg/provider" ) func main() { os.Stderr = os.Stdout cr := provider.NewJavaProvider() got := flag.NewFlagSet("", flag.ExitOnError) c := &config.Config{} cr.RegisterFlags(got, "update", c) got.PrintDefaults() }
Output: -javaindex_file value path to javaindex.pb or javaindex.json file
type MavenProvider ¶
type MavenProvider struct {
// contains filtered or unexported fields
}
MavenProvider is a provider of symbols for the bazelbuild/rules_jvm_external gazelle extension.
func NewMavenProvider ¶
func NewMavenProvider(lang string) *MavenProvider
NewMavenProvider constructs a new provider having the given resolving lang.
func (*MavenProvider) CanProvide ¶
func (p *MavenProvider) CanProvide(dep *resolver.ImportLabel, expr build.Expr, knownRule func(from label.Label) (*rule.Rule, bool)) bool
CanProvide implements part of the provider.SymbolProvider interface.
func (*MavenProvider) CheckFlags ¶
CheckFlags implements part of the provider.SymbolProvider interface.
func (*MavenProvider) Name ¶
func (p *MavenProvider) Name() string
Name implements part of the provider.SymbolProvider interface.
func (*MavenProvider) OnEnd ¶
func (p *MavenProvider) OnEnd() error
OnEnd implements part of the provider.SymbolProvider interface.
func (*MavenProvider) OnResolve ¶
func (p *MavenProvider) OnResolve() error
OnResolve implements part of the provider.SymbolProvider interface.
func (*MavenProvider) RegisterFlags ¶
RegisterFlags implements part of the provider.SymbolProvider interface.
Example (Printdefaults) ¶
package main import ( "flag" "os" "github.com/bazelbuild/bazel-gazelle/config" "github.com/stackb/scala-gazelle/pkg/provider" ) const scalaName = "scala" func main() { os.Stderr = os.Stdout cr := provider.NewMavenProvider(scalaName) got := flag.NewFlagSet(scalaName, flag.ExitOnError) c := &config.Config{} cr.RegisterFlags(got, "update", c) got.PrintDefaults() }
Output: -maven_install_json_file value path to maven_install.json file
type ProtobufProvider ¶
type ProtobufProvider struct {
// contains filtered or unexported fields
}
ProtobufProvider is a provider of symbols for the stackb/rules_proto gazelle extension.
func NewProtobufProvider ¶
func NewProtobufProvider(lang, impLang string, importProvider ProvidedImports) *ProtobufProvider
NewProtobufProvider constructs a new provider. The lang/impLang arguments are used to fetch the provided imports in the given importProvider struct.
func (*ProtobufProvider) CanProvide ¶
func (p *ProtobufProvider) CanProvide(dep *resolver.ImportLabel, expr build.Expr, knownRule func(from label.Label) (*rule.Rule, bool)) bool
CanProvide implements part of the resolver.SymbolProvider interface.
func (*ProtobufProvider) CheckFlags ¶
func (p *ProtobufProvider) CheckFlags(fs *flag.FlagSet, c *config.Config, scope resolver.Scope) error
CheckFlags implements part of the resolver.SymbolProvider interface.
func (*ProtobufProvider) Name ¶
func (p *ProtobufProvider) Name() string
Name implements part of the resolver.SymbolProvider interface.
func (*ProtobufProvider) OnEnd ¶
func (p *ProtobufProvider) OnEnd() error
OnEnd implements part of the resolver.SymbolProvider interface.
func (*ProtobufProvider) OnResolve ¶
func (p *ProtobufProvider) OnResolve() error
OnResolve implements part of the resolver.SymbolProvider interface.
func (*ProtobufProvider) RegisterFlags ¶
RegisterFlags implements part of the resolver.SymbolProvider interface.
type ProvidedImports ¶
ProvidedImports is the protoc.ImportProvider interface func.
type SemanticdbProvider ¶
type SemanticdbProvider struct {
// contains filtered or unexported fields
}
SemanticdbProvider is provider for scala source files. If -scala_source_index_in is configured, the given source index will be used to bootstrap the internal cache. At runtime the .ParseScalaRule function can be used to parse scala files. If the cache already has an entry for the filename with matching sha256, the cache hit will be used.
func NewSemanticdbProvider ¶
func NewSemanticdbProvider(delegate parser.Parser) *SemanticdbProvider
NewSemanticdbProvider constructs a new NewSemanticdbProvider.
func (*SemanticdbProvider) CanProvide ¶
func (cr *SemanticdbProvider) CanProvide(dep *resolver.ImportLabel, expr build.Expr, ruleIndex func(from label.Label) (*rule.Rule, bool)) bool
CanProvide implements the resolver.SymbolProvider interface.
func (*SemanticdbProvider) CheckFlags ¶
func (r *SemanticdbProvider) CheckFlags(flags *flag.FlagSet, c *config.Config, scope resolver.Scope) error
CheckFlags implements part of the resolver.SymbolProvider interface.
func (*SemanticdbProvider) LoadScalaRule ¶
LoadScalaRule loads the given state.
func (*SemanticdbProvider) Name ¶
func (r *SemanticdbProvider) Name() string
Name implements part of the resolver.SymbolProvider interface.
func (*SemanticdbProvider) OnEnd ¶
func (r *SemanticdbProvider) OnEnd() error
OnEnd implements part of the resolver.SymbolProvider interface.
func (*SemanticdbProvider) OnResolve ¶
func (r *SemanticdbProvider) OnResolve() error
OnResolve implements part of the resolver.SymbolProvider interface.
func (*SemanticdbProvider) ParseScalaRule ¶
func (r *SemanticdbProvider) ParseScalaRule(kind string, from label.Label, dir string, srcs ...string) (*sppb.Rule, error)
ParseScalaRule implements scalarule.Parser
func (*SemanticdbProvider) RegisterFlags ¶
RegisterFlags implements part of the resolver.SymbolProvider interface.
type SourceProvider ¶
type SourceProvider struct {
// contains filtered or unexported fields
}
SourceProvider is provider for scala source files. If -scala_source_index_in is configured, the given source index will be used to bootstrap the internal cache. At runtime the .ParseScalaRule function can be used to parse scala files. If the cache already has an entry for the filename with matching sha256, the cache hit will be used.
func NewSourceProvider ¶
func NewSourceProvider(progress progressFunc) *SourceProvider
NewSourceProvider constructs a new NewSourceProvider.
func (*SourceProvider) CanProvide ¶
func (cr *SourceProvider) CanProvide(dep *resolver.ImportLabel, expr build.Expr, ruleIndex func(from label.Label) (*rule.Rule, bool)) bool
CanProvide implements the resolver.SymbolProvider interface.
func (*SourceProvider) CheckFlags ¶
func (r *SourceProvider) CheckFlags(flags *flag.FlagSet, c *config.Config, scope resolver.Scope) error
CheckFlags implements part of the resolver.SymbolProvider interface.
func (*SourceProvider) LoadScalaRule ¶
LoadScalaRule loads the given state.
func (*SourceProvider) Name ¶
func (r *SourceProvider) Name() string
Name implements part of the resolver.SymbolProvider interface.
func (*SourceProvider) OnEnd ¶
func (r *SourceProvider) OnEnd() error
OnEnd implements part of the resolver.SymbolProvider interface.
func (*SourceProvider) OnResolve ¶
func (r *SourceProvider) OnResolve() error
OnResolve implements part of the resolver.SymbolProvider interface.
func (*SourceProvider) ParseScalaRule ¶
func (r *SourceProvider) ParseScalaRule(kind string, from label.Label, dir string, srcs ...string) (*sppb.Rule, error)
ParseScalaRule implements scalarule.Parser
func (*SourceProvider) RegisterFlags ¶
RegisterFlags implements part of the resolver.SymbolProvider interface.