-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
99 lines (85 loc) · 2.72 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
plugins {
id 'java'
id 'com.google.protobuf' version '0.8.8'
id 'idea'
id 'com.avast.gradle.docker-compose' version '0.7.1'
}
group 'online.xloypaypa'
version '1.0.0'
sourceCompatibility = 11
targetCompatibility = 11
repositories {
maven { // The google mirror is less flaky than mavenCentral()
url "https://maven-central.storage-download.googleapis.com/repos/central/data/"
}
mavenCentral()
mavenLocal()
}
def grpcVersion = '1.24.0'
def nettyTcNativeVersion = '2.0.26.Final'
def protocVersion = '3.10.0'
jar {
from {
configurations.compileClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes 'Main-Class': 'online.xloypaypa.dns.relay.Main'
}
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
}
dependencies {
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
implementation group: 'com.github.seancfoley', name: 'ipaddress', version: '5.0.2'
implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '5.5.1.201910021850-r'
implementation group: 'org.clojure', name: 'clojure', version: '1.10.1'
implementation "io.grpc:grpc-netty:${grpcVersion}"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
compileOnly "javax.annotation:javax.annotation-api:1.2"
runtime "io.netty:netty-tcnative-boringssl-static:${nettyTcNativeVersion}"
testCompile group: 'junit', name: 'junit', version: '4.12'
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
}
// Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code.
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
}
test {
java {
resources {
srcDirs 'example'
}
}
}
}
dockerCompose {
useComposeFiles = ['.//example/docker-compose.yml']
}
task deleteExamplePacakge(type: Delete) {
delete 'example/example/dns-relay-1.0.0.jar'
followSymlinks = true
}
task buildAndMovePackage(type: Copy) {
from 'build/libs/dns-relay-1.0.0.jar'
into 'example/example/'
}
clean.dependsOn(deleteExamplePacakge)
buildAndMovePackage.dependsOn(deleteExamplePacakge)
buildAndMovePackage.dependsOn(build)
composeUp.dependsOn(buildAndMovePackage)
composeBuild.dependsOn(buildAndMovePackage)