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.12</version> 8 </parent> 9 10 <artifactId>protobuf-kotlin-lite</artifactId> 11 12 <name>Protocol Buffers [Kotlin-Lite]</name> 13 <description> 14 Lite version of Kotlin Protocol Buffers library. This version is optimized for code size, but does 15 not guarantee API/ABI stability. 16 </description> 17 18 <properties> 19 <kotlin.version>1.6.0</kotlin.version> 20 </properties> 21 22 <dependencies> 23 <dependency> 24 <groupId>${project.groupId}</groupId> 25 <artifactId>protobuf-javalite</artifactId> 26 <version>${project.version}</version> 27 </dependency> 28 <dependency> 29 <groupId>junit</groupId> 30 <artifactId>junit</artifactId> 31 <scope>test</scope> 32 </dependency> 33 <dependency> 34 <groupId>org.mockito</groupId> 35 <artifactId>mockito-core</artifactId> 36 <scope>test</scope> 37 </dependency> 38 <dependency> 39 <groupId>com.google.guava</groupId> 40 <artifactId>guava</artifactId> 41 <scope>test</scope> 42 </dependency> 43 <dependency> 44 <groupId>com.google.guava</groupId> 45 <artifactId>guava-testlib</artifactId> 46 <scope>test</scope> 47 </dependency> 48 <dependency> 49 <groupId>com.google.truth</groupId> 50 <artifactId>truth</artifactId> 51 <scope>test</scope> 52 </dependency> 53 <dependency> 54 <groupId>org.jetbrains.kotlin</groupId> 55 <artifactId>kotlin-stdlib</artifactId> 56 <version>${kotlin.version}</version> 57 </dependency> 58 <dependency> 59 <groupId>org.jetbrains.kotlin</groupId> 60 <artifactId>kotlin-test</artifactId> 61 <version>${kotlin.version}</version> 62 <scope>test</scope> 63 </dependency> 64 </dependencies> 65 66 <build> 67 <testResources> 68 <testResource> 69 <directory>${protobuf.source.dir}</directory> 70 <includes> 71 <include>google/protobuf/testdata/golden_message_oneof_implemented</include> 72 <include>google/protobuf/testdata/golden_packed_fields_message</include> 73 </includes> 74 </testResource> 75 </testResources> 76 77 <plugins> 78 <plugin> 79 <artifactId>maven-resources-plugin</artifactId> 80 <version>3.1.0</version> 81 <executions> 82 <execution> 83 <id>copy-kotlin-source-files</id> 84 <phase>generate-sources</phase> 85 <goals> 86 <goal>copy-resources</goal> 87 </goals> 88 <configuration> 89 <outputDirectory>${generated.sources.dir}/com/google/protobuf</outputDirectory> 90 <resources> 91 <resource> 92 <directory>${basedir}/../kotlin/src/main/kotlin/com/google/protobuf</directory> 93 <includes> 94 <include>ByteStrings.kt</include> 95 <include>DslList.kt</include> 96 <include>DslMap.kt</include> 97 <include>DslProxy.kt</include> 98 <include>ExtensionList.kt</include> 99 <include>OnlyForUseByGeneratedProtoCode.kt</include> 100 <include>ProtoDslMarker.kt</include> 101 <include>UnmodifiableCollections.kt</include> 102 </includes> 103 </resource> 104 </resources> 105 </configuration> 106 </execution> 107 <execution> 108 <id>copy-test-source-files</id> 109 <phase>generate-test-sources</phase> 110 <goals> 111 <goal>copy-resources</goal> 112 </goals> 113 <configuration> 114 <outputDirectory>${generated.testsources.dir}/com/google/protobuf</outputDirectory> 115 <resources> 116 <resource> 117 <directory>${basedir}/../core/src/test/java/com/google/protobuf</directory> 118 <includes> 119 <include>TestUtilLite.java</include> 120 </includes> 121 </resource> 122 </resources> 123 </configuration> 124 </execution> 125 </executions> 126 </plugin> 127 128 <!-- Use Antrun plugin to generate sources with protoc --> 129 <plugin> 130 <artifactId>maven-antrun-plugin</artifactId> 131 <executions> 132 <!-- Generate core protos --> 133 <execution> 134 <id>generate-sources</id> 135 <phase>generate-sources</phase> 136 <configuration> 137 <target> 138 <ant antfile="generate-sources-build.xml"/> 139 </target> 140 </configuration> 141 <goals> 142 <goal>run</goal> 143 </goals> 144 </execution> 145 146 <!-- Generate the test protos --> 147 <execution> 148 <id>generate-test-sources</id> 149 <phase>generate-test-sources</phase> 150 <configuration> 151 <target> 152 <ant antfile="generate-test-sources-build.xml"/> 153 </target> 154 </configuration> 155 <goals> 156 <goal>run</goal> 157 </goals> 158 </execution> 159 160 <execution> 161 <id>process-lite-sources</id> 162 <phase>generate-test-sources</phase> 163 <configuration> 164 <target> 165 <ant antfile="process-lite-sources-build.xml"/> 166 </target> 167 </configuration> 168 <goals> 169 <goal>run</goal> 170 </goals> 171 </execution> 172 </executions> 173 </plugin> 174 175 <plugin> 176 <groupId>org.codehaus.mojo</groupId> 177 <artifactId>build-helper-maven-plugin</artifactId> 178 <executions> 179 <execution> 180 <id>add-generated-sources</id> 181 <phase>generate-sources</phase> 182 <goals> 183 <goal>add-source</goal> 184 </goals> 185 <configuration> 186 <sources> 187 <source>${generated.sources.dir}</source> 188 </sources> 189 </configuration> 190 </execution> 191 192 <execution> 193 <id>add-generated-test-sources</id> 194 <phase>generate-test-sources</phase> 195 <goals> 196 <goal>add-test-source</goal> 197 </goals> 198 <configuration> 199 <sources> 200 <source>${generated.testsources.dir}</source> 201 </sources> 202 </configuration> 203 </execution> 204 </executions> 205 </plugin> 206 207 <plugin> 208 <groupId>org.jetbrains.kotlin</groupId> 209 <artifactId>kotlin-maven-plugin</artifactId> 210 <version>${kotlin.version}</version> 211 <extensions>true</extensions> 212 <executions> 213 <execution> 214 <id>compile</id> 215 <goals> <goal>compile</goal> </goals> 216 <configuration> 217 <sourceDirs> 218 <sourceDir>${project.basedir}/src/main/kotlin</sourceDir> 219 <sourceDir>${generated.sources.dir}</sourceDir> 220 </sourceDirs> 221 </configuration> 222 </execution> 223 <execution> 224 <id>test-compile</id> 225 <goals> <goal>test-compile</goal> </goals> 226 <configuration> 227 <sourceDirs> 228 <sourceDir>${project.basedir}/src/test/kotlin</sourceDir> 229 <sourceDir>${generated.testsources.dir}</sourceDir> 230 </sourceDirs> 231 </configuration> 232 </execution> 233 </executions> 234 </plugin> 235 </plugins> 236 </build> 237</project> 238