Documentation ¶
Overview ¶
Package rules provides Bazel rule generation for Go build targets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportPathToBazelRepoName ¶ added in v0.3.1
ImportPathToBazelRepoName converts a Go import path into a bazel repo name following the guidelines in http://bazel.io/docs/be/functions.html#workspace
Types ¶
type ExternalResolver ¶ added in v0.3.3
type ExternalResolver int
ExternalResolver resolves external packages.
const ( // External resolves external packages as external packages with // new_go_repository. External ExternalResolver = iota // Vendored resolves external packages as vendored packages in vendor/. Vendored )
type Generator ¶
type Generator interface { // Generate generates build rules for build targets in a Go package in a // repository. // // "rel" is a relative slash-separated path from the repostiry root // directory to the Go package directory. It is empty if the package // directory is the repository root itself. // "pkg" is a description about the package. Generate(rel string, pkg *build.Package) ([]*bzl.Rule, error) }
Generator generates Bazel build rules for Go build targets
func NewGenerator ¶
func NewGenerator(goPrefix string, external ExternalResolver) Generator
NewGenerator returns an implementation of Generator.
"goPrefix" is the go_prefix corresponding to the repository root. See also https://github.com/bazelbuild/rules_go#go_prefix. "external" is how external packages should be resolved.
Click to show internal directories.
Click to hide internal directories.