-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
126 lines (114 loc) · 2.97 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
118
119
120
121
122
123
124
125
126
plugins {
id 'java'
id 'application'
id 'java-library'
id 'com.google.protobuf' version '0.8.17'
id 'antlr'
id 'org.graalvm.buildtools.native' version '0.9.14'
}
repositories {
mavenCentral()
gradlePluginPortal()
}
java{
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
dependencies {
testImplementation "junit:junit:4.12"
implementation 'io.grpc:grpc-netty-shaded:1.42.0'
implementation 'io.grpc:grpc-protobuf:1.42.0'
implementation 'io.grpc:grpc-stub:1.42.0'
implementation 'com.google.cloud:native-image-support:0.14.1'
compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+
implementation 'commons-cli:commons-cli:1.4'
implementation 'org.jdom:jdom2:2.0.6'
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
antlr "org.antlr:antlr4:4.10.1"
implementation 'org.antlr:antlr4-runtime:4.10.1'
implementation files('lib/jcdd.jar')
}
graalvmNative {
binaries {
main {
imageName = 'j-Ecdar'
mainClass = 'JECDAR'
useFatJar = true
sharedLibrary = false
}
}
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.17.3"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.42.0'
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
generateGrammarSource {
maxHeapSize = "128m"
arguments += ["-visitor", "-no-listener"]
}
sourceSets {
main {
java {
srcDirs = ['src', 'build/generated', 'build/generated-src/antlr/main']
}
proto{
srcDirs = ['src/proto']
}
antlr{
srcDirs = ['src/antlr']
}
}
test {
java {
srcDirs = ['test']
}
}
}
task fatJar(type: Jar) {
manifest {
attributes(
'Main-Class': 'connection.Main',
)
}
classifier = 'fat'
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
} {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
with jar
}
task submodulesUpdate(type:Exec) {
description 'Updates (and inits) git submodules'
commandLine 'git', 'submodule', 'update', '--init', '--recursive'
group 'Build Setup'
}
task unpack_without_dll(type:Copy, dependsOn: 'distZip') {
def zipFile = file("$buildDir/distributions/j-Ecdar.zip")
def outputDir = file("$buildDir/distributions/unpacked")
delete(outputDir)
from { zipTree(zipFile) }
into outputDir
group 'distribution'
}
task unpack_with_dll(type:Copy, dependsOn: 'unpack_without_dll') {
def dll = file("lib/JCDD.dll")
def outputDir = file("$buildDir/distributions/unpacked/j-Ecdar/bin")
from dll
into outputDir
group 'distribution'
}