forked from tronprotocol/java-tron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,558 changed files
with
131,585 additions
and
143,638 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,363 +1,16 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
jcenter() | ||
maven { url 'https://jitpack.io' } | ||
} | ||
dependencies { | ||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3' | ||
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2' | ||
} | ||
} | ||
plugins { | ||
id "org.sonarqube" version "2.6" | ||
} | ||
|
||
group 'org.tron' | ||
version '1.0.0' | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'com.google.protobuf' | ||
apply plugin: 'application' | ||
apply plugin: 'checkstyle' | ||
apply plugin: 'com.github.johnrengelman.shadow' | ||
apply plugin: "jacoco" | ||
apply plugin: 'maven-publish' | ||
|
||
jar.enabled = false | ||
shadowJar.enabled = true | ||
|
||
sourceCompatibility = 1.8 | ||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' | ||
mainClassName = 'org.tron.program.FullNode' | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
artifact sourceJar | ||
} | ||
} | ||
repositories { | ||
mavenLocal() | ||
} | ||
} | ||
|
||
task sourceJar(type: Jar, dependsOn: classes) { | ||
classifier 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
maven { url 'http://repo.spring.io/plugins-release' } | ||
// maven { url 'https://maven.aliyun.com/nexus/content/repositories/central/' } | ||
maven { url 'https://jitpack.io' } | ||
} | ||
def versions = [ | ||
checkstyle: '8.7', | ||
] | ||
|
||
jacoco { | ||
toolVersion = "0.8.1" | ||
} | ||
|
||
|
||
configurations { | ||
checkstyleConfig | ||
|
||
} | ||
|
||
configurations.getByName('checkstyleConfig') { | ||
transitive = false | ||
} | ||
|
||
static def isWindows() { | ||
return org.gradle.internal.os.OperatingSystem.current().isWindows() | ||
} | ||
|
||
if (isWindows()) { | ||
ext { | ||
leveldbGroup = "org.ethereum" | ||
leveldbName = "leveldbjni-all" | ||
leveldbVersion = "1.18.3" | ||
} | ||
} else { | ||
ext { | ||
leveldbGroup = "org.fusesource.leveldbjni" | ||
leveldbName = "leveldbjni-all" | ||
leveldbVersion = "1.8" | ||
} | ||
} | ||
|
||
task version(type: Exec) { | ||
commandLine 'bash', '-c', './ver.sh' | ||
} | ||
|
||
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' | ||
|
||
testCompile group: 'org.testng', name: 'testng', version: '6.14.3' | ||
|
||
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: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3' | ||
|
||
// compile "org.projectlombok:lombok:1.16.18" | ||
compile group: 'org.projectlombok', name: 'lombok', version: '1.18.2' | ||
|
||
compile group: 'commons-codec', name: 'commons-codec', version: '1.11' | ||
|
||
compile "com.madgag.spongycastle:core:1.58.0.0" | ||
compile "com.madgag.spongycastle:prov:1.58.0.0" | ||
|
||
compile group: 'com.google.guava', name: 'guava', version: '24.1-jre' | ||
|
||
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.4.0' | ||
compile group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.4.0' | ||
|
||
compile "org.iq80.leveldb:leveldb:0.7" | ||
|
||
compile group: 'org.rocksdb', name: 'rocksdbjni', version: '5.15.10' | ||
|
||
compile group: leveldbGroup, name: leveldbName, version: leveldbVersion | ||
|
||
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.springframework', name: 'spring-context', version: '4.2.0.RELEASE' | ||
compile group: 'org.springframework', name: 'spring-tx', version: '4.2.0.RELEASE' | ||
|
||
compile group: 'com.beust', name: 'jcommander', version: '1.72' | ||
|
||
compile group: 'junit', name: 'junit', version: '4.12' | ||
|
||
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.14.0' | ||
compile group: 'io.grpc', name: 'grpc-protobuf', version: '1.14.0' | ||
compile group: 'io.grpc', name: 'grpc-stub', version: '1.14.0' | ||
// end google grpc | ||
|
||
compile group: 'com.carrotsearch', name: 'java-sizeof', version: '0.0.5' | ||
|
||
compile 'org.aspectj:aspectjrt:1.8.13' | ||
compile 'org.aspectj:aspectjweaver:1.8.13' | ||
compile 'org.aspectj:aspectjtools:1.8.13' | ||
compile 'com.googlecode.cqengine:cqengine:2.12.4' | ||
compile group: 'com.google.api.grpc', name: 'googleapis-common-protos', version: '0.0.3' | ||
|
||
// http | ||
compile 'org.eclipse.jetty:jetty-server:9.4.11.v20180605' | ||
compile 'org.eclipse.jetty:jetty-servlet:9.4.11.v20180605' | ||
compile 'com.alibaba:fastjson:1.2.47' | ||
compile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.1' | ||
// end http | ||
|
||
compile "io.vavr:vavr:0.9.2" | ||
compile group: 'org.pf4j', name: 'pf4j', version: '2.5.0' | ||
|
||
compile group: 'org.zeromq', name: 'jeromq', version: '0.5.0' | ||
compile 'com.github.tronprotocol:zksnark-java-sdk:master-SNAPSHOT' | ||
compile 'com.github.tronprotocol:chainbase:dynamicStore-SNAPSHOT' | ||
} | ||
|
||
check.dependsOn 'lint' | ||
|
||
//checkstyle { | ||
// toolVersion = "${versions.checkstyle}" | ||
// config = resources.text.fromArchiveEntry(configurations.checkstyleConfig, 'google_checks.xml') | ||
// | ||
//} | ||
checkstyle { | ||
toolVersion = "${versions.checkstyle}" | ||
configFile = file("config/checkstyle/checkStyleAll.xml") | ||
} | ||
|
||
|
||
checkstyleMain { | ||
source = 'src/main/java' | ||
} | ||
|
||
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 'main/gen/**' | ||
exclude 'test/**' | ||
// 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 { | ||
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('witness')) { | ||
standardInput = System.in | ||
args = ['--witness'] | ||
} | ||
} | ||
|
||
shadowJar { | ||
baseName = 'java-tron' | ||
classifier = null | ||
version = null | ||
} | ||
|
||
test { | ||
testLogging { | ||
exceptionFormat = 'full' | ||
} | ||
jacoco { | ||
append = true | ||
destinationFile = file("$buildDir/jacoco/jacocoTest.exec") | ||
classDumpDir = file("$buildDir/jacoco/classpathdumps") | ||
} | ||
if (isWindows()) { | ||
exclude '**/ShieldedTransferActuatorTest.class' | ||
exclude '**/BackupDbUtilTest.class' | ||
exclude '**/ManagerTest.class' | ||
exclude 'org/tron/core/zksnark/**' | ||
} | ||
} | ||
|
||
task stest(type: Test) { | ||
|
||
useTestNG { | ||
suites(file('src/test/resources/testng.xml')) | ||
parallel 'tests' | ||
threadCount 4 | ||
|
||
} | ||
|
||
testLogging { | ||
exceptionFormat = 'full' | ||
showStackTraces = "true" | ||
} | ||
|
||
jacoco { | ||
append = false | ||
destinationFile = file("$buildDir/jacoco/jacocoTest.exec") | ||
classDumpDir = file("$buildDir/jacoco/classpathdumps") | ||
} | ||
} | ||
|
||
task dailyBuild(type: Test) { | ||
useTestNG { | ||
suites(file('src/test/resources/daily-build.xml')) | ||
parallel 'tests' | ||
threadCount 1 | ||
} | ||
} | ||
|
||
|
||
jacocoTestReport { | ||
reports { | ||
xml.enabled true | ||
csv.enabled false | ||
html.destination file("${buildDir}/jacocoHtml") | ||
} | ||
executionData = files('build/jacoco/jacocoTest.exec') | ||
} | ||
|
||
def binaryRelease(taskName, jarName, mainClass) { | ||
return tasks.create("${taskName}", Jar) { | ||
baseName = jarName | ||
version = null | ||
from(sourceSets.main.output) { | ||
include "/**" | ||
} | ||
|
||
from { | ||
configurations.compile.collect { | ||
it.isDirectory() ? it : zipTree(it) | ||
} | ||
} | ||
|
||
manifest { | ||
attributes "Main-Class": "${mainClass}" | ||
} | ||
} | ||
} | ||
|
||
artifacts { | ||
archives(binaryRelease('buildSolidityNodeJar', 'SolidityNode', 'org.tron.program.SolidityNode'), | ||
binaryRelease('buildFullNodeJar', 'FullNode', 'org.tron.program.FullNode'), | ||
binaryRelease('buildKeystoreFactoryJar', 'KeystoreFactory', 'org.tron.program.KeystoreFactory'), | ||
binaryRelease('buildDBConvertJar', 'DBConvert', 'org.tron.program.DBConvert')) | ||
} | ||
plugins { | ||
id 'java' | ||
} | ||
|
||
group 'tronprotocol' | ||
version '1.0-SNAPSHOT' | ||
|
||
sourceCompatibility = 1.8 | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
testCompile group: 'junit', name: 'junit', version: '4.12' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
plugins { | ||
id 'java' | ||
} | ||
|
||
group 'tronprotocol' | ||
version '1.0-SNAPSHOT' | ||
|
||
sourceCompatibility = 1.8 | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
testCompile group: 'junit', name: 'junit', version: '4.12' | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.