pom.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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/maven-v4_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.19.4</version>
  8. </parent>
  9. <artifactId>protobuf-kotlin</artifactId>
  10. <name>Protocol Buffers [Core]</name>
  11. <description>
  12. Core Protocol Buffers library. Protocol Buffers are a way of encoding structured data in an
  13. efficient yet extensible format.
  14. </description>
  15. <properties>
  16. <kotlin.version>1.5.0</kotlin.version>
  17. </properties>
  18. <dependencies>
  19. <dependency>
  20. <groupId>${project.groupId}</groupId>
  21. <artifactId>protobuf-java</artifactId>
  22. </dependency>
  23. <dependency>
  24. <groupId>junit</groupId>
  25. <artifactId>junit</artifactId>
  26. <scope>test</scope>
  27. </dependency>
  28. <dependency>
  29. <groupId>org.easymock</groupId>
  30. <artifactId>easymock</artifactId>
  31. <scope>test</scope>
  32. </dependency>
  33. <dependency>
  34. <groupId>com.google.guava</groupId>
  35. <artifactId>guava</artifactId>
  36. <scope>test</scope>
  37. </dependency>
  38. <dependency>
  39. <groupId>com.google.guava</groupId>
  40. <artifactId>guava-testlib</artifactId>
  41. <scope>test</scope>
  42. </dependency>
  43. <dependency>
  44. <groupId>com.google.truth</groupId>
  45. <artifactId>truth</artifactId>
  46. <scope>test</scope>
  47. </dependency>
  48. <dependency>
  49. <groupId>org.jetbrains.kotlin</groupId>
  50. <artifactId>kotlin-stdlib</artifactId>
  51. <version>${kotlin.version}</version>
  52. </dependency>
  53. <dependency>
  54. <groupId>org.jetbrains.kotlin</groupId>
  55. <artifactId>kotlin-test</artifactId>
  56. <version>${kotlin.version}</version>
  57. <scope>test</scope>
  58. </dependency>
  59. </dependencies>
  60. <build>
  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. <plugins>
  71. <plugin>
  72. <artifactId>maven-resources-plugin</artifactId>
  73. <version>3.1.0</version>
  74. <executions>
  75. <execution>
  76. <id>copy-test-source-files</id>
  77. <phase>generate-test-sources</phase>
  78. <goals>
  79. <goal>copy-resources</goal>
  80. </goals>
  81. <configuration>
  82. <outputDirectory>${generated.testsources.dir}/com/google/protobuf</outputDirectory>
  83. <resources>
  84. <resource>
  85. <directory>${basedir}/../core/src/test/java/com/google/protobuf</directory>
  86. <includes>
  87. <include>TestUtil.java</include>
  88. <include>TestUtilLite.java</include>
  89. </includes>
  90. </resource>
  91. </resources>
  92. </configuration>
  93. </execution>
  94. </executions>
  95. </plugin>
  96. <!-- Use Antrun plugin to generate sources with protoc -->
  97. <plugin>
  98. <artifactId>maven-antrun-plugin</artifactId>
  99. <executions>
  100. <!-- Generate core protos -->
  101. <execution>
  102. <id>generate-sources</id>
  103. <phase>generate-sources</phase>
  104. <configuration>
  105. <target>
  106. <ant antfile="generate-sources-build.xml"/>
  107. </target>
  108. </configuration>
  109. <goals>
  110. <goal>run</goal>
  111. </goals>
  112. </execution>
  113. <!-- Generate the test protos -->
  114. <execution>
  115. <id>generate-test-sources</id>
  116. <phase>generate-test-sources</phase>
  117. <configuration>
  118. <target>
  119. <ant antfile="generate-test-sources-build.xml"/>
  120. </target>
  121. </configuration>
  122. <goals>
  123. <goal>run</goal>
  124. </goals>
  125. </execution>
  126. </executions>
  127. </plugin>
  128. <!-- Add the generated sources to the build -->
  129. <plugin>
  130. <groupId>org.codehaus.mojo</groupId>
  131. <artifactId>build-helper-maven-plugin</artifactId>
  132. <executions>
  133. <execution>
  134. <id>add-generated-sources</id>
  135. <phase>generate-sources</phase>
  136. <goals>
  137. <goal>add-source</goal>
  138. </goals>
  139. <configuration>
  140. <sources>
  141. <source>${generated.sources.dir}</source>
  142. </sources>
  143. </configuration>
  144. </execution>
  145. <execution>
  146. <id>add-generated-test-sources</id>
  147. <phase>generate-test-sources</phase>
  148. <goals>
  149. <goal>add-test-source</goal>
  150. </goals>
  151. <configuration>
  152. <sources>
  153. <source>${generated.testsources.dir}</source>
  154. </sources>
  155. </configuration>
  156. </execution>
  157. </executions>
  158. </plugin>
  159. <plugin>
  160. <groupId>org.jetbrains.kotlin</groupId>
  161. <artifactId>kotlin-maven-plugin</artifactId>
  162. <version>${kotlin.version}</version>
  163. <extensions>true</extensions>
  164. <executions>
  165. <execution>
  166. <id>compile</id>
  167. <goals> <goal>compile</goal> </goals>
  168. <configuration>
  169. <sourceDirs>
  170. <sourceDir>${generated.sources.dir}</sourceDir>
  171. <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
  172. </sourceDirs>
  173. </configuration>
  174. </execution>
  175. <execution>
  176. <id>test-compile</id>
  177. <goals> <goal>test-compile</goal> </goals>
  178. <configuration>
  179. <sourceDirs>
  180. <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
  181. <sourceDir>${generated.testsources.dir}</sourceDir>
  182. </sourceDirs>
  183. </configuration>
  184. </execution>
  185. </executions>
  186. </plugin>
  187. </plugins>
  188. </build>
  189. </project>