forked from unclebob/fitnesse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
331 lines (287 loc) · 8.06 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
/* Plan:
- Create multi-module repo:
- fit (deps: common)
- slim (deps: common, networking)
- common
- networking
- ant
- fitnesse, the wiki server
- Move file creation to plugin
*/
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.1.9'
}
}
plugins {
id 'java'
id "maven-publish"
id "com.jfrog.bintray" version "1.6"
}
apply plugin: "info.solidsoft.pitest"
version = new Date().format('yyyyMMdd')
println "Building FitNesse v${project.version}..."
repositories {
mavenCentral()
}
configurations {
lesscss
optional
compile {
transitive = false
extendsFrom optional
}
runtime {
transitive = false
}
}
sourceSets {
main {
java.srcDir 'src'
resources.srcDir 'src'
output.resourcesDir output.classesDir
}
test {
java.srcDir 'test'
}
}
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
dependencies {
compile "org.htmlparser:htmlparser:2.1"
compile "org.htmlparser:htmllexer:2.1"
compile "org.apache.velocity:velocity:1.7"
compile "commons-lang:commons-lang:2.6"
compile "commons-collections:commons-collections:3.2.2"
compile "org.json:json:20151123"
compile "com.googlecode.java-diff-utils:diffutils:1.3.0"
optional "org.apache.ant:ant:1.9.6"
optional "junit:junit:4.12"
testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-core:1.10.19"
testCompile "org.hamcrest:hamcrest-all:1.3"
testCompile "net.javacrumbs.json-unit:json-unit:1.1.6"
lesscss "org.mozilla:rhino:1.7.7.1"
}
task fitNesseVersion {
def versionFile = new File("${sourceSets.main.output.resourcesDir}/META-INF/FitNesseVersion.txt")
versionFile.parentFile.mkdirs()
versionFile.text="v${version}"
}
task compileBootstrap(type: LessCompiler) {
inputDir file('src/fitnesse/resources/bootstrap/less')
mainLessFile = 'fitnesse-bootstrap.less'
cssFile file("${sourceSets.main.output.resourcesDir}/fitnesse/resources/bootstrap/css/fitnesse-bootstrap.css")
classpath configurations.lesscss
}
task createUpdateLists(type: WikiFileListBuilderTask) {
outputDirectory = "${sourceSets.main.output.resourcesDir}/Resources"
doNotReplaceFiles = [
"FitNesseRoot/FrontPage/content.txt",
"FitNesseRoot/FrontPage/properties.xml",
"FitNesseRoot/PageHeader/content.txt",
"FitNesseRoot/PageHeader/properties.xml",
"FitNesseRoot/PageFooter/content.txt",
"FitNesseRoot/PageFooter/properties.xml",
"FitNesseRoot/PageFooter/properties.xml",
"FitNesseRoot/TemplateLibrary/content.txt",
"FitNesseRoot/TemplateLibrary/properties.xml",
"FitNesseRoot/TemplateLibrary/StaticPage/content.txt",
"FitNesseRoot/TemplateLibrary/StaticPage/properties.xml",
"FitNesseRoot/TemplateLibrary/SuitePage/content.txt",
"FitNesseRoot/TemplateLibrary/SuitePage/properties.xml",
"FitNesseRoot/TemplateLibrary/TestPage/content.txt",
"FitNesseRoot/TemplateLibrary/TestPage/properties.xml" ]
mainDirectories = [
"FitNesseRoot/FitNesse",
"FitNesseRoot/FrontPage",
"FitNesseRoot/PageFooter",
"FitNesseRoot/PageHeader",
"FitNesseRoot/TemplateLibrary" ]
}
processResources.dependsOn "fitNesseVersion", "compileBootstrap", "createUpdateLists"
task copyRuntimeLibs(type: Copy) {
into "lib"
from configurations.runtime
}
test {
dependsOn copyRuntimeLibs
maxParallelForks 1
}
pitest {
targetClasses = ['fit.*', 'fitnesse.*']
pitestVersion = "1.1.10"
threads = 1 // We can not deal with parallel execution yet
outputFormats = ['XML', 'HTML']
}
task run(type: JavaExec) {
dependsOn classes, copyRuntimeLibs
classpath = sourceSets.main.runtimeClasspath
main "fitnesseMain.FitNesseMain"
args "-p", "8001", "-e", "0"
}
jar {
dependsOn createUpdateLists
into('Resources') {
from('.') {
include 'FitNesseRoot/FitNesse/**/content.txt'
include 'FitNesseRoot/FitNesse/**/properties.xml'
include 'FitNesseRoot/FrontPage/**/content.txt'
include 'FitNesseRoot/FrontPage/**/properties.xml'
include 'FitNesseRoot/PageFooter/**/content.txt'
include 'FitNesseRoot/PageFooter/**/properties.xml'
include 'FitNesseRoot/PageHeader/**/content.txt'
include 'FitNesseRoot/PageHeader/**/properties.xml'
include 'FitNesseRoot/TemplateLibrary/**/content.txt'
include 'FitNesseRoot/TemplateLibrary/**/properties.xml'
}
}
manifest {
attributes("Main-Class": "fitnesseMain.FitNesseMain",
"Implementation-Version": version)
}
}
task standaloneJar(type: Jar, dependsOn: jar) {
baseName = 'fitnesse'
classifier = 'standalone'
from {
(configurations.compile - configurations.optional).collect { zipTree(it) }
} {
exclude 'META-INF/**'
}
from jar.outputs.files.collect {
zipTree(it)
}
manifest {
attributes("Main-Class": "fitnesseMain.FitNesseMain",
"Implementation-Version": version)
}
}
task acceptanceTest(type: JavaExec) {
mustRunAfter test
onlyIf { dependsOnTaskDidWork() }
classpath = standaloneJar.outputs.files
main "fitnesseMain.FitNesseMain"
args "-o", "-c", "FitNesse.SuiteAcceptanceTests?suite&format=text"
}
check.dependsOn acceptanceTest
task javadocJar(type: Jar) {
mustRunAfter check
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
mustRunAfter check
classifier = 'sources'
from sourceSets.main.allSource
}
task releaseTag(type: Exec) {
commandLine 'git', 'tag', project.version
doLast {
println "Tagged release ${project.version}"
}
}
task publishTag(type: Exec) {
commandLine 'git', 'push', '--tags'
shouldRunAfter releaseTag
}
task prepareSnapshotRepo {
bintray.pkg.repo = 'edge'
}
task prepareReleaseRepo {
bintray.pkg.repo = 'release'
}
bintrayUpload.mustRunAfter prepareSnapshotRepo, prepareReleaseRepo
task snapshotRelease {
dependsOn prepareSnapshotRepo, bintrayUpload
}
task release {
dependsOn releaseTag, prepareReleaseRepo, bintrayUpload, publishTag
}
clean {
delete "lib"
}
publishing {
publications {
FitNesseRelease(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
artifact standaloneJar
groupId 'org.fitnesse'
artifactId 'fitnesse'
pom.withXml {
asNode().get('version') + {
resolveStrategy = Closure.DELEGATE_FIRST
name('FitNesse')
description('The fully integrated standalone wiki, and acceptance testing framework.')
url('http://fitnesse.org')
packaging('jar')
}
asNode().append(pomLicenses())
asNode().append(pomScm())
asNode().append(pomDevelopers())
// Clean up scope entries added by the pom generator:
asNode().dependencies.'*'.findAll() {
if (it.scope.text() == 'runtime') {
it.remove(it.scope)
}
}
}
}
}
}
bintray {
user = System.getenv("BINTRAY_USER") ?: 'Define your Bintray user name in BINTRAY_USER'
key = System.getenv("BINTRAY_API_KEY") ?: 'Define your Bintray BINTRAY_API_KEY'
publications = ['FitNesseRelease']
publish = true
pkg {
name = 'fitnesse'
userOrg = 'fitnesse'
licenses = ['CPL-1.0']
websiteUrl = 'http://fitnesse.org'
vcsUrl = 'https://github.com/unclebob/fitnesse.git'
publicDownloadNumbers = true
githubRepo = 'unclebob/fitnesse'
version {
name = project.version
desc = "FitNesse release ${project.version}"
vcsTag = project.version
gpg {
sign = true
}
}
}
}
wrapper {
gradleVersion = '3.1'
}
def pomLicenses() {
new NodeBuilder().licenses {
license {
name 'Common Public License version 1.0'
url 'http://www.opensource.org/licenses/cpl1.0'
distribution 'repo'
}
}
}
def pomScm() {
new NodeBuilder().scm {
connection 'scm:git:git://github.com/unclebob/fitnesse.git'
developerConnection 'scm:git:[email protected]:unclebob/fitnesse.git'
url 'scm:git:http://github.com/unclebob/fitnesse'
}
}
def pomDevelopers() {
new NodeBuilder().developers {
developer {
id 'unclebob'
name 'Robert C. Martin'
email '[email protected]'
}
}
}