-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
117 lines (99 loc) · 3.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
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
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
mavenCentral()
maven {
name 'JFrog OSS snapshot repo'
url 'https://oss.jfrog.org/oss-snapshot-local/'
}
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'com.google.protobuf' version '0.9.2'
id "com.diffplug.spotless" version "6.19.0"
}
apply plugin: 'kotlin'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'antlr'
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
def grpcVersion = '1.52.1' // CURRENT_GRPC_VERSION
def protobufVersion = '3.17.2'
def protocVersion = protobufVersion
dependencies {
implementation 'org.junit.jupiter:junit-jupiter:5.7.0'
antlr "org.antlr:antlr4:4.9.1"
implementation "org.antlr:antlr4-runtime:4.9.1"
implementation 'com.google.protobuf:protobuf-java:3.19.6'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation 'junit:junit:4.13.1'
implementation 'com.beust:klaxon:5.5'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
//GRPC:
implementation "io.grpc:grpc-protobuf:$grpcVersion"
implementation "io.grpc:grpc-stub:$grpcVersion"
compileOnly "org.apache.tomcat:annotations-api:6.0.53"
// Plotting
implementation "org.jetbrains.lets-plot:lets-plot-kotlin-jvm:3.2.0"
implementation "org.slf4j:slf4j-simple:1.7.36" // Enable logging to console
// examples/advanced need this for JsonFormat
implementation "com.google.protobuf:protobuf-java-util:$protobufVersion"
runtimeOnly "io.grpc:grpc-netty-shaded:$grpcVersion"
testImplementation "io.grpc:grpc-testing:$grpcVersion"
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all().configureEach { task ->
task.plugins { grpc {} }
}
}
}
generateGrammarSource {
maxHeapSize = "64m"
arguments += ['-visitor', '-package', 'parser']
outputDirectory = new File("src/main/java/parser".toString())
}
compileKotlin.dependsOn generateGrammarSource
sourceSets {
generated {
java.srcDir 'src/main/java/'
}
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
proto {
srcDirs 'src/main/Ecdar-ProtoBuf'
}
}
}
// show results when running gradlew test
test {
useJUnitPlatform()
systemProperties["junit.jupiter.execution.parallel.enabled"] = true
systemProperties["junit.jupiter.execution.parallel.mode.default"] = "concurrent"
maxParallelForks = Runtime.getRuntime().availableProcessors()
testLogging {
events "passed", "skipped", "failed"
}
}
spotless {
kotlin {
ktfmt('0.44').dropboxStyle()
}
}