generator

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package generator provides core functionality of BUILD file generation in gazelle.

Index

Constants

This section is empty.

Variables

View Source
var (
	// GoRulesBzl is the label of the Skylark file which provides Go rules
	// You usually don't need to overwrite this variable.
	//
	// See also #135.
	// TODO(yugui): Make it a constant when we drop support of Bazel 0.3.2.
	GoRulesBzl = "@io_bazel_rules_go//go:def.bzl"
)

Functions

This section is empty.

Types

type Generator

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

Generator generates BUILD files for a Go repository.

func New

func New(repoRoot, goPrefix string) (*Generator, error)

New returns a new Generator which is responsible for a Go repository.

"repoRoot" is a path to the root directory of the repository. "goPrefix" is the go_prefix corresponding to the repository root directory. See also https://github.com/bazelbuild/rules_go#go_prefix.

func (*Generator) Generate

func (g *Generator) Generate(dir string) ([]*bzl.File, error)

Generate generates a BUILD file for each Go package found under the given directory. The directory must be the repository root directory the caller passed to New, or its subdirectory.

Jump to

Keyboard shortcuts

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