tree: 35327bf20a52ec4005a89bc128b0e164a87782cd
  1. example/
  2. android_grpc_compile.bzl
  3. android_grpc_library.bzl
  4. android_proto_compile.bzl
  5. android_proto_library.bzl
  6. BUILD.bazel
  7. defs.bzl
  8. deps.bzl
  9. README.md
android/README.md

android

RuleDescription
android_proto_compileGenerates android protobuf artifacts
android_grpc_compileGenerates android protobuf+gRPC artifacts
android_proto_libraryGenerates android protobuf library
android_grpc_libraryGenerates android protobuf+gRPC library

android_proto_compile

Generates android protobuf artifacts

WORKSPACE

load("@build_stack_rules_proto//android:deps.bzl", "android_deps")

android_deps()

BUILD.bazel

load("@build_stack_rules_proto//android:defs.bzl", "android_proto_compile")

android_proto_compile(
    name = "person_android_proto",
    deps = ["@build_stack_rules_proto//example/proto:person_proto"],
)

Mandatory Attributes

NameTypeDefaultDescription
depslist<ProtoInfo>[]List of labels that provide a ProtoInfo (such as native.proto_library)

Optional Attributes

NameTypeDefaultDescription
verboseint0The verbosity level. Supported values and results are 1: show command, 2: show command and sandbox after running protoc, 3: show command and sandbox before and after running protoc, 4. show env, command, expected outputs and sandbox before and after running protoc

android_grpc_compile

Generates android protobuf+gRPC artifacts

WORKSPACE

load("@build_stack_rules_proto//android:deps.bzl", "android_deps")

android_deps()

load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")

grpc_java_repositories(
    omit_com_google_protobuf = True,
    omit_net_zlib = True
)

BUILD.bazel

load("@build_stack_rules_proto//android:defs.bzl", "android_grpc_compile")

android_grpc_compile(
    name = "greeter_android_grpc",
    deps = ["@build_stack_rules_proto//example/proto:greeter_grpc"],
)

Mandatory Attributes

NameTypeDefaultDescription
depslist<ProtoInfo>[]List of labels that provide a ProtoInfo (such as native.proto_library)

Optional Attributes

NameTypeDefaultDescription
verboseint0The verbosity level. Supported values and results are 1: show command, 2: show command and sandbox after running protoc, 3: show command and sandbox before and after running protoc, 4. show env, command, expected outputs and sandbox before and after running protoc

android_proto_library

Generates android protobuf library

WORKSPACE

# The set of dependencies loaded here is excessive for android proto alone
# (but simplifies our setup)
load("@build_stack_rules_proto//android:deps.bzl", "android_deps")

android_deps()

load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")

grpc_java_repositories(
    omit_com_google_protobuf = True,
    omit_com_google_protobuf_javalite = True,
    omit_net_zlib = True
)

load("@build_bazel_rules_android//android:sdk_repository.bzl", "android_sdk_repository")

android_sdk_repository(name = "androidsdk")

BUILD.bazel

load("@build_stack_rules_proto//android:defs.bzl", "android_proto_library")

android_proto_library(
    name = "person_android_library",
    deps = ["@build_stack_rules_proto//example/proto:person_proto"],
)

Mandatory Attributes

NameTypeDefaultDescription
depslist<ProtoInfo>[]List of labels that provide a ProtoInfo (such as native.proto_library)

Optional Attributes

NameTypeDefaultDescription
verboseint0The verbosity level. Supported values and results are 1: show command, 2: show command and sandbox after running protoc, 3: show command and sandbox before and after running protoc, 4. show env, command, expected outputs and sandbox before and after running protoc

android_grpc_library

Generates android protobuf+gRPC library

WORKSPACE

load("@build_stack_rules_proto//android:deps.bzl", "android_deps")

android_deps()

load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")

grpc_java_repositories(
    omit_com_google_protobuf = True,
    omit_com_google_protobuf_javalite = True,
    omit_net_zlib = True
)

load("@build_bazel_rules_android//android:sdk_repository.bzl", "android_sdk_repository")

android_sdk_repository(name = "androidsdk")

BUILD.bazel

load("@build_stack_rules_proto//android:defs.bzl", "android_grpc_library")

android_grpc_library(
    name = "greeter_android_library",
    deps = ["@build_stack_rules_proto//example/proto:greeter_grpc"],
)

Mandatory Attributes

NameTypeDefaultDescription
depslist<ProtoInfo>[]List of labels that provide a ProtoInfo (such as native.proto_library)

Optional Attributes

NameTypeDefaultDescription
verboseint0The verbosity level. Supported values and results are 1: show command, 2: show command and sandbox after running protoc, 3: show command and sandbox before and after running protoc, 4. show env, command, expected outputs and sandbox before and after running protoc