|
1 |
| -buildscript { |
2 |
| - repositories { |
3 |
| - mavenCentral() |
4 |
| - jcenter() |
5 |
| - maven { url 'https://jitpack.io' } |
6 |
| - } |
7 |
| - dependencies { |
8 |
| - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3' |
9 |
| - classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2' |
10 |
| - } |
11 |
| -} |
12 |
| -plugins { |
13 |
| - id "org.sonarqube" version "2.6" |
14 |
| -} |
15 |
| - |
16 |
| -group 'org.tron' |
17 |
| -version '1.0.0' |
18 |
| - |
19 |
| -apply plugin: 'java' |
20 |
| -apply plugin: 'com.google.protobuf' |
21 |
| -apply plugin: 'application' |
22 |
| -apply plugin: 'checkstyle' |
23 |
| -apply plugin: 'com.github.johnrengelman.shadow' |
24 |
| -apply plugin: "jacoco" |
25 |
| -apply plugin: 'maven-publish' |
26 |
| - |
27 |
| -jar.enabled = false |
28 |
| -shadowJar.enabled = true |
29 |
| - |
30 |
| -sourceCompatibility = 1.8 |
31 |
| -[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' |
32 |
| -mainClassName = 'org.tron.program.FullNode' |
33 |
| - |
34 |
| -publishing { |
35 |
| - publications { |
36 |
| - mavenJava(MavenPublication) { |
37 |
| - from components.java |
38 |
| - artifact sourceJar |
39 |
| - } |
40 |
| - } |
41 |
| - repositories { |
42 |
| - mavenLocal() |
43 |
| - } |
44 |
| -} |
45 |
| - |
46 |
| -task sourceJar(type: Jar, dependsOn: classes) { |
47 |
| - classifier 'sources' |
48 |
| - from sourceSets.main.allSource |
49 |
| -} |
50 |
| - |
51 |
| -repositories { |
52 |
| - mavenLocal() |
53 |
| - mavenCentral() |
54 |
| - maven { url 'http://repo.spring.io/plugins-release' } |
55 |
| - // maven { url 'https://maven.aliyun.com/nexus/content/repositories/central/' } |
56 |
| - maven { url 'https://jitpack.io' } |
57 |
| -} |
58 |
| -def versions = [ |
59 |
| - checkstyle: '8.7', |
60 |
| -] |
61 |
| - |
62 |
| -jacoco { |
63 |
| - toolVersion = "0.8.1" |
64 |
| -} |
65 |
| - |
66 |
| - |
67 |
| -configurations { |
68 |
| - checkstyleConfig |
69 |
| - |
70 |
| -} |
71 |
| - |
72 |
| -configurations.getByName('checkstyleConfig') { |
73 |
| - transitive = false |
74 |
| -} |
75 |
| - |
76 |
| -static def isWindows() { |
77 |
| - return org.gradle.internal.os.OperatingSystem.current().isWindows() |
78 |
| -} |
79 |
| - |
80 |
| -if (isWindows()) { |
81 |
| - ext { |
82 |
| - leveldbGroup = "org.ethereum" |
83 |
| - leveldbName = "leveldbjni-all" |
84 |
| - leveldbVersion = "1.18.3" |
85 |
| - } |
86 |
| -} else { |
87 |
| - ext { |
88 |
| - leveldbGroup = "org.fusesource.leveldbjni" |
89 |
| - leveldbName = "leveldbjni-all" |
90 |
| - leveldbVersion = "1.8" |
91 |
| - } |
92 |
| -} |
93 |
| - |
94 |
| -task version(type: Exec) { |
95 |
| - commandLine 'bash', '-c', './ver.sh' |
96 |
| -} |
97 |
| - |
98 |
| -dependencies { |
99 |
| - //local libraries |
100 |
| - compile fileTree(dir: 'libs', include: '*.jar') |
101 |
| - // end local libraries |
102 |
| - testCompile group: 'junit', name: 'junit', version: '4.12' |
103 |
| - testCompile group: 'org.mockito', name: 'mockito-core', version: '2.13.0' |
104 |
| - testCompile group: 'org.hamcrest', name: 'hamcrest-junit', version: '1.0.0.1' |
105 |
| - |
106 |
| - testCompile group: 'org.testng', name: 'testng', version: '6.14.3' |
107 |
| - |
108 |
| - compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' |
109 |
| - compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25' |
110 |
| - compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3' |
111 |
| - |
112 |
| -// compile "org.projectlombok:lombok:1.16.18" |
113 |
| - compile group: 'org.projectlombok', name: 'lombok', version: '1.18.2' |
114 |
| - |
115 |
| - compile group: 'commons-codec', name: 'commons-codec', version: '1.11' |
116 |
| - |
117 |
| - compile "com.madgag.spongycastle:core:1.58.0.0" |
118 |
| - compile "com.madgag.spongycastle:prov:1.58.0.0" |
119 |
| - |
120 |
| - compile group: 'com.google.guava', name: 'guava', version: '24.1-jre' |
121 |
| - |
122 |
| - compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.4.0' |
123 |
| - compile group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.4.0' |
124 |
| - |
125 |
| - compile "org.iq80.leveldb:leveldb:0.7" |
126 |
| - |
127 |
| - compile group: 'org.rocksdb', name: 'rocksdbjni', version: '5.15.10' |
128 |
| - |
129 |
| - compile group: leveldbGroup, name: leveldbName, version: leveldbVersion |
130 |
| - |
131 |
| - compile "org.apache.commons:commons-collections4:4.0" |
132 |
| - |
133 |
| - compile group: 'com.typesafe', name: 'config', version: '1.3.2' |
134 |
| - |
135 |
| - compile "com.google.code.findbugs:jsr305:3.0.0" |
136 |
| - |
137 |
| - compile "com.cedarsoftware:java-util:1.8.0" |
138 |
| - |
139 |
| - compile "org.apache.commons:commons-lang3:3.4" |
140 |
| - |
141 |
| - compile group: 'org.springframework', name: 'spring-context', version: '4.2.0.RELEASE' |
142 |
| - compile group: 'org.springframework', name: 'spring-tx', version: '4.2.0.RELEASE' |
143 |
| - |
144 |
| - compile group: 'com.beust', name: 'jcommander', version: '1.72' |
145 |
| - |
146 |
| - compile group: 'junit', name: 'junit', version: '4.12' |
147 |
| - |
148 |
| - compile group: 'net.jcip', name: 'jcip-annotations', version: '1.0' |
149 |
| - |
150 |
| - compile group: 'org.fusesource.jansi', name: 'jansi', version: '1.16' |
151 |
| - compile group: 'com.alibaba', name: 'fastjson', version: '1.2.44' |
152 |
| - |
153 |
| - compile group: 'com.google.inject', name: 'guice', version: '4.1.0' |
154 |
| - |
155 |
| - compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.5' |
156 |
| - compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.5' |
157 |
| - compile group: 'org.apache.commons', name: 'commons-math', version: '2.2' |
158 |
| - |
159 |
| - compile group: 'joda-time', name: 'joda-time', version: '2.3' |
160 |
| - |
161 |
| - compile group: 'io.dropwizard.metrics', name: 'metrics-core', version: '3.1.2' |
162 |
| - |
163 |
| -// checkstyleConfig "com.puppycrawl.tools:checkstyle:${versions.checkstyle}" |
164 |
| - // google grpc |
165 |
| - compile group: 'io.grpc', name: 'grpc-netty', version: '1.14.0' |
166 |
| - compile group: 'io.grpc', name: 'grpc-protobuf', version: '1.14.0' |
167 |
| - compile group: 'io.grpc', name: 'grpc-stub', version: '1.14.0' |
168 |
| - // end google grpc |
169 |
| - |
170 |
| - compile group: 'com.carrotsearch', name: 'java-sizeof', version: '0.0.5' |
171 |
| - |
172 |
| - compile 'org.aspectj:aspectjrt:1.8.13' |
173 |
| - compile 'org.aspectj:aspectjweaver:1.8.13' |
174 |
| - compile 'org.aspectj:aspectjtools:1.8.13' |
175 |
| - compile 'com.googlecode.cqengine:cqengine:2.12.4' |
176 |
| - compile group: 'com.google.api.grpc', name: 'googleapis-common-protos', version: '0.0.3' |
177 |
| - |
178 |
| - // http |
179 |
| - compile 'org.eclipse.jetty:jetty-server:9.4.11.v20180605' |
180 |
| - compile 'org.eclipse.jetty:jetty-servlet:9.4.11.v20180605' |
181 |
| - compile 'com.alibaba:fastjson:1.2.47' |
182 |
| - compile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.1' |
183 |
| - // end http |
184 |
| - |
185 |
| - compile "io.vavr:vavr:0.9.2" |
186 |
| - compile group: 'org.pf4j', name: 'pf4j', version: '2.5.0' |
187 |
| - |
188 |
| - compile group: 'org.zeromq', name: 'jeromq', version: '0.5.0' |
189 |
| - compile 'com.github.tronprotocol:zksnark-java-sdk:master-SNAPSHOT' |
190 |
| - compile 'com.github.tronprotocol:chainbase:dynamicStore-SNAPSHOT' |
191 |
| -} |
192 |
| - |
193 |
| -check.dependsOn 'lint' |
194 |
| - |
195 |
| -//checkstyle { |
196 |
| -// toolVersion = "${versions.checkstyle}" |
197 |
| -// config = resources.text.fromArchiveEntry(configurations.checkstyleConfig, 'google_checks.xml') |
198 |
| -// |
199 |
| -//} |
200 |
| -checkstyle { |
201 |
| - toolVersion = "${versions.checkstyle}" |
202 |
| - configFile = file("config/checkstyle/checkStyleAll.xml") |
203 |
| -} |
204 |
| - |
205 |
| - |
206 |
| -checkstyleMain { |
207 |
| - source = 'src/main/java' |
208 |
| -} |
209 |
| - |
210 |
| -task lint(type: Checkstyle) { |
211 |
| - // Cleaning the old log because of the creation of the new ones (not sure if totaly needed) |
212 |
| - delete fileTree(dir: "${project.rootDir}/app/build/reports") |
213 |
| - source 'src' |
214 |
| - include '**/*.java' |
215 |
| - exclude 'main/gen/**' |
216 |
| - exclude 'test/**' |
217 |
| - // empty classpath |
218 |
| - classpath = files() |
219 |
| - //Failing the build |
220 |
| - ignoreFailures = false |
221 |
| -} |
222 |
| - |
223 |
| -tasks.matching { it instanceof Test }.all { |
224 |
| - testLogging.events = ["failed", "passed", "skipped"] |
225 |
| -} |
226 |
| - |
227 |
| -if (project.hasProperty("mainClass")) { |
228 |
| - mainClassName = mainClass |
229 |
| -} |
230 |
| - |
231 |
| -sourceSets { |
232 |
| - main { |
233 |
| - proto { |
234 |
| - srcDir 'src/main/protos' |
235 |
| - } |
236 |
| - java { |
237 |
| - srcDir 'src/main/gen' |
238 |
| - srcDir 'src/main/java' |
239 |
| - } |
240 |
| - } |
241 |
| - |
242 |
| -} |
243 |
| - |
244 |
| -protobuf { |
245 |
| - generatedFilesBaseDir = "$projectDir/src/" |
246 |
| - protoc { |
247 |
| - artifact = "com.google.protobuf:protoc:3.5.1-1" |
248 |
| - } |
249 |
| - |
250 |
| - plugins { |
251 |
| - grpc { |
252 |
| - artifact = 'io.grpc:protoc-gen-grpc-java:1.9.0' |
253 |
| - } |
254 |
| - } |
255 |
| - generateProtoTasks { |
256 |
| - all().each { task -> |
257 |
| - task.builtins { |
258 |
| - java { outputSubDir = "gen" } |
259 |
| - } |
260 |
| - } |
261 |
| - all()*.plugins { |
262 |
| - grpc { |
263 |
| - outputSubDir = "gen" |
264 |
| - } |
265 |
| - } |
266 |
| - } |
267 |
| -} |
268 |
| - |
269 |
| -run { |
270 |
| - if (project.hasProperty('witness')) { |
271 |
| - standardInput = System.in |
272 |
| - args = ['--witness'] |
273 |
| - } |
274 |
| -} |
275 |
| - |
276 |
| -shadowJar { |
277 |
| - baseName = 'java-tron' |
278 |
| - classifier = null |
279 |
| - version = null |
280 |
| -} |
281 |
| - |
282 |
| -test { |
283 |
| - testLogging { |
284 |
| - exceptionFormat = 'full' |
285 |
| - } |
286 |
| - jacoco { |
287 |
| - append = true |
288 |
| - destinationFile = file("$buildDir/jacoco/jacocoTest.exec") |
289 |
| - classDumpDir = file("$buildDir/jacoco/classpathdumps") |
290 |
| - } |
291 |
| - if (isWindows()) { |
292 |
| - exclude '**/ShieldedTransferActuatorTest.class' |
293 |
| - exclude '**/BackupDbUtilTest.class' |
294 |
| - exclude '**/ManagerTest.class' |
295 |
| - exclude 'org/tron/core/zksnark/**' |
296 |
| - } |
297 |
| -} |
298 |
| - |
299 |
| -task stest(type: Test) { |
300 |
| - |
301 |
| - useTestNG { |
302 |
| - suites(file('src/test/resources/testng.xml')) |
303 |
| - parallel 'tests' |
304 |
| - threadCount 4 |
305 |
| - |
306 |
| - } |
307 |
| - |
308 |
| - testLogging { |
309 |
| - exceptionFormat = 'full' |
310 |
| - showStackTraces = "true" |
311 |
| - } |
312 |
| - |
313 |
| - jacoco { |
314 |
| - append = false |
315 |
| - destinationFile = file("$buildDir/jacoco/jacocoTest.exec") |
316 |
| - classDumpDir = file("$buildDir/jacoco/classpathdumps") |
317 |
| - } |
318 |
| -} |
319 |
| - |
320 |
| -task dailyBuild(type: Test) { |
321 |
| - useTestNG { |
322 |
| - suites(file('src/test/resources/daily-build.xml')) |
323 |
| - parallel 'tests' |
324 |
| - threadCount 1 |
325 |
| - } |
326 |
| -} |
327 |
| - |
328 |
| - |
329 |
| -jacocoTestReport { |
330 |
| - reports { |
331 |
| - xml.enabled true |
332 |
| - csv.enabled false |
333 |
| - html.destination file("${buildDir}/jacocoHtml") |
334 |
| - } |
335 |
| - executionData = files('build/jacoco/jacocoTest.exec') |
336 |
| -} |
337 |
| - |
338 |
| -def binaryRelease(taskName, jarName, mainClass) { |
339 |
| - return tasks.create("${taskName}", Jar) { |
340 |
| - baseName = jarName |
341 |
| - version = null |
342 |
| - from(sourceSets.main.output) { |
343 |
| - include "/**" |
344 |
| - } |
345 |
| - |
346 |
| - from { |
347 |
| - configurations.compile.collect { |
348 |
| - it.isDirectory() ? it : zipTree(it) |
349 |
| - } |
350 |
| - } |
351 |
| - |
352 |
| - manifest { |
353 |
| - attributes "Main-Class": "${mainClass}" |
354 |
| - } |
355 |
| - } |
356 |
| -} |
357 |
| - |
358 |
| -artifacts { |
359 |
| - archives(binaryRelease('buildSolidityNodeJar', 'SolidityNode', 'org.tron.program.SolidityNode'), |
360 |
| - binaryRelease('buildFullNodeJar', 'FullNode', 'org.tron.program.FullNode'), |
361 |
| - binaryRelease('buildKeystoreFactoryJar', 'KeystoreFactory', 'org.tron.program.KeystoreFactory'), |
362 |
| - binaryRelease('buildDBConvertJar', 'DBConvert', 'org.tron.program.DBConvert')) |
363 |
| -} |
| 1 | +plugins { |
| 2 | + id 'java' |
| 3 | +} |
| 4 | + |
| 5 | +group 'tronprotocol' |
| 6 | +version '1.0-SNAPSHOT' |
| 7 | + |
| 8 | +sourceCompatibility = 1.8 |
| 9 | + |
| 10 | +repositories { |
| 11 | + mavenCentral() |
| 12 | +} |
| 13 | + |
| 14 | +dependencies { |
| 15 | + testCompile group: 'junit', name: 'junit', version: '4.12' |
| 16 | +} |
0 commit comments