• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("@rules_java//java:defs.bzl", "java_library")
2load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain")
3
4LITE_SRCS = [
5    # Keep in sync with `//java/lite:pom.xml`.
6    "src/main/java/com/google/protobuf/AbstractMessageLite.java",
7    "src/main/java/com/google/protobuf/AbstractParser.java",
8    "src/main/java/com/google/protobuf/AbstractProtobufList.java",
9    "src/main/java/com/google/protobuf/AllocatedBuffer.java",
10    "src/main/java/com/google/protobuf/Android.java",
11    "src/main/java/com/google/protobuf/ArrayDecoders.java",
12    "src/main/java/com/google/protobuf/BinaryReader.java",
13    "src/main/java/com/google/protobuf/BinaryWriter.java",
14    "src/main/java/com/google/protobuf/BooleanArrayList.java",
15    "src/main/java/com/google/protobuf/BufferAllocator.java",
16    "src/main/java/com/google/protobuf/ByteBufferWriter.java",
17    "src/main/java/com/google/protobuf/ByteOutput.java",
18    "src/main/java/com/google/protobuf/ByteString.java",
19    "src/main/java/com/google/protobuf/CodedInputStream.java",
20    "src/main/java/com/google/protobuf/CodedInputStreamReader.java",
21    "src/main/java/com/google/protobuf/CodedOutputStream.java",
22    "src/main/java/com/google/protobuf/CodedOutputStreamWriter.java",
23    "src/main/java/com/google/protobuf/DoubleArrayList.java",
24    "src/main/java/com/google/protobuf/ExperimentalApi.java",
25    "src/main/java/com/google/protobuf/ExtensionLite.java",
26    "src/main/java/com/google/protobuf/ExtensionRegistryFactory.java",
27    "src/main/java/com/google/protobuf/ExtensionRegistryLite.java",
28    "src/main/java/com/google/protobuf/ExtensionSchema.java",
29    "src/main/java/com/google/protobuf/ExtensionSchemaLite.java",
30    "src/main/java/com/google/protobuf/ExtensionSchemas.java",
31    "src/main/java/com/google/protobuf/FieldInfo.java",
32    "src/main/java/com/google/protobuf/FieldSet.java",
33    "src/main/java/com/google/protobuf/FieldType.java",
34    "src/main/java/com/google/protobuf/FloatArrayList.java",
35    "src/main/java/com/google/protobuf/GeneratedMessageInfoFactory.java",
36    "src/main/java/com/google/protobuf/GeneratedMessageLite.java",
37    "src/main/java/com/google/protobuf/IntArrayList.java",
38    "src/main/java/com/google/protobuf/Internal.java",
39    "src/main/java/com/google/protobuf/InvalidProtocolBufferException.java",
40    "src/main/java/com/google/protobuf/IterableByteBufferInputStream.java",
41    "src/main/java/com/google/protobuf/JavaType.java",
42    "src/main/java/com/google/protobuf/LazyField.java",
43    "src/main/java/com/google/protobuf/LazyFieldLite.java",
44    "src/main/java/com/google/protobuf/LazyStringArrayList.java",
45    "src/main/java/com/google/protobuf/LazyStringList.java",
46    "src/main/java/com/google/protobuf/ListFieldSchema.java",
47    "src/main/java/com/google/protobuf/LongArrayList.java",
48    "src/main/java/com/google/protobuf/ManifestSchemaFactory.java",
49    "src/main/java/com/google/protobuf/MapEntryLite.java",
50    "src/main/java/com/google/protobuf/MapFieldLite.java",
51    "src/main/java/com/google/protobuf/MapFieldSchema.java",
52    "src/main/java/com/google/protobuf/MapFieldSchemaLite.java",
53    "src/main/java/com/google/protobuf/MapFieldSchemas.java",
54    "src/main/java/com/google/protobuf/MessageInfo.java",
55    "src/main/java/com/google/protobuf/MessageInfoFactory.java",
56    "src/main/java/com/google/protobuf/MessageLite.java",
57    "src/main/java/com/google/protobuf/MessageLiteOrBuilder.java",
58    "src/main/java/com/google/protobuf/MessageLiteToString.java",
59    "src/main/java/com/google/protobuf/MessageSchema.java",
60    "src/main/java/com/google/protobuf/MessageSetSchema.java",
61    "src/main/java/com/google/protobuf/MutabilityOracle.java",
62    "src/main/java/com/google/protobuf/NewInstanceSchema.java",
63    "src/main/java/com/google/protobuf/NewInstanceSchemaLite.java",
64    "src/main/java/com/google/protobuf/NewInstanceSchemas.java",
65    "src/main/java/com/google/protobuf/NioByteString.java",
66    "src/main/java/com/google/protobuf/OneofInfo.java",
67    "src/main/java/com/google/protobuf/Parser.java",
68    "src/main/java/com/google/protobuf/PrimitiveNonBoxingCollection.java",
69    "src/main/java/com/google/protobuf/ProtoSyntax.java",
70    "src/main/java/com/google/protobuf/Protobuf.java",
71    "src/main/java/com/google/protobuf/ProtobufArrayList.java",
72    "src/main/java/com/google/protobuf/ProtobufLists.java",
73    "src/main/java/com/google/protobuf/ProtocolStringList.java",
74    "src/main/java/com/google/protobuf/RawMessageInfo.java",
75    "src/main/java/com/google/protobuf/Reader.java",
76    "src/main/java/com/google/protobuf/RopeByteString.java",
77    "src/main/java/com/google/protobuf/Schema.java",
78    "src/main/java/com/google/protobuf/SchemaFactory.java",
79    "src/main/java/com/google/protobuf/SchemaUtil.java",
80    "src/main/java/com/google/protobuf/SmallSortedMap.java",
81    "src/main/java/com/google/protobuf/StructuralMessageInfo.java",
82    "src/main/java/com/google/protobuf/TextFormatEscaper.java",
83    "src/main/java/com/google/protobuf/UninitializedMessageException.java",
84    "src/main/java/com/google/protobuf/UnknownFieldSchema.java",
85    "src/main/java/com/google/protobuf/UnknownFieldSetLite.java",
86    "src/main/java/com/google/protobuf/UnknownFieldSetLiteSchema.java",
87    "src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java",
88    "src/main/java/com/google/protobuf/UnsafeUtil.java",
89    "src/main/java/com/google/protobuf/Utf8.java",
90    "src/main/java/com/google/protobuf/WireFormat.java",
91    "src/main/java/com/google/protobuf/Writer.java",
92]
93
94# Should be used as `//java/lite`.
95java_library(
96    name = "lite",
97    srcs = LITE_SRCS,
98    visibility = [
99        "//java/lite:__pkg__",
100    ],
101)
102
103java_library(
104    name = "core",
105    srcs = glob(
106        [
107            "src/main/java/com/google/protobuf/*.java",
108        ],
109        exclude = LITE_SRCS,
110    ) + [
111        "//:gen_well_known_protos_java",
112    ],
113    visibility = ["//visibility:public"],
114    exports = [
115        "//java/lite",
116    ],
117    deps = [
118        "//java/lite",
119    ],
120)
121
122proto_lang_toolchain(
123    name = "toolchain",
124    command_line = "--java_out=$(OUT)",
125    runtime = ":core",
126    visibility = ["//visibility:public"],
127)
128