-
Notifications
You must be signed in to change notification settings - Fork 173
/
build.gradle
117 lines (92 loc) · 2.97 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
jar.enabled = false
ext {
arquillianWildflyVersion = '3.0.1.Final'
wildflyVersion = '26.0.1.Final'
}
repositories {
// Required by arquillian
maven { url "https://maven.repository.redhat.com/ga/" }
}
configurations {
jbossmodule
jbossdist { transitive = false }
}
dependencies {
jbossmodule(project(':asciidoctorj-api')) {
transitive = false
}
jbossmodule(project(':asciidoctorj')) {
transitive = false
}
jbossmodule "org.jruby:jruby-complete:$jrubyVersion"
jbossdist group: 'org.wildfly', name: 'wildfly-dist', version: wildflyVersion, ext: 'zip'
testImplementation "javax:javaee-api:7.0"
testCompileOnly project(':asciidoctorj')
testImplementation "junit:junit:$junitVersion"
testImplementation "org.hamcrest:hamcrest-library:$hamcrestVersion"
testImplementation "org.jboss.arquillian.junit:arquillian-junit-container:$arquillianVersion"
testImplementation "org.jsoup:jsoup:$jsoupVersion"
testRuntimeOnly "org.wildfly.arquillian:wildfly-arquillian-container-managed:$arquillianWildflyVersion"
}
task unpackWildfly(type: Copy) {
from {
zipTree(configurations.jbossdist.singleFile)
}
into "$buildDir"
}
compileTestJava {
dependsOn unpackWildfly
}
javadocJar {
dependsOn unpackWildfly
}
sourcesJar {
dependsOn unpackWildfly
}
tasks.create("createModule").doLast {
copy {
from "src/test/resources/module.xml"
into "build/modules/org/asciidoctor/asciidoctorj/main"
filter {
it
.replaceAll('@@version@@', project(':asciidoctorj').version)
.replaceAll('@@jrubyVersion@@', jrubyVersion)
}
}
copy {
from configurations.jbossmodule
into "build/modules/org/asciidoctor/asciidoctorj/main"
}
}
test {
useJUnit()
testLogging {
// events 'passed', 'failed', 'skipped', 'standard_out', 'standard_error'
// events 'standard_out', 'standard_error'
afterSuite { desc, result ->
if (!desc.parent && logger.infoEnabled) {
logger.info "Test results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
}
}
}
reports {
html {
destination file("$buildDir/reports/integrationTest")
}
junitXml {
destination file("$buildDir/integrationTest")
}
}
def jbossHome = file("build/wildfly-$wildflyVersion").absolutePath
systemProperty('jboss.home', jbossHome)
systemProperty('module.path', jbossHome + "/modules" + File.pathSeparator + file('build/modules').absolutePath)
if (JavaVersion.current().isJava11Compatible()) {
systemProperty('arquillian.launch', 'wildfly-java11')
}
dependsOn createModule
dependsOn unpackWildfly
dependsOn configurations.jbossmodule
}
configurations.all {
artifacts.clear()
}