aboutsummaryrefslogtreecommitdiffstats
path: root/build/export_generators/ide-gradle/protobuf.jinja
blob: d2935b18b41e5b274d4d22344004cc76f6b2ecd3 (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
39
40
41
{#- empty string #}
protobuf {
    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 %}
    }
{%- endif %}

{%- if target.proto_kotlin or target.proto_grpc %}

    generateProtoTasks {
        all().forEach {
{%-     if target.proto_grpc %}
            it.plugins {
                id("grpc")
{%-         if target.proto_kotlin_grpc %}
                id("grpckt")
{%-         endif %}
            }
{%-     endif %}
{%-     if target.proto_kotlin or target.proto_kotlin_grpc %}
            it.builtins {
                create("kotlin")
            }
{%-     endif %}
        }
    }
{%- endif %}
}