forked from tronprotocol/java-tron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
205 lines (157 loc) · 5.96 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
group 'org.tron'
version '1.0.0'
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
apply plugin: 'application'
apply plugin: 'checkstyle'
sourceCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
mainClassName = 'org.tron.program.FullNode'
repositories {
mavenCentral()
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
}
}
def versions = [
checkstyle: '8.7',
]
configurations {
checkstyleConfig
}
configurations.getByName('checkstyleConfig') {
transitive = false
}
dependencies {
//local libraries
compile fileTree(dir: 'libs', include: '*.jar')
// end local libraries
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.13.0'
testCompile group: 'org.hamcrest', name: 'hamcrest-junit', version: '1.0.0.1'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25'
compile group: 'log4j', name: 'log4j', version: '1.2.17'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
compile "org.projectlombok:lombok:1.16.18"
compile group: 'commons-codec', name: 'commons-codec', version: '1.11'
compile "com.madgag.spongycastle:core:1.53.0.0"
compile "com.madgag.spongycastle:prov:1.53.0.0"
compile group: 'com.google.guava', name: 'guava', version: '18.0'
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.4.0'
compile "org.iq80.leveldb:leveldb:0.7"
compile group: 'org.fusesource.leveldbjni', name: 'leveldbjni-all',
version: '1.8'
compile "org.apache.commons:commons-collections4:4.0"
compile group: 'com.typesafe', name: 'config', version: '1.3.2'
compile "com.google.code.findbugs:jsr305:3.0.0"
compile "com.cedarsoftware:java-util:1.8.0"
compile "org.apache.commons:commons-lang3:3.4"
compile(group: 'org.apache.kafka', name: 'kafka_2.12', version: '0.11.0.2') {
exclude module: 'slf4j-log4j12'
}
compile group: 'org.springframework', name: 'spring-context', version: '4.2.0.RELEASE'
compile(group: 'org.apache.kafka', name: 'kafka_2.12', version: '0.11.0.2') {
exclude module: 'slf4j-log4j12'
}
compile "org.apache.commons:commons-collections4:4.0"
compile group: 'com.beust', name: 'jcommander', version: '1.72'
compile group: 'junit', name: 'junit', version: '4.8.1'
compile group: 'io.atomix.copycat', name: 'copycat-server', version: '1.1.4'
compile group: 'io.atomix.copycat', name: 'copycat-client', version: '1.1.4'
compile group: 'io.atomix.catalyst', name: 'catalyst-netty', version: '1.1.1'
compile group: 'net.jcip', name: 'jcip-annotations', version: '1.0'
compile group: 'org.fusesource.jansi', name: 'jansi', version: '1.16'
compile group: 'com.alibaba', name: 'fastjson', version: '1.2.44'
compile group: 'com.google.inject', name: 'guice', version: '4.1.0'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.5'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.5'
compile group: 'org.apache.commons', name: 'commons-math', version: '2.2'
compile group: 'joda-time', name: 'joda-time', version: '2.3'
compile group: 'io.dropwizard.metrics', name: 'metrics-core', version: '3.1.2'
checkstyleConfig "com.puppycrawl.tools:checkstyle:${versions.checkstyle}"
// google grpc
compile group: 'io.grpc', name: 'grpc-netty', version: '1.9.0'
compile group: 'io.grpc', name: 'grpc-protobuf', version: '1.9.0'
compile group: 'io.grpc', name: 'grpc-stub', version: '1.9.0'
// end google grpc
compile group: 'io.scalecube', name: 'scalecube-services', version: '1.0.7'
compile group: 'io.scalecube', name: 'scalecube-cluster', version: '1.0.7'
compile group: 'io.scalecube', name: 'scalecube-transport', version: '1.0.7'
compile group: 'com.carrotsearch', name: 'java-sizeof', version: '0.0.5'
}
check.dependsOn 'lint'
checkstyle {
toolVersion = "${versions.checkstyle}"
config = resources.text.fromArchiveEntry(configurations.checkstyleConfig, 'google_checks.xml')
}
checkstyleMain {
source 'src'
include '**/*.java'
exclude '**/gen/**'
}
task lint(type: Checkstyle) {
// Cleaning the old log because of the creation of the new ones (not sure if totaly needed)
delete fileTree(dir: "${project.rootDir}/app/build/reports")
source 'src'
include '**/*.java'
exclude '**/gen/**'
// empty classpath
classpath = files()
//Failing the build
ignoreFailures = false
}
tasks.matching { it instanceof Test }.all {
testLogging.events = ["failed", "passed", "skipped"]
}
if (project.hasProperty("mainClass")) {
mainClassName = mainClass
}
sourceSets {
main {
proto {
srcDir 'src/main/protos'
}
java {
srcDir 'src/main/gen'
srcDir 'src/main/java'
}
}
}
//protobuf.protoc {
// artifact = 'com.google.protobuf:protoc:3.4.0'
//}
protobuf {
generatedFilesBaseDir = "$projectDir/src/"
protoc {
artifact = "com.google.protobuf:protoc:3.5.1-1"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.9.0'
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
java { outputSubDir = "gen" }
}
}
all()*.plugins {
grpc {
outputSubDir = "gen"
}
}
}
}
run {
if (project.hasProperty('server')) {
standardInput = System.in
args = ['--type', 'server']
}
}