forked from conductor-oss/grpcbin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
80 lines (68 loc) · 1.59 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
plugins {
id 'java'
id 'com.google.protobuf' version '0.9.4'
}
group = 'org.conductoross'
version = '1.0.0'
def grpcVersion = '1.68.1'
def protobufVersion = '4.28.2'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "io.grpc:grpc-services:${grpcVersion}"
implementation "com.google.protobuf:protobuf-java:${protobufVersion}"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protobufVersion}"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
// Configure JAR tasks
jar {
manifest {
attributes(
'Main-Class': 'org.conductoross.grpcbin.GRPCServer'
)
}
}
// Create tasks for fat JARs for both server and client
tasks.register('serverJar', Jar) {
archiveClassifier = 'server'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes 'Main-Class': 'org.conductoross.grpcbin.GRPCServer'
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
}
artifacts {
archives serverJar
}
tasks.named('test') {
useJUnitPlatform()
}