Skip to content

Commit 3bd9015

Browse files
committed
build: generate kotlin grpc stubs
Signed-off-by: Pedro Tôrres <[email protected]>
1 parent 800cb5e commit 3bd9015

File tree

2 files changed

+50
-4
lines changed

2 files changed

+50
-4
lines changed

api/pom.xml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,24 @@
2727
<version>${grpc.version}</version>
2828
</dependency>
2929

30+
<dependency>
31+
<groupId>io.grpc</groupId>
32+
<artifactId>grpc-kotlin-stub</artifactId>
33+
<version>${grpc-kotlin.version}</version>
34+
</dependency>
35+
3036
<dependency>
3137
<groupId>com.google.protobuf</groupId>
3238
<artifactId>protobuf-java</artifactId>
3339
<version>${protobuf.version}</version>
3440
</dependency>
3541

42+
<dependency>
43+
<groupId>org.jetbrains.kotlinx</groupId>
44+
<artifactId>kotlinx-coroutines-core</artifactId>
45+
<version>${kotlin-coroutines.version}</version>
46+
</dependency>
47+
3648
<dependency>
3749
<groupId>javax.annotation</groupId>
3850
<artifactId>javax.annotation-api</artifactId>
@@ -46,7 +58,7 @@
4658
<extension>
4759
<groupId>kr.motd.maven</groupId>
4860
<artifactId>os-maven-plugin</artifactId>
49-
<version>1.5.0.Final</version>
61+
<version>1.6.2</version>
5062
</extension>
5163
</extensions>
5264
<plugins>
@@ -58,20 +70,51 @@
5870
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
5971
<pluginId>grpc-java</pluginId>
6072
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
73+
<protocPlugins>
74+
<protocPlugin>
75+
<id>grpc-kotlin</id>
76+
<groupId>io.grpc</groupId>
77+
<artifactId>protoc-gen-grpc-kotlin</artifactId>
78+
<version>${grpc-kotlin.version}</version>
79+
<classifier>jdk7</classifier>
80+
<mainClass>io.grpc.kotlin.generator.GeneratorRunner</mainClass>
81+
</protocPlugin>
82+
</protocPlugins>
6183

6284
<useArgumentFile>true</useArgumentFile>
6385
<checkStaleness>true</checkStaleness>
6486
<staleMillis>10000</staleMillis>
6587
</configuration>
6688
<executions>
6789
<execution>
90+
<id>compile</id>
6891
<goals>
6992
<goal>compile</goal>
7093
<goal>compile-custom</goal>
7194
</goals>
7295
</execution>
7396
</executions>
7497
</plugin>
98+
99+
<plugin>
100+
<groupId>org.jetbrains.kotlin</groupId>
101+
<artifactId>kotlin-maven-plugin</artifactId>
102+
<version>${kotlin.version}</version>
103+
<executions>
104+
<execution>
105+
<id>compile</id>
106+
<goals>
107+
<goal>compile</goal>
108+
</goals>
109+
</execution>
110+
<execution>
111+
<id>test-compile</id>
112+
<goals>
113+
<goal>test-compile</goal>
114+
</goals>
115+
</execution>
116+
</executions>
117+
</plugin>
75118
</plugins>
76119
</build>
77120
</project>

pom.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@
2727
<auto-value.version>1.6.3</auto-value.version>
2828
<awaitility.version>3.1.6</awaitility.version>
2929
<checkstyle.version>8.18</checkstyle.version>
30-
<grpc.version>1.22.1</grpc.version>
31-
<guava.version>26.0-android</guava.version><!-- Keep the Guava version in sync with grpc-java -->
30+
<grpc.version>1.36.0</grpc.version>
31+
<grpc-kotlin.version>1.1.0</grpc-kotlin.version><!-- Keep the gRPC Kotlin version in sync with grpc-java -->
32+
<guava.version>30.0-android</guava.version><!-- Keep the Guava version in sync with grpc-java -->
3233
<junit.version>4.13.1</junit.version>
33-
<protobuf.version>3.9.1</protobuf.version><!-- Keep the Protobuf version in sync with grpc-java -->
34+
<kotlin.version>1.3.61</kotlin.version><!-- Keep the Kotlin version in sync with grpc-kotlin -->
35+
<kotlin-coroutines.version>1.3.3</kotlin-coroutines.version><!-- Keep the Kotlin Coroutines version in sync with grpc-kotlin -->
36+
<protobuf.version>3.12.0</protobuf.version><!-- Keep the Protobuf version in sync with grpc-java -->
3437
<rest-assured.version>3.1.0</rest-assured.version>
3538
<slf4j.version>1.7.26</slf4j.version>
3639
<testcontainers.version>1.15.3</testcontainers.version>

0 commit comments

Comments
 (0)