Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
198 lines (166 sloc) 5.51 KB
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'signing'
group = 'org.numenta'
version = '0.6.13'
archivesBaseName = 'htm.java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
jar {
manifest {
attributes 'Implementation-Title': 'htm.java', 'Implementation-Version': '0.6.13'
}
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'maven central' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
maven {
url 'http://metaware.us/maven3'
}
}
// COMMENT OUT TO SKIP TESTS WHEN CODE HASN'T CHANGED
test {
outputs.upToDateWhen { false }
}
// UNCOMMENT TO SEE STANDARD_OUT & STANDARD_ERR DURING BUILD
/*
test {
testLogging.showStandardStreams = true
}
*/
dependencies {
compile group: 'joda-time', name: 'joda-time', version: '2.5'
compile(group: 'com.chaschev', name: 'chutils', version:'1.4') {
exclude(module: 'mockito-all')
exclude(module: 'slf4j-api')
exclude(module: 'guava')
exclude(module: 'jsr305')
exclude(module: 'commons-io')
}
compile group: 'net.sf.trove4j', name: 'trove4j', version:'3.0.3'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version:'2.4.4'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version:'2.4.4'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.4.4'
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.10'
compile group: 'io.reactivex', name: 'rxjava', version: '1.0.10'
compile group: 'de.ruedigermoeller', name: 'fst', version: '2.45'
compile group: 'com.cedarsoftware', name: 'java-util', version: '1.19.3'
compile group: 'algorithmfoundry', name: 'algorithmfoundry-shade-culled', version:'1.3'
testCompile group: 'junit', name: 'junit', version:'4.11'
testCompile group: 'ch.qos.logback', name: 'logback-classic', version:'1.1.2'
}
/////////////////////////////////////////////////////////////////
// jmh Benchmarking Tool //
/////////////////////////////////////////////////////////////////
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
name 'Shadow'
url 'http://dl.bintray.com/content/johnrengelman/gradle-plugins'
}
}
dependencies {
classpath 'me.champeau.gradle:jmh-gradle-plugin:0.1.3'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
classpath 'org.openjdk.jmh:jmh-generator-annprocess:1.5.2'
}
}
apply plugin: 'me.champeau.gradle.jmh'
apply plugin: 'com.github.johnrengelman.shadow'
jmh {
resultFormat = 'CSV'
fork = 1
warmupIterations = 5 // Number of warm up iterations to do.
iterations = 5 // Number of measurement iterations to do.
}
task runBench(dependsOn: ['parent.compile', 'test']) << {
if(!project.hasProperty('skipbench')) {
tasks.compileJmhJava.execute()
tasks.processJmhResources.execute()
tasks.jmhJar.execute()
tasks.jmh.execute()
}
}
check.doLast {
tasks.runBench.execute()
}
/////////////////// END jmh /////////////////////
////////////////////
// Fat Jar //
////////////////////
task fatJar(type: Jar) {
manifest.from jar.manifest
classifier = 'all'
from {
configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
with jar
}
/////////////////////////////////////////////////////////////////
// SonaType Central Repo //
/////////////////////////////////////////////////////////////////
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
javadoc.failOnError = false
if(!project.hasProperty('ossrhUsername')) {
println "returning from has Property false"
return
}
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Numenta htm.java'
packaging 'jar'
artifactId 'htm.java'
description "The Java version of Numenta's HTM technology."
url 'https://github.com/numenta/htm.java'
scm {
connection 'scm:git:git://github.com/numenta/htm.java.git'
developerConnection 'scm:git:git://github.com/numenta/htm.java.git'
url 'https://github.com/numenta/htm.java'
}
licenses {
license {
name 'The GNU Affero Public License.'
url 'https://github.com/numenta/htm.java/blob/master/LICENSE.txt'
}
}
}
}
}
}
/////////////////// END Central Repo ////////////////
// create Gradle wrapper with command line `gradle wrapper` in terminal
task wrapper(type: Wrapper) {
gradleVersion = '2.2'
}