• 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.13.0</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.easymock</groupId>
27      <artifactId>easymock</artifactId>
28      <scope>test</scope>
29    </dependency>
30    <dependency>
31      <groupId>org.easymock</groupId>
32      <artifactId>easymockclassextension</artifactId>
33      <scope>test</scope>
34    </dependency>
35    <dependency>
36      <groupId>com.google.guava</groupId>
37      <artifactId>guava</artifactId>
38      <scope>test</scope>
39    </dependency>
40    <dependency>
41      <groupId>com.google.truth</groupId>
42      <artifactId>truth</artifactId>
43      <scope>test</scope>
44    </dependency>
45  </dependencies>
46
47  <build>
48     <!-- Include core protos in the bundle as resources -->
49     <resources>
50      <resource>
51        <directory>${protobuf.source.dir}</directory>
52        <includes>
53          <include>google/protobuf/any.proto</include>
54          <include>google/protobuf/api.proto</include>
55          <include>google/protobuf/duration.proto</include>
56          <include>google/protobuf/empty.proto</include>
57          <include>google/protobuf/field_mask.proto</include>
58          <include>google/protobuf/source_context.proto</include>
59          <include>google/protobuf/struct.proto</include>
60          <include>google/protobuf/timestamp.proto</include>
61          <include>google/protobuf/type.proto</include>
62          <include>google/protobuf/wrappers.proto</include>
63        </includes>
64      </resource>
65    </resources>
66    <testResources>
67      <testResource>
68        <directory>${protobuf.source.dir}</directory>
69        <includes>
70          <include>google/protobuf/testdata/golden_message_oneof_implemented</include>
71          <include>google/protobuf/testdata/golden_packed_fields_message</include>
72        </includes>
73      </testResource>
74    </testResources>
75
76    <plugins>
77      <plugin>
78        <artifactId>maven-resources-plugin</artifactId>
79        <version>3.1.0</version>
80        <executions>
81          <execution>
82            <id>copy-source-files</id>
83            <phase>generate-sources</phase>
84            <goals>
85              <goal>copy-resources</goal>
86            </goals>
87            <configuration>
88              <outputDirectory>${generated.sources.dir}/com/google/protobuf</outputDirectory>
89              <resources>
90                <resource>
91                  <directory>${basedir}/../core/src/main/java/com/google/protobuf</directory>
92                  <includes>
93                    <!-- Keep in sync with //java/core:BUILD  -->
94                    <include>AbstractMessageLite.java</include>
95                    <include>AbstractParser.java</include>
96                    <include>AbstractProtobufList.java</include>
97                    <include>AllocatedBuffer.java</include>
98                    <include>Android.java</include>
99                    <include>ArrayDecoders.java</include>
100                    <include>BinaryReader.java</include>
101                    <include>BinaryWriter.java</include>
102                    <include>BooleanArrayList.java</include>
103                    <include>BufferAllocator.java</include>
104                    <include>ByteBufferWriter.java</include>
105                    <include>ByteOutput.java</include>
106                    <include>ByteString.java</include>
107                    <include>CodedInputStream.java</include>
108                    <include>CodedInputStreamReader.java</include>
109                    <include>CodedOutputStream.java</include>
110                    <include>CodedOutputStreamWriter.java</include>
111                    <include>DoubleArrayList.java</include>
112                    <include>ExperimentalApi.java</include>
113                    <include>ExtensionLite.java</include>
114                    <include>ExtensionRegistryFactory.java</include>
115                    <include>ExtensionRegistryLite.java</include>
116                    <include>ExtensionSchema.java</include>
117                    <include>ExtensionSchemaLite.java</include>
118                    <include>ExtensionSchemas.java</include>
119                    <include>FieldInfo.java</include>
120                    <include>FieldSet.java</include>
121                    <include>FieldType.java</include>
122                    <include>FloatArrayList.java</include>
123                    <include>GeneratedMessageInfoFactory.java</include>
124                    <include>GeneratedMessageLite.java</include>
125                    <include>IntArrayList.java</include>
126                    <include>Internal.java</include>
127                    <include>InvalidProtocolBufferException.java</include>
128                    <include>IterableByteBufferInputStream.java</include>
129                    <include>JavaType.java</include>
130                    <include>LazyField.java</include>
131                    <include>LazyFieldLite.java</include>
132                    <include>LazyStringArrayList.java</include>
133                    <include>LazyStringList.java</include>
134                    <include>ListFieldSchema.java</include>
135                    <include>LongArrayList.java</include>
136                    <include>ManifestSchemaFactory.java</include>
137                    <include>MapEntryLite.java</include>
138                    <include>MapFieldLite.java</include>
139                    <include>MapFieldSchema.java</include>
140                    <include>MapFieldSchemaLite.java</include>
141                    <include>MapFieldSchemas.java</include>
142                    <include>MessageInfo.java</include>
143                    <include>MessageInfoFactory.java</include>
144                    <include>MessageLite.java</include>
145                    <include>MessageLiteOrBuilder.java</include>
146                    <include>MessageLiteToString.java</include>
147                    <include>MessageSchema.java</include>
148                    <include>MessageSetSchema.java</include>
149                    <include>MutabilityOracle.java</include>
150                    <include>NewInstanceSchema.java</include>
151                    <include>NewInstanceSchemaLite.java</include>
152                    <include>NewInstanceSchemas.java</include>
153                    <include>NioByteString.java</include>
154                    <include>OneofInfo.java</include>
155                    <include>Parser.java</include>
156                    <include>PrimitiveNonBoxingCollection.java</include>
157                    <include>ProtoSyntax.java</include>
158                    <include>Protobuf.java</include>
159                    <include>ProtobufArrayList.java</include>
160                    <include>ProtobufLists.java</include>
161                    <include>ProtocolStringList.java</include>
162                    <include>RawMessageInfo.java</include>
163                    <include>Reader.java</include>
164                    <include>RopeByteString.java</include>
165                    <include>Schema.java</include>
166                    <include>SchemaFactory.java</include>
167                    <include>SchemaUtil.java</include>
168                    <include>SmallSortedMap.java</include>
169                    <include>StructuralMessageInfo.java</include>
170                    <include>TextFormatEscaper.java</include>
171                    <include>UninitializedMessageException.java</include>
172                    <include>UnknownFieldSchema.java</include>
173                    <include>UnknownFieldSetLite.java</include>
174                    <include>UnknownFieldSetLiteSchema.java</include>
175                    <include>UnmodifiableLazyStringList.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                    <exclude>AbstractMessageTest.java</exclude>
202                    <exclude>AbstractProto2SchemaTest.java</exclude>
203                    <exclude>AnyTest.java</exclude>
204                    <exclude>CodedInputStreamTest.java</exclude>
205                    <exclude>DeprecatedFieldTest.java</exclude>
206                    <exclude>DescriptorsTest.java</exclude>
207                    <exclude>DiscardUnknownFieldsTest.java</exclude>
208                    <exclude>DynamicMessageTest.java</exclude>
209                    <exclude>ExtensionRegistryFactoryTest.java</exclude>
210                    <exclude>FieldPresenceTest.java</exclude>
211                    <exclude>ForceFieldBuildersPreRun.java</exclude>
212                    <exclude>GeneratedMessageTest.java</exclude>
213                    <exclude>LazyFieldTest.java</exclude>
214                    <exclude>LazyStringEndToEndTest.java</exclude>
215                    <exclude>MapForProto2Test.java</exclude>
216                    <exclude>MapTest.java</exclude>
217                    <exclude>MessageTest.java</exclude>
218                    <exclude>NestedBuildersTest.java</exclude>
219                    <exclude>PackedFieldTest.java</exclude>
220                    <exclude>ParserTest.java</exclude>
221                    <exclude>ParseExceptionsTest.java</exclude>
222                    <exclude>Proto2ExtensionLookupSchemaTest.java</exclude>
223                    <exclude>Proto2SchemaTest.java</exclude>
224                    <exclude>Proto2UnknownEnumValueTest.java</exclude>
225                    <exclude>RepeatedFieldBuilderV3Test.java</exclude>
226                    <exclude>ServiceTest.java</exclude>
227                    <exclude>SingleFieldBuilderV3Test.java</exclude>
228                    <exclude>TestBadIdentifiers.java</exclude>
229                    <exclude>TextFormatParseInfoTreeTest.java</exclude>
230                    <exclude>TextFormatParseLocationTest.java</exclude>
231                    <exclude>TextFormatTest.java</exclude>
232                    <exclude>TestUtil.java</exclude>
233                    <exclude>TypeRegistryTest.java</exclude>
234                    <exclude>UnknownEnumValueTest.java</exclude>
235                    <exclude>UnknownFieldSetLiteTest.java</exclude>
236                    <exclude>UnknownFieldSetPerformanceTest.java</exclude>
237                    <exclude>UnknownFieldSetTest.java</exclude>
238                    <exclude>WellKnownTypesTest.java</exclude>
239                    <exclude>WireFormatTest.java</exclude>
240                  </excludes>
241                </resource>
242              </resources>
243            </configuration>
244          </execution>
245        </executions>
246      </plugin>
247
248      <!-- Use Antrun plugin to generate sources with protoc -->
249      <plugin>
250        <artifactId>maven-antrun-plugin</artifactId>
251        <executions>
252          <!-- Generate core protos -->
253          <execution>
254            <id>generate-sources</id>
255            <phase>generate-sources</phase>
256            <configuration>
257              <target>
258                <ant antfile="generate-sources-build.xml"/>
259              </target>
260            </configuration>
261            <goals>
262              <goal>run</goal>
263            </goals>
264          </execution>
265
266          <!-- Generate the test protos -->
267          <execution>
268            <id>generate-test-sources</id>
269            <phase>generate-test-sources</phase>
270            <configuration>
271              <target>
272                <ant antfile="generate-test-sources-build.xml"/>
273              </target>
274            </configuration>
275            <goals>
276              <goal>run</goal>
277            </goals>
278          </execution>
279
280          <execution>
281            <id>process-lite-sources</id>
282            <phase>generate-test-sources</phase>
283            <configuration>
284              <target>
285                <ant antfile="process-lite-sources-build.xml"/>
286              </target>
287            </configuration>
288            <goals>
289              <goal>run</goal>
290            </goals>
291          </execution>
292        </executions>
293      </plugin>
294
295      <plugin>
296        <groupId>org.codehaus.mojo</groupId>
297        <artifactId>build-helper-maven-plugin</artifactId>
298        <executions>
299          <execution>
300            <id>add-generated-sources</id>
301            <phase>generate-sources</phase>
302            <goals>
303              <goal>add-source</goal>
304            </goals>
305            <configuration>
306              <sources>
307                <source>${generated.sources.dir}</source>
308              </sources>
309            </configuration>
310          </execution>
311
312          <execution>
313            <id>add-generated-test-sources</id>
314            <phase>generate-test-sources</phase>
315            <goals>
316              <goal>add-test-source</goal>
317            </goals>
318            <configuration>
319              <sources>
320                <source>${generated.testsources.dir}</source>
321              </sources>
322            </configuration>
323          </execution>
324        </executions>
325      </plugin>
326
327      <!-- OSGI bundle configuration -->
328      <plugin>
329        <groupId>org.apache.felix</groupId>
330        <artifactId>maven-bundle-plugin</artifactId>
331        <extensions>true</extensions>
332        <configuration>
333          <instructions>
334            <Automatic-Module-Name>com.google.protobuf</Automatic-Module-Name> <!-- Java9+ Jigsaw module name -->
335            <Bundle-DocURL>https://developers.google.com/protocol-buffers/</Bundle-DocURL>
336            <Bundle-SymbolicName>com.google.protobuf</Bundle-SymbolicName>
337            <Export-Package>com.google.protobuf;version=${project.version}</Export-Package>
338            <Import-Package>sun.misc;resolution:=optional,*</Import-Package>
339          </instructions>
340        </configuration>
341      </plugin>
342    </plugins>
343  </build>
344
345</project>
346