tables

package
v0.0.0-...-77ffe55 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AndroidLoadPath = "@rules_android//android:rules.bzl"

AndroidLoadPath is the load path for the Starlark Android Rules.

View Source
var AndroidNativeRules = []string{
	"aar_import",
	"android_binary",
	"android_device",
	"android_instrumentation_test",
	"android_library",
	"android_local_test",
	"android_ndk_respository",
	"android_sdk_repository",
}

AndroidNativeRules lists all Android rules that are being migrated from Native to Starlark.

View Source
var CcLoadPath = "@rules_cc//cc:defs.bzl"

CcLoadPath is the load path for the Starlark C++ Rules.

View Source
var CcNativeRules = []string{
	"cc_binary",
	"cc_test",
	"cc_library",
	"cc_import",
	"cc_proto_library",
	"fdo_prefetch_hints",
	"fdo_profile",
	"cc_toolchain",
	"cc_toolchain_suite",
	"objc_library",
	"objc_import",
}

CcNativeRules lists all C++ rules that are being migrated from Native to Starlark.

View Source
var IsLabelArg = map[string]bool{
	"app_target":         true,
	"appdir":             true,
	"base_package":       true,
	"build_deps":         true,
	"cc_deps":            true,
	"ccdeps":             true,
	"common_deps":        true,
	"compile_deps":       true,
	"compiler":           true,
	"data":               true,
	"default_visibility": true,
	"dep":                true,
	"deps":               true,
	"deps_java":          true,
	"dont_depend_on":     true,
	"env_deps":           true,
	"envscripts":         true,
	"exported_deps":      true,
	"exports":            true,
	"externs_list":       true,
	"files":              true,
	"globals":            true,
	"implementation":     true,
	"implements":         true,
	"includes":           true,
	"interface":          true,
	"jar":                true,
	"jars":               true,
	"javadeps":           true,
	"lib_deps":           true,
	"library":            true,
	"malloc":             true,
	"model":              true,
	"mods":               true,
	"module_deps":        true,
	"module_target":      true,
	"of":                 true,
	"plugins":            true,
	"proto_deps":         true,
	"proto_target":       true,
	"protos":             true,
	"resource":           true,
	"resources":          true,
	"runtime_deps":       true,
	"scope":              true,
	"shared_deps":        true,
	"similar_deps":       true,
	"source_jar":         true,
	"src":                true,
	"srcs":               true,
	"stripped_targets":   true,
	"suites":             true,
	"swigdeps":           true,
	"target":             true,
	"target_devices":     true,
	"target_platforms":   true,
	"template":           true,
	"test":               true,
	"tests":              true,
	"tests_deps":         true,
	"tool":               true,
	"tools":              true,
	"visibility":         true,
}

IsLabelArg: a named argument to a rule call is considered to have a value that can be treated as a label or list of labels if the name is one of these names. There is a separate denylist for rule-specific exceptions.

View Source
var IsListArg = map[string]bool{}

By default, edit.types.IsList consults lang.TypeOf to determine if an arg is a list. You may override this using IsListArg. Specifying a name here overrides any value in lang.TypeOf.

View Source
var IsSortableListArg = map[string]bool{
	"cc_deps":             true,
	"common_deps":         true,
	"compile_deps":        true,
	"configs":             true,
	"constraints":         true,
	"data":                true,
	"default_visibility":  true,
	"deps":                true,
	"deps_java":           true,
	"exported_deps":       true,
	"exports":             true,
	"filegroups":          true,
	"files":               true,
	"hdrs":                true,
	"imports":             true,
	"includes":            true,
	"inherits":            true,
	"javadeps":            true,
	"lib_deps":            true,
	"module_deps":         true,
	"out":                 true,
	"outs":                true,
	"packages":            true,
	"plugin_modules":      true,
	"proto_deps":          true,
	"protos":              true,
	"pubs":                true,
	"resources":           true,
	"runtime_deps":        true,
	"shared_deps":         true,
	"similar_deps":        true,
	"srcs":                true,
	"swigdeps":            true,
	"swig_includes":       true,
	"tags":                true,
	"tests":               true,
	"tools":               true,
	"to_start_extensions": true,
	"visibility":          true,
}

IsSortableListArg: a named argument to a rule call is considered to be a sortable list if the name is one of these names. There is a separate denylist for rule-specific exceptions.

View Source
var JavaLoadPath = "@rules_java//java:defs.bzl"

JavaLoadPath is the load path for the Starlark Java Rules.

