2015-01-05 17:52:34 +00:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
2015-01-06 10:50:03 +00:00
|
|
|
jcenter()
|
|
|
|
maven { url 'http://repo.spring.io/plugins-release-local' }
|
2015-01-05 17:52:34 +00:00
|
|
|
}
|
|
|
|
dependencies {
|
2015-01-06 10:21:59 +00:00
|
|
|
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
|
2015-01-06 10:50:03 +00:00
|
|
|
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1'
|
|
|
|
}
|
2015-01-05 17:52:34 +00:00
|
|
|
}
|
|
|
|
|
2014-12-26 13:23:44 +00:00
|
|
|
plugins {
|
|
|
|
id 'application'
|
|
|
|
id 'jacoco'
|
|
|
|
id 'com.github.johnrengelman.shadow' version '1.2.0'
|
|
|
|
id 'me.champeau.gradle.antlr4' version '0.1'
|
|
|
|
id 'com.github.kt3k.coveralls' version '2.0.1x'
|
2015-01-06 13:07:09 +00:00
|
|
|
id 'com.jfrog.bintray' version '1.0'
|
2014-12-26 13:23:44 +00:00
|
|
|
}
|
|
|
|
|
2015-01-05 17:52:34 +00:00
|
|
|
apply plugin: 'propdeps-maven'
|
2015-01-06 10:50:03 +00:00
|
|
|
apply plugin: 'com.jfrog.artifactory-upload'
|
2015-01-05 17:52:34 +00:00
|
|
|
|
2014-12-30 19:09:20 +00:00
|
|
|
sourceCompatibility = 1.7
|
|
|
|
|
2014-12-26 13:23:44 +00:00
|
|
|
mainClassName = 'org.ethereum.Start'
|
|
|
|
|
2014-12-26 16:14:39 +00:00
|
|
|
ext.generatedSrcDir = file('src/gen/java')
|
2014-12-26 13:23:44 +00:00
|
|
|
|
2014-12-26 16:14:39 +00:00
|
|
|
sourceSets.main.java.srcDirs += generatedSrcDir
|
2014-12-26 13:23:44 +00:00
|
|
|
|
2014-12-26 16:14:39 +00:00
|
|
|
antlr4 {
|
2015-01-20 10:53:27 +00:00
|
|
|
extraArgs = ['-package', 'org.ethereum.serpent']
|
|
|
|
output = file("${generatedSrcDir}/org/ethereum/serpent")
|
2014-12-26 13:23:44 +00:00
|
|
|
}
|
|
|
|
|
2014-12-26 16:14:39 +00:00
|
|
|
compileJava.dependsOn antlr4
|
|
|
|
|
2015-01-07 07:55:49 +00:00
|
|
|
test {
|
2015-03-16 21:53:18 +00:00
|
|
|
|
|
|
|
useTestNG()
|
|
|
|
|
2015-01-07 07:55:49 +00:00
|
|
|
jvmArgs '-Xss16m'
|
2015-03-16 21:53:18 +00:00
|
|
|
|
|
|
|
testLogging {
|
|
|
|
events "failed"
|
|
|
|
exceptionFormat "short"
|
|
|
|
}
|
|
|
|
|
|
|
|
systemProperty "file.encoding", "UTF-8"
|
2015-01-07 07:55:49 +00:00
|
|
|
}
|
|
|
|
|
2014-12-26 16:14:39 +00:00
|
|
|
configurations {
|
2015-01-20 10:53:27 +00:00
|
|
|
compile.extendsFrom antlr4
|
2014-12-26 13:23:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ext {
|
|
|
|
slf4jVersion = '1.7.7'
|
|
|
|
leveldbVersion = '0.7'
|
|
|
|
scastleVersion = '1.51.0.0'
|
|
|
|
log4jVersion = '1.2.17'
|
|
|
|
springVersion = '4.1.2.RELEASE'
|
|
|
|
hibernateVersion = '4.3.7.Final'
|
|
|
|
junitVersion = '4.11'
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile "io.netty:netty-all:4.0.23.Final"
|
|
|
|
compile "com.madgag.spongycastle:core:${scastleVersion}" // for SHA3 and SECP256K1
|
2015-03-12 19:07:33 +00:00
|
|
|
compile "com.madgag.spongycastle:prov:${scastleVersion}" // for SHA3 and SECP256K1
|
2014-12-26 13:23:44 +00:00
|
|
|
compile "org.iq80.leveldb:leveldb:${leveldbVersion}"
|
|
|
|
compile "com.cedarsoftware:java-util:1.8.0" // for deep equals
|
2015-01-30 13:05:56 +00:00
|
|
|
compile "org.antlr:antlr4-runtime:4.5" // for serpent compilation
|
2014-12-26 13:23:44 +00:00
|
|
|
compile "com.yuvalshavit:antlr-denter:1.1"
|
|
|
|
compile "org.javassist:javassist:3.15.0-GA"
|
|
|
|
compile "org.slf4j:slf4j-api:${slf4jVersion}"
|
|
|
|
compile "log4j:log4j:${log4jVersion}"
|
|
|
|
compile "org.codehaus.jackson:jackson-mapper-asl:1.9.13"
|
|
|
|
compile "com.google.code.findbugs:jsr305:3.0.0"
|
|
|
|
compile "com.fasterxml.jackson.core:jackson-databind:2.2.0"
|
|
|
|
compile "org.apache.commons:commons-collections4:4.0"
|
2015-03-06 17:09:30 +00:00
|
|
|
compile "commons-codec:commons-codec:1.10"
|
2014-12-26 13:23:44 +00:00
|
|
|
compile "org.springframework:spring-context:${springVersion}"
|
|
|
|
compile "org.springframework:spring-tx:${springVersion}"
|
|
|
|
compile "org.springframework:spring-orm:${springVersion}"
|
|
|
|
compile "org.hsqldb:hsqldb:1.8.0.10" // best performance - do not upgrade!
|
|
|
|
compile "org.hibernate:hibernate-core:${hibernateVersion}"
|
|
|
|
compile "org.hibernate:hibernate-entitymanager:${hibernateVersion}"
|
|
|
|
compile "commons-dbcp:commons-dbcp:1.4"
|
2015-01-18 21:32:30 +00:00
|
|
|
compile "redis.clients:jedis:2.6.0"
|
|
|
|
|
2014-12-26 16:20:05 +00:00
|
|
|
compile("com.googlecode.json-simple:json-simple:1.1.1") {
|
2015-01-20 10:53:27 +00:00
|
|
|
exclude group: 'junit', module: 'junit'
|
2014-12-26 16:20:05 +00:00
|
|
|
}
|
2015-01-05 17:52:34 +00:00
|
|
|
optional "commons-logging:commons-logging:1.0"
|
|
|
|
optional "org.slf4j:jcl-over-slf4j:${slf4jVersion}"
|
|
|
|
optional "org.slf4j:slf4j-log4j12:${slf4jVersion}"
|
|
|
|
optional "log4j:apache-log4j-extras:${log4jVersion}"
|
2014-12-26 13:23:44 +00:00
|
|
|
testCompile "junit:junit:${junitVersion}"
|
|
|
|
testCompile "org.springframework:spring-test:${springVersion}"
|
|
|
|
}
|
2014-12-27 13:02:59 +00:00
|
|
|
|
|
|
|
javadoc {
|
|
|
|
options.author = true
|
|
|
|
options.header = project.name
|
2014-12-27 13:36:51 +00:00
|
|
|
options.addStringOption('Xdoclint:all,-missing', '-quiet')
|
2014-12-29 09:34:50 +00:00
|
|
|
options.encoding = "UTF-8"
|
2014-12-27 13:02:59 +00:00
|
|
|
options.links(
|
2015-01-20 10:53:27 +00:00
|
|
|
"http://docs.oracle.com/javase/8/docs/api/",
|
|
|
|
"http://netty.io/4.0/api/"
|
2014-12-27 13:02:59 +00:00
|
|
|
)
|
|
|
|
}
|
2014-12-27 13:04:46 +00:00
|
|
|
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
classifier = 'sources'
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
}
|
|
|
|
|
|
|
|
task javadocJar(type: Jar) {
|
|
|
|
classifier = "javadoc"
|
|
|
|
from javadoc
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives sourcesJar
|
|
|
|
archives javadocJar
|
|
|
|
}
|
2014-12-29 14:35:42 +00:00
|
|
|
|
2014-12-30 19:52:25 +00:00
|
|
|
jacocoTestReport {
|
|
|
|
reports {
|
|
|
|
xml.enabled = true
|
|
|
|
html.enabled = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-29 14:35:42 +00:00
|
|
|
def bintrayUsername = project.hasProperty('bintrayUser') ? project.bintrayUser : ''
|
|
|
|
def bintrayPassword = project.hasProperty('bintrayKey') ? project.bintrayKey : ''
|
|
|
|
def pullRequest = System.getenv('TRAVIS_PULL_REQUEST')
|
2015-03-27 09:38:05 +00:00
|
|
|
def branchName = System.getenv('TRAVIS_BRANCH')
|
2014-12-29 14:35:42 +00:00
|
|
|
|
|
|
|
artifactory {
|
|
|
|
contextUrl = 'http://oss.jfrog.org/artifactory'
|
|
|
|
publish {
|
|
|
|
repository {
|
2015-01-20 10:53:27 +00:00
|
|
|
repoKey = 'oss-snapshot-local'
|
2014-12-29 14:35:42 +00:00
|
|
|
username = bintrayUsername
|
|
|
|
password = bintrayPassword
|
|
|
|
}
|
|
|
|
}
|
|
|
|
resolve {
|
|
|
|
repository {
|
|
|
|
repoKey = 'libs-release'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
artifactoryPublish.onlyIf {
|
2015-03-27 14:21:28 +00:00
|
|
|
(!pullRequest || pullRequest == 'false') &&
|
|
|
|
project.version.endsWith('-SNAPSHOT') &&
|
|
|
|
branchName.startsWith('master')
|
2014-12-29 14:35:42 +00:00
|
|
|
}
|
|
|
|
|
2015-01-06 13:07:09 +00:00
|
|
|
bintray {
|
|
|
|
user = bintrayUsername
|
|
|
|
key = bintrayPassword
|
|
|
|
|
|
|
|
configurations = ['archives']
|
|
|
|
|
|
|
|
dryRun = false //Whether to run this as dry-run, without deploying
|
|
|
|
publish = true //If version should be auto published after an upload
|
|
|
|
pkg {
|
|
|
|
userOrg = 'ethereum' //An optional organization name when the repo belongs to one of the user's orgs
|
|
|
|
repo = 'maven'
|
|
|
|
name = 'org.ethereum'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bintrayUpload.onlyIf {
|
|
|
|
(!pullRequest || pullRequest == 'false') && !project.version.endsWith('-SNAPSHOT')
|
|
|
|
}
|
|
|
|
|
2015-01-06 10:22:12 +00:00
|
|
|
install {
|
|
|
|
repositories.mavenInstaller {
|
|
|
|
customizePom(pom, project)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-06 10:50:03 +00:00
|
|
|
task publish {
|
2015-03-27 09:21:07 +00:00
|
|
|
|
2015-03-27 09:38:05 +00:00
|
|
|
println "publishing if master current branch: " + branchName
|
2015-01-06 13:07:09 +00:00
|
|
|
description = "Publishes snapshots to oss.jfrog.org and releases to Bintray/JCenter"
|
|
|
|
dependsOn artifactoryPublish, bintrayUpload
|
2014-12-29 14:35:42 +00:00
|
|
|
}
|
2015-01-06 10:22:12 +00:00
|
|
|
|
2015-01-06 13:07:09 +00:00
|
|
|
|
2015-01-06 10:22:12 +00:00
|
|
|
def customizePom(pom, gradleProject) {
|
|
|
|
pom.whenConfigured { generatedPom ->
|
|
|
|
// eliminate test-scoped dependencies (no need in maven central poms)
|
|
|
|
generatedPom.dependencies.removeAll { dep ->
|
|
|
|
dep.scope == "test"
|
|
|
|
}
|
|
|
|
|
|
|
|
// sort to make pom dependencies order consistent to ease comparison of older poms
|
|
|
|
generatedPom.dependencies = generatedPom.dependencies.sort { dep ->
|
|
|
|
"$dep.scope:$dep.groupId:$dep.artifactId"
|
|
|
|
}
|
|
|
|
|
|
|
|
// add all items necessary for maven central publication
|
|
|
|
generatedPom.project {
|
|
|
|
name = "ethereumj"
|
|
|
|
description = "Java implementation of the Ethereum protocol"
|
|
|
|
url = "https://github.com/ethereum/ethereumj"
|
|
|
|
organization {
|
|
|
|
name = "Ethereum"
|
|
|
|
url = "https://ethereum.org"
|
|
|
|
}
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name "The MIT License"
|
|
|
|
url "http://mit-license.org/"
|
|
|
|
distribution "repo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scm {
|
|
|
|
url = "https://github.com/ethereum/ethereumj"
|
|
|
|
connection = "scm:git:git://github.com/ethereum/ethereumj"
|
|
|
|
developerConnection = "scm:git:git://github.com/ethereum/ethereumj"
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id = "rmandeleil"
|
|
|
|
name = "Roman Mandeleil"
|
|
|
|
email = "roman.mandeleil@gmail.com"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
issueManagement {
|
|
|
|
system = "GitHub Issues"
|
|
|
|
url = "https://github.com/ethereum/ethereumj/issues"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|