rules

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2017 License: Apache-2.0 Imports: 9 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

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.

Jump to

Keyboard shortcuts

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