Add option to use protobuf3

Users of the rust_protobuf module can use the 'use_protobuf3'
option to select version 3 of the protobuf crate instead of the
current default of version 2. This unblocks teams that would like
to use protobuf 3 immediately and provides a mechanism for us to
incrementally migrate users of protobuf 2 to protobuf 3.

Test: Adds tests that are executed during every build.
Bug: 270895633
Change-Id: Ib6a18b77cfa7dc3cc604cea05269004b3712bbb6
This commit is contained in:
Jeff Vander Stoep
2023-04-24 11:28:25 +02:00
parent 0933fd59d7
commit c1490ec25e
3 changed files with 80 additions and 1 deletions

View File

@@ -126,6 +126,12 @@ func GatherRequiredDepsForTest() string {
apex_available: ["//apex_available:platform", "//apex_available:anyapex"],
min_sdk_version: "29",
}
rust_library {
name: "libprotobuf",
crate_name: "protobuf",
srcs: ["foo.rs"],
host_supported: true,
}
rust_library {
name: "libprotobuf_deprecated",
crate_name: "protobuf",