Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge changes from topic "libprotobuf-java-full" into main
Browse files Browse the repository at this point in the history
* changes:
  Add filegroup for libprotobuf-java-full java srcs
  Add handcrafted libprotobuf-java-full
  • Loading branch information
mrziwang authored and Gerrit Code Review committed Sep 11, 2023
2 parents 58a2acc + 87050d5 commit 9a75a3d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,12 @@ filegroup {
path: "python",
}

filegroup {
name: "libprotobuf-internal-java-full-srcs",
srcs: ["java/core/src/main/java/**/*.java"],
path: "java",
}

filegroup {
name: "libprotobuf-internal-protos",
srcs: [
Expand Down
30 changes: 30 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# from Android.bp. The BUILD file in this folder is unused, it's from
# the protocol-buffers github repo.
load("//build/bazel/rules/python:py_proto.bzl", "py_proto_library")
load("//build/bazel/rules/java:proto.bzl", "java_proto_sources_gen")

py_library(
name = "libprotobuf-python",
Expand Down Expand Up @@ -60,3 +61,32 @@ proto_library(
srcs = ["src/" + f + ".proto" for f in proto_filenames],
strip_import_prefix = "src",
)

java_library(
name = "libprotobuf-java-full",
java_version = "1.7",
srcs = [
":libprotobuf-internal-java-full-srcs",
":libprotobuf-java-full_proto_gen",
],
target_compatible_with = select({
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
)

java_library(
name = "libprotobuf-java-full-neverlink",
exports = [":libprotobuf-java-full"],
java_version = "1.7",
neverlink = True,
target_compatible_with = select({
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
)

java_proto_sources_gen(
name = "libprotobuf-java-full_proto_gen",
deps = [":libprotobuf-internal-protos_proto"],
)

0 comments on commit 9a75a3d

Please sign in to comment.