-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
334 lines (281 loc) · 11.6 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
/*
* Orbit, a versatile image analysis software for biological image-based quantification.
* Copyright (C) 2009 - 2020 Idorsia Pharmaceuticals Ltd., Hegenheimermattweg 91, CH-4123 Allschwil, Switzerland.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.2"
classpath "org.pushing-pixels:radiance-ignite:3.5.1"
}
}
//plugins {
// id "com.github.cr0.macappbundle" version "3.0.1"
//}
// Import ignite for the buildscript (to build the Java classes for the icons from the SVGs).
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'idea'
id 'application'
}
apply plugin: 'org.pushing-pixels.ignite'
//
//if (file('custom.gradle').exists()) {
// apply from: 'custom.gradle'
//}
[ compileJava, compileTestJava ]*.options*.encoding = 'UTF-8'
ext.description = "OrbitImageAnalysis"
application {
mainClassName = 'com.actelion.research.orbit.imageAnalysis.components.OrbitImageAnalysis'
}
// Configure Java compilation for all the projects
tasks.withType(JavaCompile) {
def javaVersion = JavaVersion.VERSION_11
// enforce Java 11 as the source + target + compile time level
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
compileJava.doFirst {
if (JavaVersion.current() != javaVersion)
throw new IllegalStateException("Compiler version mismatch; required is "
+ javaVersion + ", but using " + JavaVersion.current());
}
// optionally flag all usage of deprecated APIs as errors
// options.deprecation = true
// options.compilerArgs += ['-Werror']
if (javaVersion.isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
clean {
delete 'out' // interpreted relative to the project directory
}
disableAutoTargetJvm()
}
tasks.withType(JavaExec) {
systemProperty 'javax.xml.parsers.DocumentBuilderFactory', 'com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl'
systemProperty 'sun.java2d.d3d', 'false'
}
ext.orbitVersion = new File(projectDir,"src/main/resources/version.txt").text
ext.orbitVersionStr = orbitVersion.replaceAll("\\.","")
project.version = ext.orbitVersion
// Define the Radiance version in one place, since multiple libraries that need to be updated together.
def radianceVersion = '3.5.1'
repositories {
mavenCentral()
maven {
url 'https://artifacts.openmicroscopy.org/artifactory/maven/'
content {
includeGroup "omero"
includeGroup "ome"
includeGroup "org.openmicroscopy"
includeModule "woolz", "JWlz"
includeModule "cisd", "jhdf5"
}
}
maven {
url 'https://artifacts.unidata.ucar.edu/content/repositories/unidata-releases/'
content {
// Dependencies from ome:formats-gpl
includeModule "edu.ucar", "cdm"
includeModule "edu.ucar", "httpservices"
includeModule "edu.ucar", "udunits"
}
}
maven {
url 'https://maven.scijava.org/content/repositories/releases/'
}
maven {
url 'https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/'
content {
// for jai-codec
includeVersion "com.sun.media", "jai-codec", "1.1.3"
includeVersion "javax.media", "jai-core", "1.1.3"
}
}
}
test {
useJUnit()
// Needed to load the native libraries:
// https://java-native-access.github.io/jna/4.2.1/com/sun/jna/NativeLibrary.html
systemProperty "jna.library.path", "lib/"
systemProperty 'java.awt.headless', 'true'
systemProperty 'javax.xml.parsers.DocumentBuilderFactory', 'com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl'
systemProperty 'sun.java2d.d3d', 'false'
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
task docJar(type: Jar, dependsOn: 'javadoc') {
from destinationDirectory
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId 'com.actelion.research'
artifactId 'orbit-image-analysis'
version "$orbitVersion"
from components.java
artifact sourceJar {
classifier "sources"
}
artifact docJar {
classifier "javadoc"
}
pom.withXml {
asNode().appendNode('description', 'Orbit, a versatile image analysis software for biological image-based quantification')
}
}
}
}
task copyToLib( type: Copy ) {
// println "Classpath = ${configurations.runtimeClasspath.asPath}"
doFirst{
sourceSets.main.compileClasspath.each { println it}
}
into "$buildDir/libs/lib"
from configurations.compileClasspath
}
task printRuntimeClasspath() {
}
jar {
archiveVersion = orbitVersion
archivesBaseName = 'orbit-image-analysis'
dependsOn copyToLib
// zip64=true
manifest {
attributes 'Implementation-Title': 'Orbit Image Analysis',
'Implementation-Version': orbitVersion,
'Main-Class': 'com.actelion.research.orbit.imageAnalysis.components.OrbitImageAnalysis',
'Vendor': 'Idorsia'
}
}
configurations {
implementation.exclude module:'slf4j-log4j12'
implementation.exclude group:'com.codahale.metrics', module:'metrics-jvm'
implementation.exclude group:'com.codahale.metrics', module:'metrics-core'
implementation.exclude group:'com.codahale.metrics', module:'metrics-graphite'
implementation.exclude group:'cglib', module:'cglib'
implementation.exclude group:'quartz', module:'quartz'
}
dependencies {
implementation 'com.actelion.research:lib-orbit-common:1.3.0'
// implementation ('com.actelion.research:image-provider-omero:1.7.3') {
// because('Version 1.7.3 supports Omero 5.6.x with Websockets')
// exclude(group: 'org.sl4j', module: 'slf4j-log4j12')
// exclude (group:'com.amazonaws', module: 'aws-java-sdk-core')
// exclude (group:'com.amazonaws', module: 'aws-java-sdk-s3')
// exclude (group:'com.amazonaws', module: 'aws-java-sdk-kms')
// }
api ('com.actelion.research:map-reduce-generic:1.0.10')
// implementation 'com.actelion.research:map-reduce-exec-spark:1.1.3'
// JNA (needed for the NDPR C++ API)
implementation 'net.java.dev.jna:jna:4.5.2'
// explicit versions, see implementation.excludes
implementation 'org.quartz-scheduler:quartz:2.3.2'
implementation 'org.sonatype.sisu.inject:cglib:2.2.3'
implementation 'io.dropwizard.metrics:metrics-core:3.2.6'
implementation 'io.dropwizard.metrics:metrics-jvm:3.2.6'
implementation 'io.dropwizard.metrics:metrics-graphite:3.2.6'
api 'com.thoughtworks.xstream:xstream:1.4.13'
implementation 'org.jaitools:jt-utils:1.6.0' // jai-tools
implementation 'com.sun.media:jai-codec:1.1.3'
implementation 'com.github.jai-imageio:jai-imageio-core:1.4.0'
// It looks like these two dependencies aren't needed?
implementation 'com.github.jai-imageio:jai-imageio-jpeg2000:1.3.0'
api 'javax.media:jai-core:1.1.3'
implementation (group:'org.swinglabs', name:'swingx', version:'1.6.1') {
exclude (module: 'swing-worker')
}
// Radiance UI and dependencies
implementation "org.pushing-pixels:radiance-substance:$radianceVersion"
api "org.pushing-pixels:radiance-flamingo:$radianceVersion"
implementation "org.pushing-pixels:radiance-neon:$radianceVersion"
implementation "org.pushing-pixels:radiance-photon:$radianceVersion"
implementation ('org.apache.commons:commons-lang3:3.11') {
because("SerializationUtils")
}
api 'com.google.guava:guava:29.0-jre'
api 'org.apache.commons:commons-math3:3.6.1'
api (group: 'com.googlecode.matrix-toolkits-java', name: 'mtj', version:'1.0.4') {
transitive = false
}
// weka start - only java implementations
api (group: 'nz.ac.waikato.cms.weka', name: 'weka-stable', version:'3.8.4') {
transitive = false
}
implementation 'nz.ac.waikato.cms.weka.thirdparty:bounce:0.18'
implementation 'com.github.fommil.netlib:core:1.1.2'
implementation 'com.github.fommil.netlib:generator:1.1.2'
implementation 'com.github.fommil.netlib:native_system-java:1.1'
// weka end
api ('gov.nih.imagej:imagej:1.46') {
because('Using version 1.47 causes the nerve detector tests to fail.')
}
implementation 'de.biomedical-imaging.ij:ij_blob:1.4.9'
implementation (group: 'org.codelibs', name:'jcifs', version:'1.3.18.3') { // for SmbUtils (exclude javax.servlet-api because Spark needs a different version)
exclude (group:'javax.servlet', module: 'servlet-api')
}
api (group: 'ome', name:'formats-gpl', version:'6.5.1') {
exclude (module: 'blitz')
}
api (group: 'net.imglib2', name: 'imglib2', version: '3.2.1') // to avoid jpeg2000 problem: NoSuchMethodError: jj2000.j2k.fileformat.reader.FileFormatReader.<init>
api 'org.codehaus.groovy:groovy-all:3.0.5'
api 'org.codehaus.gpars:gpars:1.2.1'
implementation 'com.fifesoft:rsyntaxtextarea:3.1.1'
implementation 'com.fifesoft:autocomplete:3.1.0'
implementation (group: 'ch.qos.logback', name:'logback-classic', version:'1.1.7') {
exclude(group: 'org.sl4j', module: 'slf4j-log4j12')
exclude(group: 'log4j', module: 'log4j')
}
implementation 'net.java.linoleum:jlfgr:1_0'
implementation (group: 'sc.fiji', name: 'legacy-imglib1', version: '1.1.9') { //1.1.5 2.0.0-SNAPSHOT for graph_cut
transitive = false
}
implementation 'org.xerial:sqlite-jdbc:3.32.3.2'
implementation 'org.tensorflow:tensorflow:1.14.0' // 1.4.0 1.10.0 implementationOnly
//implementation 'org.tensorflow:libtensorflow_jni_gpu:1.14.0'
//https://www.tensorflow.org/install/gpu
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.12'
testImplementation 'org.hamcrest:hamcrest:2.2'
implementation group: 'org.locationtech.jts', name: 'jts-core', version: '1.17.1'
testImplementation('junit:junit:4.13')
}
/*
* Compile the icons at build time, for better performance.
* Note that the example in https://github.com/kirill-grouchnikov/radiance/blob/master/docs/tools/ignite/ignite.md
* didn't work because the compileJava.doFirst meant that the
* parameters like inputDirectory were initialized at the wrong time.
*/
task generateIcons {
doLast {
ignite {
inputDirectory = file('src/main/resources/resource/svg')
outputDirectory = file('src/main/java/com/actelion/research/orbit/imageAnalysis/components/icons')
outputLanguage = 'java'
outputPackageName = 'com.actelion.research.orbit.imageAnalysis.components.icons'
useResizableTemplate = true
transcode()
}
}
}