This repository was archived by the owner on Jun 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
178 lines (151 loc) · 5.11 KB
/
Copy pathbuild.gradle
File metadata and controls
178 lines (151 loc) · 5.11 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
buildscript {
ext.kotlinVersion = '1.4.10'
ext.coroutinesVersion = '1.3.7'
ext.protobufPlugInVersion = '0.8.12'
ext.protobufVersion = '3.12.2'
ext.grpcVersion = '1.29.0'
ext.grpcKotlinVersion = '0.1.3'
repositories {
mavenCentral()
}
dependencies {
classpath "com.google.protobuf:protobuf-gradle-plugin:$protobufPlugInVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.4.30'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.4.30'
id "com.google.protobuf" version "0.8.15"
id 'application'
id 'idea'
id 'maven-publish'
}
group 'org.feup.lapd.middleware'
version '1.0.2'
def ktor_version = '1.5.2'
def arrow_version = "0.13.1"
def protobufVersion = '3.12.2'
def grpcVersion = '1.29.0'
def grpcKotlinVersion = '0.1.3'
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.30"
implementation "io.ktor:ktor-server-core:$ktor_version"
implementation "io.ktor:ktor-server-netty:$ktor_version"
implementation "io.ktor:ktor-client-core:$ktor_version"
implementation "io.ktor:ktor-client-cio:$ktor_version"
implementation "io.ktor:ktor-client-jackson:$ktor_version"
implementation "io.ktor:ktor-jackson:$ktor_version"
implementation "io.ktor:ktor-serialization:$ktor_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.1.0"
implementation group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.15.6'
implementation "ch.qos.logback:logback-classic:1.2.3"
implementation "io.arrow-kt:arrow-core:$arrow_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.4.3'
implementation "org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc:0.12.0"
implementation "org.jetbrains.kotlin:kotlin-reflect:1.4.30"
compile 'com.github.avro-kotlin.avro4k:avro4k-core:1.2.0'
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
implementation "com.google.protobuf:protobuf-java-util:$protobufVersion"
implementation "io.grpc:grpc-netty-shaded:$grpcVersion"
implementation "io.grpc:grpc-protobuf:$grpcVersion"
implementation "io.grpc:grpc-stub:$grpcVersion"
implementation "io.grpc:grpc-kotlin-stub:$grpcKotlinVersion"
implementation 'javax.annotation:javax.annotation-api:1.3.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:1.7.0'
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protobufVersion"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion"
}
grpckt {
artifact = "io.grpc:protoc-gen-grpc-kotlin:$grpcKotlinVersion"
}
}
generateProtoTasks {
all().each { task ->
task.plugins {
// Generate Java gRPC classes
grpc { }
// Generate Kotlin gRPC using the custom plugin from library
grpckt { }
}
}
}
}
idea {
module {
sourceDirs += file("${projectDir}/src/generated/java")
sourceDirs += file("${projectDir}/src/generated/grpc")
sourceDirs += file("${projectDir}/src/generated/grpckt")
}
}
test {
useJUnitPlatform()
}
task startGRPCServer(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'com.grpc.server.ServerLauncher'
args '8808'
standardInput = System.in
}
task startGRPCClient(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'com.grpc.client.ClientLauncher'
args 'localhost', '8808'
standardInput = System.in
}
task startJRPCServer(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'com.jrpc.server.ServerLauncher'
args '3000'
standardInput = System.in
}
task startJRPCClient(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'com.jrpc.client.ClientLauncher'
args 'localhost', '3000'
standardInput = System.in
}
task startJsonRpcExample(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'org.feup.lapd.middleware.JsonRpcExample'
}
task startProtobufServer(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'com.proto.ProtobufApplication'
args '6006'
}
task startApacheAvroServer(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'com.apache.ApacheAvroApplication'
args '6060'
}
task startProtobufExample(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'org.feup.lapd.middleware.ProtobufExample'
}
task startGrpcExample(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'org.feup.lapd.middleware.GRpcExample'
}
task startApacheAvroExample(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'org.feup.lapd.middleware.ApacheAvroExample'
}
publishing {
publications {
myLibrary(MavenPublication) {
from components.java
}
}
}