rules

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 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 ImportPathToBazelRepoName added in v0.3.1

func ImportPathToBazelRepoName(importpath string) string

ImportPathToBazelRepoName converts a Go import path into a bazel repo name following the guidelines in http://bazel.io/docs/be/functions.html#workspace

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 interface {
	// Generate generates a syntax tree of a BUILD file for "pkg". The file
	// contains rules for each non-empty target in "pkg". It also contains
	// "load" statements necessary for the rule constructors. If this is the
	// top-level package in the repository, the file will contain a
	// "go_prefix" rule.
	Generate(pkg *packages.Package) *bf.File
}

Generator generates Bazel build rules for Go build targets

func NewGenerator

func NewGenerator(c *config.Config, r LabelResolver, oldFile *bf.File) Generator

type LabelResolver added in v0.5.1

type LabelResolver interface {
	// contains filtered or unexported methods
}

A LabelResolver resolves a Go importpath into a label in Bazel.

func NewLabelResolver added in v0.5.1

func NewLabelResolver(c *config.Config) LabelResolver

Jump to

Keyboard shortcuts

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