forked from PCGen/pcgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
361 lines (310 loc) · 10.2 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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
/*
* PCGen build using the Gradle tool. This file specifies the core build tasks
* and refers to other files in the code/gradle directory for additional tasks
* for specific output.
*
* Developer build: gradle
* Incremental dev build: gradle build
* Full build: gradle all
* Build and run all tests: gradle clean build slowtest
* Run the data tests: gradle datatest
* Run the character integration tests: gradle inttest
*
* Author: James Dempsey
*/
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'application'
apply plugin: 'build-dashboard'
group = 'net.sourceforge.pcgen'
description = """PCGen"""
defaultTasks 'clean', 'build'
sourceCompatibility = 1.7
targetCompatibility = 1.7
ext {
binDir = "code/bin"
// Default ignoreTestFailures to false if it is not provided
if (!hasProperty('ignoreTestFailures')) {
ignoreTestFailures = false;
}
}
mainClassName = 'pcgen.system.Main'
applicationDistribution.from('plugins') {
into "plugins"
}
applicationDistribution.from('docs') {
into "docs"
}
applicationDistribution.from('data') {
into "data"
}
applicationDistribution.from('outputsheets') {
into "outputsheets"
}
applicationDistribution.from('system') {
into "system"
}
applicationDistribution.from('preview') {
into "preview"
}
applicationDistribution.from(artifacts) {
into ""
}
repositories {
ivy {
url "http://pcgen.sourceforge.net/mvnrepo"
layout "pattern", {
artifact "[organisation]/jars/[artifact]-[revision].[ext]"
}
}
mavenCentral()
}
sourceSets {
main {
java {
srcDirs 'code/src/java'
}
resources {
srcDirs 'code/src/java'
include '**/*.properties'
include '**/*.xml'
include '**/*.gif'
include '**/*.png'
include '**/*.jpg'
}
}
test {
java {
srcDirs = ['code/src/utest', 'code/src/testcommon']
}
}
itest {
java {
srcDirs = ['code/src/itest', 'code/src/testcommon']
}
}
slowtest {
java {
srcDirs = ['code/src/test', 'code/src/testcommon']
}
}
}
/* Copy 'master' outputsheets into different genre folders */
task copyMasterSheets(type: Copy) {
outputs.upToDateWhen { false }
include 'eqsheet_fantasy_std.htm'
include 'psheet_fantasy_std.htm'
from 'outputsheets/d20/fantasy/htmlxml'
into 'outputsheets/d20/historical/htmlxml'
into ('../../horror/htmlxml') {
from 'outputsheets/d20/fantasy/htmlxml'
}
into ('../../sciencefiction/htmlxml') {
from 'outputsheets/d20/fantasy/htmlxml'
}
into ('../../western/htmlxml') {
from 'outputsheets/d20/fantasy/htmlxml'
}
}
compileJava {
it.dependsOn 'copyMasterSheets'
}
dependencies {
compile group: 'cobra', name: 'cobra', version:'0.98.4-pcgen'
compile group: 'commons-lang', name: 'commons-lang', version:'2.6'
compile group: 'commons-io', name: 'commons-io', version:'2.4'
compile group: 'rhino', name: 'js', version:'1.7R2'
compile group: 'commons-logging', name: 'commons-logging', version:'1.1.1'
compile group: 'org.springframework', name: 'spring-core', version:'3.1.3.RELEASE'
compile group: 'org.springframework', name: 'spring-beans', version:'3.1.3.RELEASE'
compile group: 'mrj', name: 'MRJ141Stubs', version:'0'
compile group: 'net.sf.squirrel-sql.thirdparty-non-maven', name: 'skinlf', version:'6.7'
compile group: 'org.apache.xmlgraphics', name: 'fop', version:'1.0'
compile group: 'jep', name: 'jep', version:'2.4.1'
compile group: 'org.freemarker', name: 'freemarker', version:'2.3.20'
compile group: 'org.jdom', name: 'jdom', version:'1.1.3'
compile group: 'xalan', name: 'xalan', version:'2.7.1'
compile group: 'xerces', name: 'xercesImpl', version:'2.10.0'
compile group: 'xml-apis', name: 'xml-apis', version:'1.4.01'
compile group: 'org.apache.avalon.framework', name: 'avalon-framework-api', version:'4.3.1'
compile group: 'org.apache.avalon.framework', name: 'avalon-framework-impl', version:'4.3.1'
compile group: 'com.incors.plaf', name: 'kunststoff', version:'2.0.2'
//testCompile group: 'org.easymock', name: 'easymock', version:'2.5.2'
//testCompile group: 'org.easymock', name: 'easymockclassextension', version:'2.5.2'
testCompile group: 'junit', name: 'junit', version:'4.11'
testCompile group: 'xmlunit', name: 'xmlunit', version:'1.3'
//testCompile group: 'commons-jelly', name: 'commons-jelly-tags-interaction', version:'1.1'
//testCompile group: 'jline', name: 'jline', version:'2.9'
//testCompile group: 'com.google.collections', name: 'google-collections', version:'1.0'
//testCompile group: 'com.cenqua.clover', name: 'clover', version:'1.3.12'
//testCompile group: 'emma', name: 'emma', version:'2.1.5320'
//testCompile group: 'emma', name: 'emma_ant', version:'2.1.5320'
itestCompile sourceSets.main.output
itestCompile configurations.testCompile
itestCompile sourceSets.test.output
itestRuntime configurations.testRuntime
slowtestCompile sourceSets.main.output
slowtestCompile configurations.testCompile
slowtestCompile sourceSets.test.output
slowtestRuntime configurations.testRuntime
}
ant.importBuild 'build-gradle.xml'
ant.properties['src.java.dir']="code/src/java"
ant.properties['build.classes.dir']="build/classes/main"
configure('jar-all-plugins') {
group = BasePlugin.BUILD_GROUP // Or use 'build'
description = 'Create the plugin jars'
}
ext {
classpath = ""
configurations.runtime.each { lib -> classpath += " libs/${lib.name} "}
}
jar {
it.dependsOn 'jar-all-plugins'
manifest {
attributes 'Implementation-Title': 'PCGen', 'Implementation-Version': version,
'Main-Class': 'pcgen.system.Main', 'Class-Path': classpath
}
}
task converterJar(type: Jar, dependsOn: jar) {
manifest {
attributes 'Implementation-Title': 'PCGen Data Converter', 'Implementation-Version': version,
'Main-Class': 'pcgen.gui2.converter.PCGenDataConvert', 'Class-Path': 'pcgen.jar' + classpath
}
classifier = 'batch-convert'
from sourceSets.main.output
include 'none'
}
artifacts {
archives converterJar
}
task copyToLibs(type: Copy) {
into "$buildDir/libs"
from configurations.runtime
}
task copyToRoot(type: Copy, dependsOn: [copyToLibs, jar, converterJar]) {
outputs.files.setFrom(file("$buildDir/libs/pcgen-${version}.jar"))
from "$buildDir/libs/pcgen-${version}.jar"
from "$buildDir/libs/pcgen-${version}-batch-convert.jar"
from "$projectDir/code/pcgen.exe"
from "$projectDir/code/pcgen.sh"
into "$projectDir"
rename "(.+)-$version(.+)", '$1$2'
}
task syncLibsToRoot(type: Sync, dependsOn: [copyToLibs, jar, converterJar]) {
outputs.files.setFrom(file("$buildDir/libs/pcgen-${version}.jar"))
from "${buildDir}/libs"
into "$projectDir/libs"
exclude "pcgen-*.jar"
}
task cleanRoot(type: Delete) {
description="Clean up things copied to the root folder by the build"
delete "$projectDir/pcgen.jar"
delete "$projectDir/pcgen-batch-convert.jar"
delete "$projectDir/batch-convert.jar"
delete "$projectDir/pcgen.exe"
delete "$projectDir/pcgen.sh"
delete "$projectDir/libs"
delete "$projectDir/autobuild.properties"
delete "$projectDir/svn.properties"
}
build {
it.dependsOn 'copyToRoot', 'syncLibsToRoot'
}
clean {
it.dependsOn 'clean-plugins'
it.dependsOn 'cleanRoot'
}
test {
exclude 'pcgen/testsupport/**'
// maxParallelForks 4
testLogging {
exceptionFormat = 'full'
}
}
task itest(type: Test, dependsOn: jar) {
testClassesDir = sourceSets.itest.output.classesDir
classpath = sourceSets.itest.runtimeClasspath
systemProperties['jar.path'] = jar.archivePath
ignoreFailures=ignoreTestFailures
testLogging {
exceptionFormat = 'full'
}
}
task slowtest(type: Test, dependsOn: ['jar', 'itest']) {
testClassesDir = sourceSets.slowtest.output.classesDir
classpath = sourceSets.slowtest.runtimeClasspath
systemProperties['jar.path'] = jar.archivePath
forkEvery = 1
maxHeapSize = "512m"
// Exclude the two suites to avoid duplicate test runs.
exclude 'AllJUnitTests.class'
exclude 'pcgen/core/AllJUnitTests.class'
ignoreFailures=ignoreTestFailures
testLogging {
exceptionFormat = 'full'
}
}
task datatest(type: Test, dependsOn: 'jar') {
testClassesDir = sourceSets.slowtest.output.classesDir
classpath = sourceSets.slowtest.runtimeClasspath
include 'pcgen/persistence/lst/DataTest.class'
include 'pcgen/persistence/lst/DataLoadTest.class'
ignoreFailures=ignoreTestFailures
maxHeapSize = "512m"
testLogging {
exceptionFormat = 'full'
}
}
task inttest(type: Test, dependsOn: 'jar') {
testClassesDir = sourceSets.slowtest.output.classesDir
classpath = sourceSets.slowtest.runtimeClasspath
forkEvery = 1
maxHeapSize = "512m"
include 'pcgen/inttest/**/*Test.class'
testLogging {
exceptionFormat = 'full'
}
// Report each test as it is started.
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
}
task pfinttest(type: Test, dependsOn: 'jar') {
testClassesDir = sourceSets.slowtest.output.classesDir
classpath = sourceSets.slowtest.runtimeClasspath
forkEvery = 1
maxHeapSize = "512m"
include 'pcgen/inttest/game_pathfinder/*Test.class'
testLogging {
exceptionFormat = 'full'
}
// Report each test as it is started.
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
}
task rsrdinttest(type: Test, dependsOn: 'jar') {
testClassesDir = sourceSets.slowtest.output.classesDir
classpath = sourceSets.slowtest.runtimeClasspath
forkEvery = 1
maxHeapSize = "512m"
include 'pcgen/inttest/game_35e/*Test.class'
testLogging {
exceptionFormat = 'full'
}
// Report each test as it is started.
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
}
// Do the lot!
task all(dependsOn: ['clean', 'build', 'slowtest', 'javadoc', 'allReports']) {
}
task wrapper(type: Wrapper) {
gradleVersion = '2.2'
}
apply from: 'code/gradle/autobuild.gradle'
apply from: 'code/gradle/distribution.gradle'
apply from: 'code/gradle/reporting.gradle'
apply from: 'code/gradle/release.gradle'