-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
145 lines (117 loc) · 3.57 KB
/
build.gradle
File metadata and controls
145 lines (117 loc) · 3.57 KB
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
//
// Gradle build file for platedecoder project.
//
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'eclipse'
apply plugin: 'distribution'
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
version = '0.1-SNAPSHOT'
mainClassName = "org.biobank.platedecoder.ui.PlateDecoder"
jar {
manifest.attributes "Main-Class": "org.biobank.platedecoder.ui.PlateDecoder"
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://github.com/cbsrbiobank/biobank-maven-repo/raw/master/" }
}
configurations {
nativeBundles
nativeDlls
}
dependencies {
compile (
'org.slf4j:slf4j-api:1.7.1', 'org.slf4j:slf4j-log4j12:1.7.12',
'org.controlsfx:controlsfx:8.40.9',
'net.sf.supercsv:super-csv:2.3.1',
'org.apache.commons:commons-lang3:3.4',
'commons-codec:commons-codec:1.10',
'javax.json:javax.json-api:1.0',
'com.ning:async-http-client:1.9.31',
'com.fasterxml.jackson.jr:jackson-jr-all:2.6.2')
runtime 'org.glassfish:javax.json:1.0.4'
testCompile (
'junit:junit:4.12',
'de.saxsys:jfx-testrunner:1.1')
nativeBundles (
'scanlib:libdmscanlib64:3.0.0-ubuntu15.10',
'scanlib:dmscanlib:3.0.0-win32')
nativeDlls (
'scanlib:libglog:3.0.0-win32',
'scanlib:opencv_core248:3.0.0-win32',
'scanlib:opencv_highgui248:3.0.0-win32',
'scanlib:opencv_imgproc248:3.0.0-win32',
'scanlib:OpenThreadsWin32:3.0.0-win32')
}
test {
systemProperty "java.library.path", "lib"
systemProperty "debug", "true"
}
run {
systemProperty "java.library.path", "lib"
}
tasks.withType(JavaExec) {
jvmArgs '-Xmx1024m'
}
applicationDefaultJvmArgs = ["-Djava.library.path=./lib"]
task wrapper(type: Wrapper) {
gradleVersion = '2.5'
}
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
// help from http://stackoverflow.com/questions/29437888/using-gradle-with-native-dependencies
task copyNativeBundles(type: Sync) {
def location='./lib'
configurations.nativeBundles.resolvedConfiguration.resolvedArtifacts.each { artifact ->
project.copy {
from artifact.file
into file(location)
rename { "${artifact.name}.${artifact.extension}" }
}
}
}
// help from
// https://discuss.gradle.org/t/how-to-rename-an-artifact-while-its-beeing-added-to-an-archive/7317/4
task copyNativeDlls(type: Sync) {
def location='./'
configurations.nativeDlls.resolvedConfiguration.resolvedArtifacts.each { artifact ->
project.copy {
from artifact.file
into file(location)
rename { "${artifact.name}.${artifact.extension}" }
}
}
}
compileJava.dependsOn copyNativeBundles, copyNativeDlls
task listJars << {
configurations.compile.each { File file -> println file.name }
}
applicationDistribution.from("lib") {
into "lib"
}
applicationDistribution.from("./") {
include "*.dll"
into ""
}
eclipse.classpath {
/* With sources, it's much more convenient in debugging */
downloadSources = true
downloadJavadoc = true
/* Ugly hack to stick the JNI pointer into the .classpath file. */
file.withXml { provider ->
provider.asNode().findAll { [email protected]('org.eclipse.jdt.launching.JRE_CONTAINER') }.each {
it.appendNode('attributes')
.appendNode('attribute',
[ name: 'org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY',
value: 'platedecoder/lib' ])
}
}
}