• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3  <modelVersion>4.0.0</modelVersion>
4  <parent>
5    <groupId>com.google.protobuf</groupId>
6    <artifactId>protobuf-parent</artifactId>
7    <version>3.21.7</version>
8  </parent>
9
10  <artifactId>protobuf-javalite</artifactId>
11  <packaging>bundle</packaging>
12
13  <name>Protocol Buffers [Lite]</name>
14  <description>
15    Lite version of Protocol Buffers library. This version is optimized for code size, but does
16    not guarantee API/ABI stability.
17  </description>
18
19  <dependencies>
20    <dependency>
21      <groupId>junit</groupId>
22      <artifactId>junit</artifactId>
23      <scope>test</scope>
24    </dependency>
25    <dependency>
26      <groupId>org.mockito</groupId>
27      <artifactId>mockito-core</artifactId>
28      <scope>test</scope>
29    </dependency>
30    <dependency>
31      <groupId>com.google.guava</groupId>
32      <artifactId>guava</artifactId>
33      <scope>test</scope>
34    </dependency>
35    <dependency>
36      <groupId>com.google.truth</groupId>
37      <artifactId>truth</artifactId>
38      <scope>test</scope>
39    </dependency>
40  </dependencies>
41
42  <build>
43     <!-- Include core protos in the bundle as resources -->
44     <resources>
45      <resource>
46        <directory>${protobuf.source.dir}</directory>
47        <includes>
48          <include>google/protobuf/any.proto</include>
49          <include>google/protobuf/api.proto</include>
50          <include>google/protobuf/duration.proto</include>
51          <include>google/protobuf/empty.proto</include>
52          <include>google/protobuf/field_mask.proto</include>
53          <include>google/protobuf/source_context.proto</include>
54          <include>google/protobuf/struct.proto</include>
55          <include>google/protobuf/timestamp.proto</include>
56          <include>google/protobuf/type.proto</include>
57          <include>google/protobuf/wrappers.proto</include>
58        </includes>
59      </resource>
60    </resources>
61    <testResources>
62      <testResource>
63        <directory>${protobuf.source.dir}</directory>
64        <includes>
65          <include>google/protobuf/testdata/golden_message_oneof_implemented</include>
66          <include>google/protobuf/testdata/golden_packed_fields_message</include>
67        </includes>
68      </testResource>
69    </testResources>
70
71    <plugins>
72      <plugin>
73        <artifactId>maven-resources-plugin</artifactId>
74        <version>3.1.0</version>
75        <executions>
76          <execution>
77            <id>copy-source-files</id>
78            <phase>generate-sources</phase>
79            <goals>
80              <goal>copy-resources</goal>
81            </goals>
82            <configuration>
83              <outputDirectory>${generated.sources.dir}/com/google/protobuf</outputDirectory>
84              <resources>
85                <resource>
86                  <directory>${basedir}/../core/src/main/java/com/google/protobuf</directory>
87                  <includes>
88                    <!-- Keep in sync with //java/core:BUILD  -->
89                    <include>AbstractMessageLite.java</include>
90                    <include>AbstractParser.java</include>
91                    <include>AbstractProtobufList.java</include>
92                    <include>AllocatedBuffer.java</include>
93                    <include>Android.java</include>
94                    <include>ArrayDecoders.java</include>
95                    <include>BinaryReader.java</include>
96                    <include>BinaryWriter.java</include>
97                    <include>BooleanArrayList.java</include>
98                    <include>BufferAllocator.java</include>
99                    <include>ByteBufferWriter.java</include>
100                    <include>ByteOutput.java</include>
101                    <include>ByteString.java</include>
102                    <include>CanIgnoreReturnValue.java</include>
103                    <include>CheckReturnValue.java</include>
104                    <include>CodedInputStream.java</include>
105                    <include>CodedInputStreamReader.java</include>
106                    <include>CodedOutputStream.java</include>
107                    <include>CodedOutputStreamWriter.java</include>
108                    <include>CompileTimeConstant.java</include>
109                    <include>DoubleArrayList.java</include>
110                    <include>ExperimentalApi.java</include>
111                    <include>ExtensionLite.java</include>
112                    <include>ExtensionRegistryFactory.java</include>
113                    <include>ExtensionRegistryLite.java</include>
114                    <include>ExtensionSchema.java</include>
115                    <include>ExtensionSchemaLite.java</include>
116                    <include>ExtensionSchemas.java</include>
117                    <include>FieldInfo.java</include>
118                    <include>FieldSet.java</include>
119                    <include>FieldType.java</include>
120                    <include>FloatArrayList.java</include>
121                    <include>GeneratedMessageInfoFactory.java</include>
122                    <include>GeneratedMessageLite.java</include>
123                    <include>InlineMe.java</include>
124                    <include>IntArrayList.java</include>
125                    <include>Internal.java</include>
126                    <include>InvalidProtocolBufferException.java</include>
127                    <include>IterableByteBufferInputStream.java</include>
128                    <include>JavaType.java</include>
129                    <include>LazyField.java</include>
130                    <include>LazyFieldLite.java</include>
131                    <include>LazyStringArrayList.java</include>
132                    <include>LazyStringList.java</include>
133                    <include>ListFieldSchema.java</include>
134                    <include>LongArrayList.java</include>
135                    <include>ManifestSchemaFactory.java</include>
136                    <include>MapEntryLite.java</include>
137                    <include>MapFieldLite.java</include>
138                    <include>MapFieldSchema.java</include>
139                    <include>MapFieldSchemaLite.java</include>
140                    <include>MapFieldSchemas.java</include>
141                    <include>MessageInfo.java</include>
142                    <include>MessageInfoFactory.java</include>
143                    <include>MessageLite.java</include>
144                    <include>MessageLiteOrBuilder.java</include>
145                    <include>MessageLiteToString.java</include>
146                    <include>MessageSchema.java</include>
147                    <include>MessageSetSchema.java</include>
148                    <include>MutabilityOracle.java</include>
149                    <include>NewInstanceSchema.java</include>
150                    <include>NewInstanceSchemaLite.java</include>
151                    <include>NewInstanceSchemas.java</include>
152                    <include>NioByteString.java</include>
153                    <include>OneofInfo.java</include>
154                    <include>Parser.java</include>
155                    <include>PrimitiveNonBoxingCollection.java</include>
156                    <include>ProtoSyntax.java</include>
157                    <include>Protobuf.java</include>
158                    <include>ProtobufArrayList.java</include>
159                    <include>ProtobufLists.java</include>
160                    <include>ProtocolStringList.java</include>
161                    <include>RawMessageInfo.java</include>
162                    <include>Reader.java</include>
163                    <include>RopeByteString.java</include>
164                    <include>Schema.java</include>
165                    <include>SchemaFactory.java</include>
166                    <include>SchemaUtil.java</include>
167                    <include>SmallSortedMap.java</include>
168                    <include>StructuralMessageInfo.java</include>
169                    <include>TextFormatEscaper.java</include>
170                    <include>UninitializedMessageException.java</include>
171                    <include>UnknownFieldSchema.java</include>
172                    <include>UnknownFieldSetLite.java</include>
173                    <include>UnknownFieldSetLiteSchema.java</include>
174                    <include>UnmodifiableLazyStringList.java</include>
175                    <include>UnsafeByteOperations.java</include>
176                    <include>UnsafeUtil.java</include>
177                    <include>Utf8.java</include>
178                    <include>WireFormat.java</include>
179                    <include>Writer.java</include>
180                  </includes>
181                </resource>
182              </resources>
183            </configuration>
184          </execution>
185          <execution>
186            <id>copy-test-source-files</id>
187            <phase>generate-test-sources</phase>
188            <goals>
189              <goal>copy-resources</goal>
190            </goals>
191            <configuration>
192              <outputDirectory>${generated.testsources.dir}/com/google/protobuf</outputDirectory>
193              <resources>
194                <resource>
195                  <directory>${basedir}/../core/src/test/java/com/google/protobuf</directory>
196                  <!-- For sources, we want to be explicit about what we add so we don't accidentally
197                  increase the size of the lite runtime library. For tests, we want to be defensive
198                  and exclude only the full runtime exclusive tests so we don't accidentally miss
199                  any test. -->
200                  <excludes>
201                    <!-- Keep in sync with //java/core:lite_tests BUILD rule. -->
202                    <exclude>AbstractMessageTest.java</exclude>
203                    <exclude>AbstractProto2SchemaTest.java</exclude>
204                    <exclude>AnyTest.java</exclude>
205                    <exclude>CodedInputStreamTest.java</exclude>
206                    <exclude>DeprecatedFieldTest.java</exclude>
207                    <exclude>DescriptorsTest.java</exclude>
208                    <exclude>DiscardUnknownFieldsTest.java</exclude>
209                    <exclude>DynamicMessageTest.java</exclude>
210                    <exclude>ExtensionRegistryFactoryTest.java</exclude>
211                    <exclude>FieldPresenceTest.java</exclude>
212                    <exclude>ForceFieldBuildersPreRun.java</exclude>
213                    <exclude>GeneratedMessageTest.java</exclude>
214                    <exclude>LazyFieldTest.java</exclude>
215                    <exclude>LazyStringEndToEndTest.java</exclude>
216                    <exclude>MapForProto2Test.java</exclude>
217                    <exclude>MapTest.java</exclude>
218                    <exclude>MessageTest.java</exclude>
219                    <exclude>NestedBuildersTest.java</exclude>
220                    <exclude>PackedFieldTest.java</exclude>
221                    <exclude>ParserTest.java</exclude>
222                    <exclude>ParseExceptionsTest.java</exclude>
223                    <exclude>Proto2ExtensionLookupSchemaTest.java</exclude>
224                    <exclude>Proto2SchemaTest.java</exclude>
225                    <exclude>Proto2UnknownEnumValueTest.java</exclude>
226                    <exclude>RepeatedFieldBuilderV3Test.java</exclude>
227                    <exclude>ServiceTest.java</exclude>
228                    <exclude>SingleFieldBuilderV3Test.java</exclude>
229                    <exclude>TestBadIdentifiers.java</exclude>
230                    <exclude>TextFormatParseInfoTreeTest.java</exclude>
231                    <exclude>TextFormatParseLocationTest.java</exclude>
232                    <exclude>TextFormatTest.java</exclude>
233                    <exclude>TestUtil.java</exclude>
234                    <exclude>TypeRegistryTest.java</exclude>
235                    <exclude>UnknownEnumValueTest.java</exclude>
236                    <exclude>UnknownFieldSetLiteTest.java</exclude>
237                    <exclude>UnknownFieldSetPerformanceTest.java</exclude>
238                    <exclude>UnknownFieldSetTest.java</exclude>
239                    <exclude>WellKnownTypesTest.java</exclude>
240                    <exclude>WireFormatTest.java</exclude>
241                  </excludes>
242                </resource>
243              </resources>
244            </configuration>
245          </execution>
246        </executions>
247      </plugin>
248
249      <!-- Use Antrun plugin to generate sources with protoc -->
250      <plugin>
251        <artifactId>maven-antrun-plugin</artifactId>
252        <executions>
253          <!-- Generate core protos -->
254          <execution>
255            <id>generate-sources</id>
256            <phase>generate-sources</phase>
257            <configuration>
258              <target>
259                <ant antfile="generate-sources-build.xml"/>
260              </target>
261            </configuration>
262            <goals>
263              <goal>run</goal>
264            </goals>
265          </execution>
266
267          <!-- Generate the test protos -->
268          <execution>
269            <id>generate-test-sources</id>
270            <phase>generate-test-sources</phase>
271            <configuration>
272              <target>
273                <ant antfile="generate-test-sources-build.xml"/>
274              </target>
275            </configuration>
276            <goals>
277              <goal>run</goal>
278            </goals>
279          </execution>
280
281          <execution>
282            <id>process-lite-sources</id>
283            <phase>generate-test-sources</phase>
284            <configuration>
285              <target>
286                <ant antfile="process-lite-sources-build.xml"/>
287              </target>
288            </configuration>
289            <goals>
290              <goal>run</goal>
291            </goals>
292          </execution>
293        </executions>
294      </plugin>
295
296      <plugin>
297        <groupId>org.codehaus.mojo</groupId>
298        <artifactId>build-helper-maven-plugin</artifactId>
299        <executions>
300          <execution>
301            <id>add-generated-sources</id>
302            <phase>generate-sources</phase>
303            <goals>
304              <goal>add-source</goal>
305            </goals>
306            <configuration>
307              <sources>
308                <source>${generated.sources.dir}</source>
309              </sources>
310            </configuration>
311          </execution>
312
313          <execution>
314            <id>add-generated-test-sources</id>
315            <phase>generate-test-sources</phase>
316            <goals>
317              <goal>add-test-source</goal>
318            </goals>
319            <configuration>
320              <sources>
321                <source>${generated.testsources.dir}</source>
322              </sources>
323            </configuration>
324          </execution>
325        </executions>
326      </plugin>
327
328      <!-- OSGI bundle configuration -->
329      <plugin>
330        <groupId>org.apache.felix</groupId>
331        <artifactId>maven-bundle-plugin</artifactId>
332        <extensions>true</extensions>
333        <configuration>
334          <instructions>
335            <Automatic-Module-Name>com.google.protobuf</Automatic-Module-Name> <!-- Java9+ Jigsaw module name -->
336            <Bundle-DocURL>https://developers.google.com/protocol-buffers/</Bundle-DocURL>
337            <Bundle-SymbolicName>com.google.protobuf</Bundle-SymbolicName>
338            <Export-Package>com.google.protobuf;version=${project.version}</Export-Package>
339            <Import-Package>sun.misc;resolution:=optional,*</Import-Package>
340          </instructions>
341        </configuration>
342      </plugin>
343    </plugins>
344  </build>
345
346</project>
347