diff options
author | dimdim11 <dimdim11@yandex-team.com> | 2024-11-11 07:53:20 +0300 |
---|---|---|
committer | dimdim11 <dimdim11@yandex-team.com> | 2024-11-11 08:07:47 +0300 |
commit | 96fe69bacb64fa8f677588717d5cc139117cb761 (patch) | |
tree | b283f1f2cc9d7ec04af82404f3dcf0c5b15f6dc1 /build | |
parent | 957f86df328db96cde860a1f5c8ba564358688a3 (diff) | |
download | ydb-96fe69bacb64fa8f677588717d5cc139117cb761.tar.gz |
Support WITH_KOTLIN_GRPC for ya ide gradle
Support WITH_KOTLIN_GRPC for ya ide gradle
commit_hash:3393b00307a4160894a72e073eb2eeb9e8f0d747
Diffstat (limited to 'build')
-rw-r--r-- | build/conf/java.conf | 1 | ||||
-rw-r--r-- | build/conf/proto.conf | 7 | ||||
-rw-r--r-- | build/export_generators/ide-gradle/build.gradle.kts.proto.jinja | 15 | ||||
-rw-r--r-- | build/export_generators/ide-gradle/generator.toml | 2 |
4 files changed, 22 insertions, 3 deletions
diff --git a/build/conf/java.conf b/build/conf/java.conf index 39fd1835d4..4bce6eb2e5 100644 --- a/build/conf/java.conf +++ b/build/conf/java.conf @@ -1985,6 +1985,7 @@ DETEKT_VERSION=1.23.7 _KOTLIN_SEM= \ ${_WITH_KOTLIN_SEM} \ ${_KOTLIN_VERSION_SEM} \ + ${_WITH_KOTLIN_GRPC_SEM} \ ${_WITH_KOTLINC_PLUGIN_ALLOPEN_SEM} \ ${_WITH_KOTLINC_PLUGIN_LOMBOK_SEM} \ ${_WITH_KOTLINC_PLUGIN_NOARG_SEM} \ diff --git a/build/conf/proto.conf b/build/conf/proto.conf index 1a059839c2..a55bfbe7bd 100644 --- a/build/conf/proto.conf +++ b/build/conf/proto.conf @@ -199,12 +199,14 @@ macro _ADD_SEM_PROP_IF_NON_EMPTY(Prop, Args...) { } # tag:proto tag:java-specific +_WITH_KOTLIN_GRPC_SEM= macro WITH_KOTLIN_GRPC() { ENABLE(KOTLIN_PROTO) PEERDIR(build/platform/java/kotlin_grpc) - 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) - SET(JAVA_PROTOBUF_PEERS $JAVA_PROTOBUF_PEERS contrib/java/io/grpc/grpc-kotlin-stub/1.3.1) + 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) + SET(JAVA_PROTOBUF_PEERS $JAVA_PROTOBUF_PEERS contrib/java/io/grpc/grpc-kotlin-stub/$KOTLIN_GRPC_VERSION) SET(JAVA_PROTOBUF_PEERS $JAVA_PROTOBUF_PEERS contrib/java/com/google/protobuf/protobuf-kotlin/${JAVA_PROTO_RUNTIME_VERSION}) + SET(_WITH_KOTLIN_GRPC_SEM && proto_kotlin_grpc && proto_kotlin_grpc_version ${KOTLIN_GRPC_VERSION}) } @@ -477,6 +479,7 @@ JAVA_PROTO_COMPILER_VERSION = 3.25.3 JAVA_PROTO_RUNTIME_VERSION = 3.25.3 JAVA_PROTO_COMMON_VERSION = 2.9.0 JAVA_GRPC_VERSION = 1.51.0 +KOTLIN_GRPC_VERSION = 1.3.1 JAVA_NETTY_NETTY_VERSION = 4.1.79.Final KOTLIN_PROTO=no KOTLIN_PROTO_PEERS= diff --git a/build/export_generators/ide-gradle/build.gradle.kts.proto.jinja b/build/export_generators/ide-gradle/build.gradle.kts.proto.jinja index d81a7ea0b0..7e0e0c1990 100644 --- a/build/export_generators/ide-gradle/build.gradle.kts.proto.jinja +++ b/build/export_generators/ide-gradle/build.gradle.kts.proto.jinja @@ -106,17 +106,30 @@ protobuf { // Download from repositories artifact = "com.google.protobuf:protoc:{%- if target.proto_compiler_version -%}{{ target.proto_compiler_version }}{%- else -%}3.22.5{%- endif -%}" } -{% if target.proto_grpc is defined -%} +{% if target.proto_grpc -%} plugins { id("grpc") { artifact = "io.grpc:protoc-gen-grpc-java:{%- if target.proto_grpc_version -%}{{ target.proto_grpc_version }}{%- else -%}1.45.0{%- endif -%}" } +{%- if target.proto_kotlin_grpc %} + id("grpckt") { + 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" + } +{% endif -%} } generateProtoTasks { all().forEach { it.plugins { id("grpc") +{%- if target.proto_kotlin_grpc %} + id("grpckt") +{% endif -%} + } +{%- if target.proto_kotlin_grpc %} + it.builtins { + create("kotlin") } +{% endif -%} } } {%- endif %} diff --git a/build/export_generators/ide-gradle/generator.toml b/build/export_generators/ide-gradle/generator.toml index f35be9acf0..9ce2265eac 100644 --- a/build/export_generators/ide-gradle/generator.toml +++ b/build/export_generators/ide-gradle/generator.toml @@ -43,6 +43,8 @@ proto_common_version="str" proto_grpc="flag" proto_grpc_version="str" +proto_kotlin_grpc="flag" +proto_kotlin_grpc_version="str" kotlin_version="str" with_kotlin="flag" |