Documentation ¶
Overview ¶
Package rules contains implementations of Bazel build rules (only callable from BUILD[.bazel] files).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CcBinary = newRule("cc_binary", func(ctx core.Context, args starlark.Tuple, kwargs []starlark.Tuple) error { target := &CcBinaryTarget{} if err := builtins_args.ProcessArgs(args, kwargs, ctx, target); err != nil { return err } ctx.BuildTargets().Add(target) return nil })
CcBinary implements the Bazel cc_binary rule.
View Source
var CcLibrary = newRule("cc_library", func(ctx core.Context, args starlark.Tuple, kwargs []starlark.Tuple) error { target := &CcLibraryTarget{} if err := builtins_args.ProcessArgs(args, kwargs, ctx, target); err != nil { return err } ctx.BuildTargets().Add(target) return nil })
CcLibrary implements the Bazel cc_library rule.
View Source
var CcTest = newRule("cc_test", func(ctx core.Context, args starlark.Tuple, kwargs []starlark.Tuple) error { target := &CcTestTarget{} if err := builtins_args.ProcessArgs(args, kwargs, ctx, target); err != nil { return err } ctx.BuildTargets().Add(target) return nil })
CcTest implements the Bazel cc_test rule.
Functions ¶
func NotImplemented ¶
NotImplemented is used for Bazel rules that we haven't implemented (yet).
Types ¶
type CcBinaryTarget ¶
type CcBinaryTarget struct { TargetCommon TargetCommonBinary Srcs *[]core.Label `bazel:"srcs"` AdditionalLinkerInputs *[]core.Label `bazel:"additional_linker_inputs"` Copts *[]string `bazel:"copts"` Defines *[]string `bazel:"defines"` Includes *[]string `bazel:"includes"` Linkopts *[]string `bazel:"linkopts"` Linkstatic *bool `bazel:"linkstatic"` Malloc *core.Label `bazel:"malloc"` Nocopts *[]string `bazel:"nocopts"` Stamp *int64 `bazel:"stamp"` WinDefFile *core.Label `bazel:"win_def_file"` }
func (*CcBinaryTarget) DidProcessArgs ¶
func (self *CcBinaryTarget) DidProcessArgs(ctx core.Context) error
func (*CcBinaryTarget) String ¶
func (self *CcBinaryTarget) String() string
type CcLibraryTarget ¶
type CcLibraryTarget struct { TargetCommon Srcs *[]core.Label `bazel:"srcs"` Hdrs *[]core.Label `bazel:"hdrs"` Alwayslink *bool `bazel:"alwayslink"` Copts *[]string `bazel:"copts"` Defines *[]string `bazel:"defines"` IncludePrefix *string `bazel:"include_prefix"` Includes *[]string `bazel:"includes"` Linkopts *[]string `bazel:"linkopts"` Linkstatic *bool `bazel:"linkstatic"` Nocopts *[]string `bazel:"nocopts"` StripIncludePrefix *string `bazel:"strip_include_prefix"` TextualHdrs *[]core.Label `bazel:"textual_hdrs"` WinDefFile *core.Label `bazel:"win_def_file"` }
func (*CcLibraryTarget) DidProcessArgs ¶
func (self *CcLibraryTarget) DidProcessArgs(ctx core.Context) error
func (*CcLibraryTarget) String ¶
func (self *CcLibraryTarget) String() string
type CcTestTarget ¶
type CcTestTarget struct { TargetCommon TargetCommonTest Srcs *[]core.Label `bazel:"srcs"` AdditionalLinkerInputs *[]core.Label `bazel:"additional_linker_inputs"` Copts *[]string `bazel:"copts"` Defines *[]string `bazel:"defines"` Includes *[]string `bazel:"includes"` Linkopts *[]string `bazel:"linkopts"` Linkstatic *bool `bazel:"linkstatic"` Malloc *core.Label `bazel:"malloc"` Nocopts *[]string `bazel:"nocopts"` Stamp *int64 `bazel:"stamp"` WinDefFile *core.Label `bazel:"win_def_file"` }
TODO(vtl): The attributes are identical to CcBinaryTarget, except the latter also has linkshared.
func (*CcTestTarget) DidProcessArgs ¶
func (self *CcTestTarget) DidProcessArgs(ctx core.Context) error
func (*CcTestTarget) String ¶
func (self *CcTestTarget) String() string
type TargetCommon ¶
type TargetCommon struct { Name *string `bazel:"name!"` Data *[]core.Label `bazel:"data"` Visibility *[]core.Label `bazel:"visibility"` Toolchains *[]core.Label `bazel:"toolchains"` Deps *[]core.Label `bazel:"deps"` Deprecation *string `bazel:"deprecation"` Tags *[]string `bazel:"tags"` Testonly *bool `bazel:"testonly"` Features *[]string `bazel:"features"` Licenses *[]string `bazel:"licenses"` CompatibleWith *[]core.Label `bazel:"compatible_with"` Distribs *[]string `bazel:"distribs"` ExecCompatibleWith *[]core.Label `bazel:"exec_compatible_with"` RestrictedTo *[]core.Label `bazel:"restricted_to"` // contains filtered or unexported fields }
func (*TargetCommon) DidProcessArgs ¶
func (self *TargetCommon) DidProcessArgs(ctx core.Context) error
func (*TargetCommon) Label ¶
func (self *TargetCommon) Label() core.Label
type TargetCommonBinary ¶
type TargetCommonBinary struct { Args *[]string `bazel:"args"` OutputLicenses *[]string `bazel:"output_licenses"` }
func (*TargetCommonBinary) DidProcessArgs ¶
func (self *TargetCommonBinary) DidProcessArgs(ctx core.Context) error
type TargetCommonTest ¶
type TargetCommonTest struct { Args *[]string `bazel:"args"` Size *string `bazel:"size"` Timeout *string `bazel:"timeout"` Flaky *bool `bazel:"flaky"` Local *bool `bazel:"local"` ShardCount *int64 `bazel:"shard_count"` }
func (*TargetCommonTest) DidProcessArgs ¶
func (self *TargetCommonTest) DidProcessArgs(ctx core.Context) error
Click to show internal directories.
Click to hide internal directories.