-
Notifications
You must be signed in to change notification settings - Fork 88
/
build.gradle
160 lines (137 loc) · 3.8 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
//
// Stanford Phrasal build specification for
// Gradle.
//
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'
apply plugin: 'idea'
// Gradle java plugin
sourceCompatibility = 1.8
targetCompatibility = 1.8
// Release version
version = '3.6.0'
// Gradle application plugin
mainClassName = "edu.stanford.nlp.mt.Phrasal"
applicationDefaultJvmArgs = ["-ea", "-server", "-XX:+UseParallelGC", "-XX:+UseParallelOldGC"]
// Jar creation
jar {
manifest {
attributes 'Implementation-Title': 'Stanford Phrasal',
'Implementation-Version': version,
'Main-Class': 'edu.stanford.nlp.mt.Phrasal'
}
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}
compileJava {
//enable compilation in a separate daemon process
options.fork = true
// File encoding
options.encoding = 'UTF-8'
//enable incremental compilation
options.incremental = true
}
test {
// Set to true to see stderr
testLogging.showStandardStreams = false
}
// Configure build targets
sourceSets {
main {
java.srcDirs = ['src/']
resources.srcDirs = ['resources/']
}
test {
java.srcDirs = ['test/']
resources.srcDirs = ['test-resources/','src-cc']
}
extra {
java.srcDirs = ['src-extra/']
resources.srcDirs = ['resources/']
}
}
//
// KenLM tasks: compile and add to JVM library path
//
task compileKenLM(type: Exec) {
commandLine 'src-cc/compile_JNI.sh'
}
//
// KenLM tools
//
task compileKenLMtools(type: Exec) {
workingDir 'src-cc/kenlm'
commandLine './bjam'
}
tasks.withType(Test) {
systemProperty "java.library.path", "src-cc"
}
//
// Dependencies and other build tasks
//
repositories {
mavenCentral()
}
task listDeps << {
configurations.compile.each { File file -> println file.name }
}
task copyDeps(type: Copy) {
from configurations.runtime
into 'lib'
}
dependencies {
// TERp jars that are no longer available on the web.
compile fileTree(dir: 'lib', include: '*.jar')
// lilt/core Maven dependencies
compile group: 'edu.stanford.nlp', name: 'stanford-corenlp', version: '3.6.0'
compile group: 'com.esotericsoftware', name: 'kryo', version: '3.0.1'
compile group: 'it.unimi.dsi', name: 'fastutil', version: '7.0.12'
compile group: 'com.google.guava', name: 'guava', version: '19.0'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.7'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.7'
compile group: 'com.lmax', name: 'disruptor', version: '3.3.6'
// Test dependencies
testCompile group: 'junit', name: 'junit', version: '4.12'
// Extra dependencies
extraCompile sourceSets.main.output
extraCompile sourceSets.test.output
extraCompile configurations.testCompile
extraRuntime configurations.testRuntime
extraCompile group: 'com.google.code.gson', name: 'gson', version: '2.6.2'
extraCompile group: 'org.eclipse.jetty', name: 'jetty-continuation', version: '9.2.1.v20140609'
extraCompile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.2.1.v20140609'
extraCompile group: 'org.eclipse.jetty', name: 'jetty-annotations', version: '9.2.1.v20140609'
extraCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.2.1.v20140609'
}
// Eclipse plugin setup
eclipse {
classpath {
defaultOutputDir = file('bin/')
file {
beforeMerged { classpath ->
classpath.entries.removeAll { entry -> entry.kind == 'lib' }
}
}
}
}
//
// Buildscript setup
//
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'org.owasp:dependency-check-gradle:1.4.2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0'
}
}
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'org.owasp.dependencycheck'