rules

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

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 SortLabels added in v0.5.1

func SortLabels(f *bf.File)

SortLabels sorts lists of strings in "srcs" and "deps" attributes of Go rules using the same order as buildifier. Buildifier also sorts string lists, but not those involved with "select" expressions. TODO(jayconrod): remove this when bazelbuild/buildtools#122 is fixed.

Types

type Generator

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

Generator generates Bazel build rules for Go build targets.

func NewGenerator

func NewGenerator(c *config.Config, r *resolve.Resolver, l resolve.Labeler, buildRel string, oldFile *bf.File) *Generator

NewGenerator returns a new instance of Generator. "buildRel" is a slash-separated path to the directory containing the build file being generated, relative to the repository root. "oldFile" is the existing build file. May be nil.

func (*Generator) GenerateRules added in v0.5.4

func (g *Generator) GenerateRules(pkg *packages.Package) (rules []bf.Expr, empty []bf.Expr)

GenerateRules generates a list of rules for targets in "pkg". It also returns a list of empty rules that may be deleted from an existing file.

Jump to

Keyboard shortcuts

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