filter

package
v0.0.0-...-62694dd Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Package filter provides functions to filter rules based on their use site.

Index

Constants

This section is empty.

Variables

View Source
var JavaDependencyRuleKinds = map[string]bool{
	"android_library":            true,
	"java_import":                true,
	"java_library":               true,
	"java_lite_proto_library":    true,
	"java_mutable_proto_library": true,
	"java_plugin":                true,
	"java_proto_library":         true,
	"java_wrap_cc":               true,
	"proto_library":              true,
}

JavaDependencyRuleKinds lists the kinds of Java rule that can be a dependency of a Java rule. These typically don't include binary rules.

View Source
var JavaEditableRuleKinds = map[string]bool{
	"android_binary":           true,
	"android_library":          true,
	"android_local_test":       true,
	"android_robolectric_test": true,
	"android_test":             true,
	"java_binary":              true,
	"java_library":             true,
	"java_plugin":              true,
	"java_test":                true,
}

JavaEditableRuleKinds lists the kinds of rules that Jadep will edit.

View Source
var RuleKindsToLoad = map[string]bool{
	"android_binary":             true,
	"android_library":            true,
	"android_local_test":         true,
	"android_robolectric_test":   true,
	"android_test":               true,
	"bind":                       true,
	"filegroup":                  true,
	"java_binary":                true,
	"java_import":                true,
	"java_library":               true,
	"java_lite_proto_library":    true,
	"java_mutable_proto_library": true,
	"java_plugin":                true,
	"java_proto_library":         true,
	"java_test":                  true,
	"java_wrap_cc":               true,
	"proto_library":              true,
}

RuleKindsToLoad lists the kinds of rules that Jadep requests from a PackageLoader server. This should list all kinds that Jadep interacts with in any way.

Functions

func CheckVisibility

func CheckVisibility(ctx context.Context, loader pkgloading.Loader, query map[VisQuery]bool) (map[VisQuery]bool, error)

CheckVisibility returns true if rules are visible to packages. It computes the answer for multiple queries with the minimal amount of package loads possible. We assume the loader is a CachingLoader for performance. The result satisfies result[R, P]==true iff rule R is visibile to package P.

func IsValidDependency

func IsValidDependency(dep *bazel.Rule) bool

IsValidDependency returns false if dep should not be used as a dependency. It only relies on information inside the rule itself (e.g., kind, tags). For visibility tests, see CheckVisibility().

Types

type VisQuery

type VisQuery struct {
	Rule *bazel.Rule
	Pkg  string
}

VisQuery represents the question, "is rule Rule visible to the package Pkg".

Jump to

Keyboard shortcuts

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