-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
127 lines (108 loc) · 3.54 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
plugins {
id 'idea'
//id 'application'
id 'java'
id 'com.google.protobuf' version '0.9.4'
id 'org.jetbrains.kotlin.jvm' version '2.1.0'
// id 'org.jmailen.kotlinter' version "5.0.0"
id "com.github.ben-manes.versions" version "0.51.0"
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
group 'org.athenian'
version '1.0-SNAPSHOT'
//def mainName = 'org.athenian.kotlin_helloworld.HelloWorldCR'
//def appName = 'helloworld'
repositories {
google()
mavenCentral()
maven { url = "https://jitpack.io" }
}
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "io.grpc:grpc-netty-shaded:$grpc_version"
implementation "io.grpc:grpc-protobuf:$grpc_version"
implementation "io.grpc:grpc-stub:$grpc_version"
implementation "io.grpc:grpc-services:$grpc_version"
implementation "io.grpc:grpc-kotlin-stub:$gengrpc_version"
implementation "com.google.protobuf:protobuf-java-util:$protoc_version"
implementation "io.github.oshai:kotlin-logging:$logging_version"
implementation "ch.qos.logback:logback-classic:$logback_version"
implementation "org.slf4j:jul-to-slf4j:$slf4j_version"
compileOnly "javax.annotation:javax.annotation-api:$annotation_version"
testImplementation "io.grpc:grpc-testing:$grpc_version"
testImplementation "org.mockito:mockito-core:$mockito_version"
testImplementation "junit:junit:$junit_version"
}
kotlin {
jvmToolchain(11)
}
compileKotlin.dependsOn ':generateProto'
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protoc_version"
}
plugins {
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:$gengrpc_version:jdk8@jar"
}
}
generateProtoTasks {
all().each { task ->
task.plugins {
grpc {} // Generate Java gRPC classes
grpckt {} // Generate Kotlin gRPC using the custom plugin from library
}
}
}
}
compileKotlin {
kotlinOptions {
freeCompilerArgs = ["-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.InternalCoroutinesApi"]
}
}
compileTestKotlin {
}
// Required for multiple uberjar targets
shadowJar {
mergeServiceFiles()
}
// Uberjar tasks
tasks.register('java_server', Jar) {
dependsOn shadowJar
archiveFileName = 'java-server.jar'
manifest {
attributes('Main-Class': 'org.athenian.java_helloworld.HelloWorldServer')
}
from zipTree(shadowJar.archiveFile)
}
tasks.register('java_client', Jar) {
dependsOn shadowJar
archiveFileName = 'java-client.jar'
manifest {
attributes('Main-Class': 'org.athenian.java_helloworld.HelloWorldClient')
}
from zipTree(shadowJar.archiveFile)
}
tasks.register('kotlin_server', Jar) {
dependsOn shadowJar
archiveFileName = 'kotlin-server.jar'
manifest {
attributes('Main-Class': 'org.athenian.kotlin_helloworld.HelloWorldServerCR')
}
from zipTree(shadowJar.archiveFile)
}
tasks.register('kotlin_client', Jar) {
dependsOn shadowJar
archiveFileName = 'kotlin-client.jar'
manifest {
attributes('Main-Class': 'org.athenian.kotlin_helloworld.HelloWorldClientCR')
}
from zipTree(shadowJar.archiveFile)
}
//startScripts.dependsOn(otherStartScripts)
tasks.register('stage') { dependsOn "installDist" }