最后看的是Protocol Buffer Rules和shell Rules
proto_lang_toolchain(name, deps, data, blacklisted_protos, command_line, compatible_with, deprecation, distribs, features, licenses, plugin, restricted_to, runtime, tags, testonly, visibility)
例子:
proto_lang_toolchain(
name = "javalite_toolchain",
command_line = "--$(PLUGIN_OUT)=shared,immutable:$(OUT)",
plugin = ":javalite_plugin",
runtime = ":protobuf_lite",
)
Arguments
Attributes | |
---|---|
name |
A unique name for this rule. |
blacklisted_protos |
srcs attribute of blacklisted_protos . This is used for .proto files that are already linked into proto runtimes, such as any.proto . |
command_line |
|
plugin |
--plugin=protoc-gen-PLUGIN=. |
runtime |
|
sh_binary
sh_binary(name, deps, srcs, data, args, compatible_with, deprecation, distribs, features, licenses, output_licenses, restricted_to, tags, testonly, visibility)
Example
For a simple shell script with no dependencies or data:
sh_binary( name = "foo", srcs = ["foo.sh"], data = glob(["datafiles/*.txt"]), )
Arguments
Attributes | |
---|---|
name |
A unique name for this rule. |
deps |
deps at Attributes common to all build rules . This attribute should be used to list other |
srcs |
This attribute must be a singleton list, whose element is the shell script. This script must be executable, and may be a source file or a generated file. All other files required at runtime (whether scripts or data) belong in the |
sh_library
sh_library(name, deps, srcs, data, compatible_with, deprecation, distribs, features, licenses, restricted_to, tags, testonly, visibility)
Examples
sh_library( name = "foo", data = [ ":foo_service_script", # an sh_binary with srcs ":deploy_foo", # another sh_binary with srcs ], )
Arguments
Attributes | |
---|---|
name |
A unique name for this rule. |
deps |
deps at Attributes common to all build rules . This attribute should be used to list other |
srcs |
This attribute should be used to list shell script source files that belong to this library. Scripts can load other scripts using the shell's |
sh_test
sh_test(name, deps, srcs, data, args, compatible_with, deprecation, distribs, features, flaky, licenses, local, restricted_to, shard_count, size, tags, testonly, timeout, visibility)
Examples
sh_test( name = "foo_integration_test", size = "small", srcs = ["foo_integration_test.sh"], deps = [":foo_sh_lib"], data = glob(["testdata/*.txt"]), )
Arguments
Attributes | |
---|---|
name |
A unique name for this rule. |
deps |
deps at Attributes common to all build rules . This attribute should be used to list other |
srcs |
This attribute must be a singleton list, whose element is the shell script. This script must be executable, and may be a source file or a generated file. All other files required at runtime (whether scripts or data) belong in the |