-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
97 lines (83 loc) · 2.72 KB
/
build.gradle
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.11'
}
}
def protobuf_version = '3.11.1'
def grpc_version = '1.28.1'
def grpc_kotlin_version = '0.1.1'
def coroutines_version = '1.3.3'
apply plugin: 'kotlin'
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: 'application'
apply plugin: "com.google.protobuf"
apply plugin: "idea"
group 'io.project'
version '0.0.1-SNAPSHOT'
mainClassName = "io.ktor.server.tomcat.EngineMain"
shadowJar {
baseName = 'kasjopedia-backend'
classifier = ''
archiveVersion = ''
}
sourceSets {
main.resources.srcDirs = ['resources']
}
repositories {
mavenLocal()
jcenter()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "io.ktor:ktor-server-tomcat:$ktor_version"
implementation "ch.qos.logback:logback-classic:$logback_version"
testImplementation "io.ktor:ktor-server-tests:$ktor_version"
compile "io.ktor:ktor-jackson:$ktor_version"
compile 'org.litote.kmongo:kmongo:4.0.0'
implementation "io.grpc:grpc-kotlin-stub:$grpc_kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
// Grpc and Protobuf
implementation "com.google.protobuf:protobuf-java:$protobuf_version"
implementation "com.google.protobuf:protobuf-java-util:$protobuf_version"
implementation "io.grpc:grpc-netty-shaded:$grpc_version"
implementation "io.grpc:grpc-protobuf:$grpc_version"
implementation "io.grpc:grpc-stub:$grpc_version"
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:$protobuf_version" }
plugins {
// Specify protoc to generate using kotlin protobuf plugin
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:$grpc_version"
}
// Specify protoc to generate using our grpc kotlin plugin
grpckt {
artifact = "io.grpc:protoc-gen-grpc-kotlin:$grpc_kotlin_version"
}
}
generateProtoTasks {
all().each { task ->
task.plugins {
// Generate Java gRPC classes
grpc {}
// Generate Kotlin gRPC using the custom plugin from library
grpckt {}
}
}
}
}
startScripts.enabled = false