-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.gradle
85 lines (73 loc) · 2.12 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
//file:noinspection GrUnresolvedAccess
//file:noinspection GroovyAssignabilityCheck
plugins {
id 'java'
id 'idea'
id 'com.google.protobuf' version '0.9.4'
id 'jacoco'
}
group 'com.clementjean.grpc'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
ext {
protoVersion = '3.24.4'
grpcVersion = '1.59.0'
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protoVersion"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
sourceSets.main.java.srcDir new File(buildDir, 'generated/source')
dependencies {
runtimeOnly "io.grpc:grpc-netty-shaded:$grpcVersion"
implementation "io.grpc:grpc-protobuf:$grpcVersion"
implementation "io.grpc:grpc-stub:$grpcVersion"
implementation "io.grpc:grpc-services:$grpcVersion"
compileOnly 'org.apache.tomcat:annotations-api:6.0.53'
implementation "com.google.protobuf:protobuf-java-util:$protoVersion"
implementation 'org.mongodb:mongodb-driver-sync:4.11.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
testImplementation 'org.mockito:mockito-core:5.2.0'
testImplementation "io.grpc:grpc-inprocess:$grpcVersion"
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
xml.required = false
html.required = false
csv.required = true
csv.destination file("${buildDir}/reports/jacoco/jacoco.csv")
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(
dir: it,
includes: [
"greeting/server/GreetingServiceImpl.class",
"calculator/server/CalculatorServiceImpl.class",
"blog/server/BlogServiceImpl.class",
"blog/client/BlogClient.class",
]
)
}))
}
}