ethereumj-personal/ethereumj-core/build.gradle

228 lines
6.6 KiB
Groovy

buildscript {
repositories {
jcenter()
maven { url 'http://repo.spring.io/plugins-release-local' }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1'
}
}
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'
id 'com.jfrog.bintray' version '1.0'
}
apply plugin: 'propdeps-maven'
apply plugin: 'com.jfrog.artifactory-upload'
sourceCompatibility = 1.7
mainClassName = 'org.ethereum.Start'
ext.generatedSrcDir = file('src/gen/java')
sourceSets.main.java.srcDirs += generatedSrcDir
antlr4 {
extraArgs = ['-package', 'org.ethereum.serpent']
output = file("${generatedSrcDir}/org/ethereum/serpent")
}
compileJava.dependsOn antlr4
test {
systemProperty "file.encoding", "UTF-8"
jvmArgs '-Xss16m'
}
configurations {
compile.extendsFrom antlr4
}
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
compile "org.iq80.leveldb:leveldb:${leveldbVersion}"
compile "com.cedarsoftware:java-util:1.8.0" // for deep equals
compile "org.antlr:antlr4-runtime:4.3" // for serpent compilation
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"
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"
compile "redis.clients:jedis:2.6.0"
compile("com.googlecode.json-simple:json-simple:1.1.1") {
exclude group:'junit', module:'junit'
}
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}"
testCompile "junit:junit:${junitVersion}"
testCompile "org.springframework:spring-test:${springVersion}"
}
javadoc {
options.author = true
options.header = project.name
options.addStringOption('Xdoclint:all,-missing', '-quiet')
options.encoding = "UTF-8"
options.links(
"http://docs.oracle.com/javase/8/docs/api/",
"http://netty.io/4.0/api/"
)
}
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
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
def bintrayUsername = project.hasProperty('bintrayUser') ? project.bintrayUser : ''
def bintrayPassword = project.hasProperty('bintrayKey') ? project.bintrayKey : ''
def pullRequest = System.getenv('TRAVIS_PULL_REQUEST')
artifactory {
contextUrl = 'http://oss.jfrog.org/artifactory'
publish {
repository {
repoKey = 'oss-snapshot-local'
username = bintrayUsername
password = bintrayPassword
}
}
resolve {
repository {
repoKey = 'libs-release'
}
}
}
artifactoryPublish.onlyIf {
(!pullRequest || pullRequest == 'false') && project.version.endsWith('-SNAPSHOT')
}
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')
}
install {
repositories.mavenInstaller {
customizePom(pom, project)
}
}
task publish {
description = "Publishes snapshots to oss.jfrog.org and releases to Bintray/JCenter"
dependsOn artifactoryPublish, bintrayUpload
}
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"
}
}
}
}