Skip to content

Commit 96fe69b

Browse files
committed
Support WITH_KOTLIN_GRPC for ya ide gradle
Support WITH_KOTLIN_GRPC for ya ide gradle commit_hash:3393b00307a4160894a72e073eb2eeb9e8f0d747
1 parent 957f86d commit 96fe69b

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

build/conf/java.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,6 +1985,7 @@ DETEKT_VERSION=1.23.7
19851985
_KOTLIN_SEM= \
19861986
${_WITH_KOTLIN_SEM} \
19871987
${_KOTLIN_VERSION_SEM} \
1988+
${_WITH_KOTLIN_GRPC_SEM} \
19881989
${_WITH_KOTLINC_PLUGIN_ALLOPEN_SEM} \
19891990
${_WITH_KOTLINC_PLUGIN_LOMBOK_SEM} \
19901991
${_WITH_KOTLINC_PLUGIN_NOARG_SEM} \

build/conf/proto.conf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,14 @@ macro _ADD_SEM_PROP_IF_NON_EMPTY(Prop, Args...) {
199199
}
200200

201201
# tag:proto tag:java-specific
202+
_WITH_KOTLIN_GRPC_SEM=
202203
macro WITH_KOTLIN_GRPC() {
203204
ENABLE(KOTLIN_PROTO)
204205
PEERDIR(build/platform/java/kotlin_grpc)
205-
SET_APPEND(JAVA_PROTO_ARGS ${env:"JAVA_HOME=${JDK_RESOURCE}"} ${env:"KOTLIN_GRPC_JAR=${KOTLIN_GRPC_RESOURCE_GLOBAL}/grpc_kotlin/protoc-gen-grpc-kotlin-1.3.1.jar"} --plugin=protoc-gen-kotlin_grpc=${KOTLIN_GRPC_RESOURCE_GLOBAL}/grpc_kotlin/grpc_kotlin --kotlin_grpc_out=$ARCADIA_BUILD_ROOT/java_out)
206-
SET(JAVA_PROTOBUF_PEERS $JAVA_PROTOBUF_PEERS contrib/java/io/grpc/grpc-kotlin-stub/1.3.1)
206+
SET_APPEND(JAVA_PROTO_ARGS ${env:"JAVA_HOME=${JDK_RESOURCE}"} ${env:"KOTLIN_GRPC_JAR=${KOTLIN_GRPC_RESOURCE_GLOBAL}/grpc_kotlin/protoc-gen-grpc-kotlin-${KOTLIN_GRPC_VERSION}.jar"} --plugin=protoc-gen-kotlin_grpc=${KOTLIN_GRPC_RESOURCE_GLOBAL}/grpc_kotlin/grpc_kotlin --kotlin_grpc_out=$ARCADIA_BUILD_ROOT/java_out)
207+
SET(JAVA_PROTOBUF_PEERS $JAVA_PROTOBUF_PEERS contrib/java/io/grpc/grpc-kotlin-stub/$KOTLIN_GRPC_VERSION)
207208
SET(JAVA_PROTOBUF_PEERS $JAVA_PROTOBUF_PEERS contrib/java/com/google/protobuf/protobuf-kotlin/${JAVA_PROTO_RUNTIME_VERSION})
209+
SET(_WITH_KOTLIN_GRPC_SEM && proto_kotlin_grpc && proto_kotlin_grpc_version ${KOTLIN_GRPC_VERSION})
208210
}
209211

210212

@@ -477,6 +479,7 @@ JAVA_PROTO_COMPILER_VERSION = 3.25.3
477479
JAVA_PROTO_RUNTIME_VERSION = 3.25.3
478480
JAVA_PROTO_COMMON_VERSION = 2.9.0
479481
JAVA_GRPC_VERSION = 1.51.0
482+
KOTLIN_GRPC_VERSION = 1.3.1
480483
JAVA_NETTY_NETTY_VERSION = 4.1.79.Final
481484
KOTLIN_PROTO=no
482485
KOTLIN_PROTO_PEERS=

build/export_generators/ide-gradle/build.gradle.kts.proto.jinja

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,30 @@ protobuf {
106106
// Download from repositories
107107
artifact = "com.google.protobuf:protoc:{%- if target.proto_compiler_version -%}{{ target.proto_compiler_version }}{%- else -%}3.22.5{%- endif -%}"
108108
}
109-
{% if target.proto_grpc is defined -%}
109+
{% if target.proto_grpc -%}
110110
plugins {
111111
id("grpc") {
112112
artifact = "io.grpc:protoc-gen-grpc-java:{%- if target.proto_grpc_version -%}{{ target.proto_grpc_version }}{%- else -%}1.45.0{%- endif -%}"
113113
}
114+
{%- if target.proto_kotlin_grpc %}
115+
id("grpckt") {
116+
artifact = "io.grpc:protoc-gen-grpc-kotlin:{%- if target.proto_kotlin_grpc_version -%}{{ target.proto_kotlin_grpc_version }}{%- else -%}1.3.1{%- endif -%}:jdk8@jar"
117+
}
118+
{% endif -%}
114119
}
115120
generateProtoTasks {
116121
all().forEach {
117122
it.plugins {
118123
id("grpc")
124+
{%- if target.proto_kotlin_grpc %}
125+
id("grpckt")
126+
{% endif -%}
127+
}
128+
{%- if target.proto_kotlin_grpc %}
129+
it.builtins {
130+
create("kotlin")
119131
}
132+
{% endif -%}
120133
}
121134
}
122135
{%- endif %}

build/export_generators/ide-gradle/generator.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ proto_common_version="str"
4343

4444
proto_grpc="flag"
4545
proto_grpc_version="str"
46+
proto_kotlin_grpc="flag"
47+
proto_kotlin_grpc_version="str"
4648

4749
kotlin_version="str"
4850
with_kotlin="flag"

0 commit comments

Comments
 (0)