blob: 68032069572355f9897efe21decbbe890e3dfd4f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
{#- empty string #}
protobuf {
generatedFilesBaseDir = "$buildDir/generated/sources/proto"
protoc {
// 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 %}
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 %}
}
|