-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·85 lines (69 loc) · 2.11 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.14'
}
}
plugins {
id 'java'
id "com.google.protobuf" version "0.8.15"
id 'idea'
}
def grpcVersion = '1.36.0' // CURRENT_GRPC_VERSION
def protobufVersion = '3.12.0'
def protocVersion = protobufVersion
def nettyTcNativeVersion = '2.0.26.Final'
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
compile "io.grpc:grpc-netty-shaded:${grpcVersion}"
compile "io.grpc:grpc-protobuf:${grpcVersion}"
compile "io.grpc:grpc-stub:${grpcVersion}"
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.14.0'
compile group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.14.0'
compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
compile 'com.google.protobuf:protobuf-gradle-plugin:0.8.14'
compileOnly "javax.annotation:javax.annotation-api:1.2"
implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"
runtimeOnly "io.netty:netty-tcnative-boringssl-static:${nettyTcNativeVersion}"
testImplementation "io.grpc:grpc-testing:${grpcVersion}"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
}
}
jar {
manifest {
attributes 'Main-Class': 'com.p2p.Runner'
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
}
task simulateRace(type: JavaExec) {
classpath sourceSets.main.runtimeClasspath
main = "com.p2p.SimulateRace"
}
test {
useJUnitPlatform()
}