forked from numenta/htm.java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
197 lines (166 loc) · 5.51 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
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'
}