forked from poseidon-fisheries/POSEIDON
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
269 lines (200 loc) · 7.66 KB
/
Copy pathbuild.gradle
File metadata and controls
269 lines (200 loc) · 7.66 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
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
plugins {
id 'java'
id 'idea'
id 'application'
//id "us.kirchmeier.capsule" version "1.0.1"
//id "jacoco"
id 'com.github.johnrengelman.shadow' version '2.0.0'
id 'com.gradle.build-scan' version '1.16'
}
mainClassName = 'uk.ac.ox.oxfish.Main'
repositories {
mavenLocal()
mavenCentral()
}
sourceSets
{
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
}
//here we add all the dependencies notice that mason and geomason are not on maven so we need to add them separately
dependencies
{
//mason libraries. They aren't on maven so we have to lug their jars around
compile fileTree(dir: 'libs/mason', include: '*.jar')
compile fileTree(dir: 'libs/geomason', include: '*.jar')
//a jury-rigged version of OSMOSE, hopefully linkable with this simulation
compile fileTree(dir: 'libs/osmose', include: '*.jar')
//metawidget + apache binders. Useful for the gui
compile "org.metawidget.modules:metawidget-all:4.1"
compile "commons-beanutils:commons-beanutils:1.8.3"
//csv helper
compile "com.opencsv:opencsv:3.8"
//logger:
compile "com.esotericsoftware:minlog:1.3.0"
//serializer
compile fileTree(dir: 'libs/xstream/lib', include: '*.jar')
compile "org.ogce:xpp3:1.1.6"
//kd tree
compile fileTree(dir: 'libs/rednaxela', include: '*.jar')
//jung social network:
compile "net.sf.jung:jung-api:2.0.1"
compile 'net.sf.jung:jung-graph-impl:2.0.1'
compile 'net.sf.jung:jung-io:2.0.1'
compile 'net.sf.jung:jung-algorithms:2.0.1'
//yaml parser, useful for reading configuration files
compile 'org.yaml:snakeyaml:1.15'
//jcommander, useful to parse command line
compile "com.beust:jcommander:1.48"
//commons math
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.2'
//burlap : Reinforcement Learning helper
compile group: 'edu.brown.cs.burlap', name: 'burlap', version: '3.0.1'
//discrete choosers
compile fileTree(dir: 'libs/discrete-choosers', include: '*.jar')
// maximizer
compile group: 'de.openea', name : 'eva2', version : '2.2.0'
//annotations
compile group: 'com.intellij', name: 'annotations', version: '12.0'
//testing:
testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-all:1.9.5"
//guava. Useful for PreConditions and sometimes specialized collections
compile "com.google.guava:guava:23.0"
compile "com.google.code.findbugs:jsr305:3.0.2"
}
//this makes tests multi-threaded when called from gradle. Useful!
test{
maxParallelForks = Math.min(Runtime.runtime.availableProcessors(),3)
}
task shadowJarFoo(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
archiveName = 'foo.jar'
from sourceSets.main.output //tells the task to include the project code
configurations = [ configurations.runtime ] //tells the task to shadow in the jars files in the 'runtime' scope
}
//this task creates a single executable jar ("fat" because it contains all its requirements); this is mostly what gets
//distributed
task fatJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
mergeServiceFiles()
archiveName = 'oxfish_executable.jar'
from sourceSets.main.output //tells the task to include the project code
configurations = [ project.configurations.compile ] //tells the task to shadow in the jars files in the 'runtime' scope
manifest {
attributes 'Main-Class': 'uk.ac.ox.oxfish.Main'
}
}
task optimizerJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
mergeServiceFiles()
archiveName = 'maximizer.jar'
from sourceSets.main.output //tells the task to include the project code
configurations = [ project.configurations.compile ] //tells the task to shadow in the jars files in the 'runtime' scope
manifest {
attributes 'Main-Class': 'uk.ac.ox.oxfish.MainOptimizer'
}
}
task calicatchFatJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
mergeServiceFiles()
archiveName = 'calicatch.jar'
from sourceSets.main.output //tells the task to include the project code
configurations = [ project.configurations.compile ] //tells the task to shadow in the jars files in the 'runtime' scope
manifest {
attributes 'Main-Class': 'uk.ac.ox.oxfish.experiments.CaliCatchCalibration'
}
}
task inferenceFatJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
mergeServiceFiles()
archiveName = 'indirectInference.jar'
from sourceSets.main.output //tells the task to include the project code
configurations = [ project.configurations.compile ] //tells the task to shadow in the jars files in the 'runtime' scope
manifest {
attributes 'Main-Class': 'uk.ac.ox.oxfish.experiments.IndirectInferencePaper'
}
}
//this task creates a single executable jar ("fat" because it contains all its requirements); this is mostly what gets
//distributed
task buildHeadless(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
mergeServiceFiles()
archiveName = 'yamler.jar'
from sourceSets.main.output //tells the task to include the project code
configurations = [ project.configurations.compile ] //tells the task to shadow in the jars files in the 'runtime' scope
manifest {
attributes 'Main-Class': 'uk.ac.ox.oxfish.YamlMain'
}
}
//this task takes the yamler.jar from the build/libs folder and place it in the runs optimization folder. This is important
//to make optimization.py work correctly
task deployHeadless(type: Copy, dependsOn: buildHeadless) {
from 'build/libs/'
into 'runs/optimization/'
include 'yamler.jar'
}
task fatJarBatch(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
mergeServiceFiles()
archiveName = 'oxfish_batch.jar'
from sourceSets.main.output //tells the task to include the project code
configurations = [ project.configurations.compile ] //tells the task to shadow in the jars files in the 'runtime' scope
manifest {
attributes 'Main-Class': 'uk.ac.ox.oxfish.gui.BatchRunnerSetup'
}
}
//this task can be called as ./gradlew buildSampleFiles and simply rebuilds the "YAML Samples" folder
task buildSampleFiles(type: JavaExec){
classpath = sourceSets.main.runtimeClasspath
main = 'uk.ac.ox.oxfish.experiments.BuildSampleInputs'
}
task optimizer(type: JavaExec){
classpath = sourceSets.main.runtimeClasspath
main = 'uk.ac.ox.oxfish.MainOptimizer'
}
task sample_inputs(type:JavaExec){
main = 'uk.ac.ox.oxfish.experiments.BuildSampleInputs'
classpath = sourceSets.main.runtimeClasspath
}
task appendix(type:JavaExec){
main = 'uk.ac.ox.oxfish.experiments.FirstPaper'
classpath = sourceSets.main.runtimeClasspath
}
task execute(type:JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = project.hasProperty("mainClass") ? project.getProperty("mainClass") : "package.MyDefaultMain"
}
task algorithms(type:JavaExec){
main = 'uk.ac.ox.oxfish.experiments.SocialTuningExercise'
classpath = sourceSets.main.runtimeClasspath
}
task batch(type:JavaExec){
main = 'uk.ac.ox.oxfish.gui.BatchRunnerSetup'
classpath = sourceSets.main.runtimeClasspath
}
test {
useJUnit()
testLogging {
events "passed", "skipped", "failed"
}
}
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
idea{
project {
}
module {
downloadJavadoc = true // defaults to false
downloadSources = true
}
}