-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathbuild.gradle
157 lines (135 loc) · 3.82 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
/**
* Gradle Build file for OpenDial (based on a previous file written by Ingmar Steiner).
*/
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'eclipse'
mainClassName = 'opendial.DialogueSystem'
version = '1.4'
/**
* External repositories for the transitive dependencies
*/
repositories {
flatDir {
dirs file("${projectDir}/lib")
}
maven {
url "https://jcenter.bintray.com"
}
// for Sphinx ASR
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
/**
* Source Java files for the main code and the test suite
*/
sourceSets {
main {
java {
srcDirs 'src'
exclude 'opendial/plugins/GoogleASR.java'
// exclude 'opendial/plugins/Nao*'
}
}
test {
java {
srcDirs 'test'
exclude 'domains/**'
}
}
}
/**
* Transitive dependencies
*/
dependencies {
compile group:'org.apache.httpcomponents', name:'httpclient', version:'4.3+'
compile group:'net.java.balloontip', name:'balloontip', version:'1.2+'
compile group:'org.json', name:'org.json', version:'2.0'
compile group:'org.jfree', name:'jfreechart', version:'1.0.19+'
compile group:'net.sf.jung', name:'jung-graph-impl', version:'2.0.1'
compile group:'net.sf.jung', name:'jung-visualization', version:'2.0.1'
compile group: 'de.dfki.mary', name: 'marytts-runtime', version: '5.2-beta2'
// compile group: 'de.dfki.mary', name: 'voice-cmu-slt-hsmm', version: '5.2-beta2'
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.2'
compile group: 'edu.cmu.sphinx', name: 'sphinx4-core', version:'5prealpha-SNAPSHOT'
// compile group: 'edu.cmu.sphinx', name: 'sphinx4-data', version:'5prealpha-SNAPSHOT'
compile group: 'org.maltparser', name: 'maltparser', version:'1.8.1'
compile group: 'edu.stanford.nlp', name: 'stanford-corenlp', version:'3.5.2'
// compile name: 'qimessaging'
compile group: 'net.objecthunter', name: 'exp4j', version: '0.4.7'
testCompile group:'junit', name: 'junit', version: '4.+'
}
/**
* Ensuring that all Java files are compiled with Java 8
*/
tasks.withType(JavaCompile) {
sourceCompatibility = '1.8'
options.encoding = 'UTF-8'
}
/**
* Properties for the JUnit tests
*/
test {
testLogging {
exceptionFormat = 'full'
}
systemProperty 'file.encoding', 'UTF-8'
systemProperty 'java.awt.headless', 'true'
}
/**
* Running the main class directly from Gradle
*/
run {
systemProperties System.getProperties()
systemProperty 'file.encoding', 'UTF-8'
standardInput = System.in
}
/**
* Compiles the distribution, adds the resulting jar files in ./lib and
* associated scripts (for Unix and Windows) in ./scripts
*/
task compile (type: Copy) {
dependsOn distTar
from tarTree(distTar.archivePath)
into "$buildDir/install"
doLast {
delete("scripts")
delete("lib")
file("$buildDir/install/${project.name}-${project.version}/bin").renameTo(file("scripts"))
file("$buildDir/install/${project.name}-${project.version}/lib").renameTo(file("lib"))
delete("$buildDir/install")
}
}
/**
* Making sure the JVM arguments are passed in the script
*/
startScripts {
doLast {
unixScript.text = unixScript.text.replaceFirst("\n", "\nJAVA_OPTS=\"\\\$@\"\n").replaceFirst("JVM_OPTS=\"\"","JVM_OPTS=\"-Dfile.encoding=utf-8\"")
windowsScript.text = windowsScript.text.replaceFirst("\n", "\nset JAVA_OPTS=%* \n").replaceFirst("JVM_OPTS=\"\"","JVM_OPTS=\"-Dfile.encoding=utf-8\"")
}
}
/**
* Allows easy integration with eclipse
*/
eclipse {
classpath {
defaultOutputDir = sourceSets.main.output.classesDir
}
}
/**
* Compiles the jar file for the OpenDial java files
*/
jar {
// need to copy the resources files
doFirst {
copy {
from 'resources'
into 'build/resources/main/resources'
}
}
manifest {
attributes('Main-Class': project.mainClassName)
}
}