Documentation
¶
Overview ¶
Package filter provides functions to filter rules based on their use site.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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.
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.
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 ¶
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().