View Source
var JavaNativeRules = []string{
	"java_binary",
	"java_import",
	"java_library",
	"java_lite_proto_library",
	"java_proto_library",
	"java_test",
	"java_package_configuration",
	"java_plugin",
	"java_runtime",
	"java_toolchain",
}

JavaNativeRules lists all Java rules that are being migrated from Native to Starlark.

View Source
var LabelDenylist = map[string]bool{

	"package_group.includes": true,
}

LabelDenylist is the list of call arguments that cannot be shortened, because they are not interpreted using the same rules as for other labels.

View Source
var NamePriority = map[string]int{
	"name":              -99,
	"gwt_name":          -98,
	"package_name":      -97,
	"visible_node_name": -96,
	"build_rule.tag":    -95,
	"filegroup.tag":     -95,
	"size":              -94,
	"timeout":           -93,
	"testonly":          -92,
	"src":               -91,
	"srcdir":            -90,
	"srcs":              -89,
	"out":               -88,
	"outs":              -87,
	"hdrs":              -86,
	"has_services":      -85,
	"include":           -84,
	"of":                -83,
	"baseline":          -82,

	"destdir":        1,
	"exports":        2,
	"runtime_deps":   3,
	"deps":           4,
	"implementation": 5,
	"implements":     6,
	"alwayslink":     7,
}

NamePriority maps an argument name to its sorting priority.

NOTE(bazel-team): These are the old buildifier rules. It is likely that this table will change, perhaps swapping in a separate table for each call, derived from the order used in the Build Encyclopedia.

View Source
var ProtoLoadPath = "@rules_proto//proto:defs.bzl"

ProtoLoadPath is the load path for the Starlark Proto Rules.

View Source
var ProtoNativeRules = []string{
	"proto_lang_toolchain",
	"proto_library",
}

ProtoNativeRules lists all Proto rules that are being migrated from Native to Starlark.

View Source
var ProtoNativeSymbols = []string{
	"ProtoInfo",
	"proto_common",
}

ProtoNativeSymbols lists all Proto symbols that are being migrated from Native to Starlark.

View Source
var PyLoadPath = "@rules_python//python:defs.bzl"

PyLoadPath is the load path for the Starlark Python Rules.

View Source
var PyNativeRules = []string{
	"py_library",
	"py_binary",
	"py_test",
	"py_runtime",
}

PyNativeRules lists all Python rules that are being migrated from Native to Starlark.

View Source
var ShortenAbsoluteLabelsToRelative = false
View Source
var SortableAllowlist = map[string]bool{}

SortableAllowlist records specific rule arguments that are guaranteed to be reorderable (format: "rule_name.attribute_name").

View Source
var SortableDenylist = map[string]bool{
	"genrule.outs":       true,
	"genrule.srcs":       true,
	"cc_embed_data.srcs": true,
}

SortableDenylist records specific rule arguments that must not be reordered.

View Source
var StripLabelLeadingSlashes = false

Functions

func MergeTables

func MergeTables(labelArg, denylist, listArg, sortableListArg, sortDenylist, sortAllowlist map[string]bool, namePriority map[string]int, stripLabelLeadingSlashes, shortenAbsoluteLabelsToRelative bool)

MergeTables allows a user of the build package to override the special-case rules. The user-provided tables are merged into the built-in tables.

func OverrideTables

func OverrideTables(labelArg, denylist, listArg, sortableListArg, sortDenylist, sortAllowlist map[string]bool, namePriority map[string]int, stripLabelLeadingSlashes, shortenAbsoluteLabelsToRelative bool)

OverrideTables allows a user of the build package to override the special-case rules. The user-provided tables replace the built-in tables.

func ParseAndUpdateJSONDefinitions

func ParseAndUpdateJSONDefinitions(file string, merge bool) error

ParseAndUpdateJSONDefinitions reads definitions from file and merges or overrides the values in memory.

Types

type Definitions

type Definitions struct {
	IsLabelArg                      map[string]bool
	LabelDenylist                   map[string]bool
	IsListArg                       map[string]bool
	IsSortableListArg               map[string]bool
	SortableDenylist                map[string]bool
	SortableAllowlist               map[string]bool
	NamePriority                    map[string]int
	StripLabelLeadingSlashes        bool
	ShortenAbsoluteLabelsToRelative bool
}

func ParseJSONDefinitions

func ParseJSONDefinitions(file string) (Definitions, error)

ParseJSONDefinitions reads and parses JSON table definitions from file.

Jump to

Keyboard shortcuts

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