-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
161 lines (139 loc) · 6.03 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
plugins {
id 'eclipse'
id 'idea'
id 'java'
id 'groovy'
id 'application'
}
description = "weidentiry application"
group = "org.example"
version = "1.0-SNAPSHOT"
mainClassName = 'org.example.App'
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
ext {
versions = [
tapestry: "5.7.3",
tapestryTestify: "1.0.4",
tapestryXpath: "1.0.1",
geb: "2.3.1",
groovy: "2.5.6",
htmlunitDriver: "2.33.3",
jackson: "2.9.6",
json: "1.1.2",
selenium: "3.141.59",
servletApi: "3.0.1",
spock: "1.3-RC1-groovy-2.5",
springBoot: "2.1.3.RELEASE",
yasson: "1.0.1"
]
}
repositories {
mavenCentral()
maven {
url 'https://repository.apache.org/content/repositories/staging/'
}
}
configurations {
provided
testUnitTapestryCompile.extendsFrom(testImplementation, provided)
testUnitTapestryRuntime.extendsFrom(testRuntimeOnly, provided)
testFunctionalTapestryCompile.extendsFrom(testImplementation, provided)
testFunctionalTapestryRuntime.extendsFrom(testRuntimeOnly, provided)
}
sourceSets {
main {
compileClasspath += configurations.provided
// To give the same path as IDEA has
// output.resourcesDir = 'build/production/weidentiry'
// output.classesDir = 'build/production/weidentiry'
}
test {
compileClasspath += configurations.provided
runtimeClasspath += configurations.provided
groovy {
exclude '**/tapestry/unit/**'
exclude '**/tapestry/functional/**'
}
}
testUnitTapestry {
groovy.srcDir file('src/test/groovy')
resources.srcDir file('src/test/resources')
compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath + configurations.provided
runtimeClasspath += output + compileClasspath + configurations.provided
groovy {
include '**/tapestry/unit/**'
}
}
testFunctionalTapestry {
groovy.srcDir file('src/test/groovy')
resources.srcDir file('src/test/resources')
compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath + configurations.provided
runtimeClasspath += output + compileClasspath + configurations.provided
groovy {
include '**/tapestry/functional/**'
}
}
}
dependencies {
implementation platform("org.springframework.boot:spring-boot-dependencies:${versions.springBoot}")
// Spring Boot
def excludeSpringBootStarterLogging = { exclude(group: 'org.springframework.boot', module: 'spring-boot-starter-logging') }
implementation("org.springframework.boot:spring-boot-starter", excludeSpringBootStarterLogging)
implementation("org.springframework.boot:spring-boot-starter-web", excludeSpringBootStarterLogging)
implementation("org.springframework.boot:spring-boot-starter-log4j2")
// Apache Tapestry
implementation("org.apache.tapestry:tapestry-core:${versions.tapestry}")
// CoffeeScript & Less support, plus resource minification
implementation("org.apache.tapestry:tapestry-webresources:${versions.tapestry}")
// Uncomment this to add support for spring, hibernate, bean validation and uploads
//implementation("org.apache.tapestry:tapestry-spring:$versions.tapestry")
//implementation("org.apache.tapestry:tapestry-hibernate:$versions.tapestry")
//implementation("org.apache.tapestry:tapestry-beanvalidator:$versions.tapestry")
//implementation("org.apache.tapestry:tapestry-upload:${tapestry}")
// Test
def excludeTestng = { exclude(group: 'org.testng'); }
testImplementation("org.springframework.boot:spring-boot-starter-test", excludeSpringBootStarterLogging)
testImplementation("org.spockframework:spock-core:${versions.spock}")
testImplementation("org.spockframework:spock-spring:${versions.spock}")
testImplementation("org.codehaus.groovy:groovy-all:${versions.groovy}", excludeTestng)
// Test Unit Tapestry
testUnitTapestryCompile("org.apache.tapestry:tapestry-test:${versions.tapestry}", excludeTestng)
testUnitTapestryCompile("net.sourceforge.tapestrytestify:tapestry-testify:${versions.tapestryTestify}", excludeTestng)
testUnitTapestryCompile("net.sourceforge.tapestryxpath:tapestry-xpath:${versions.tapestryXpath}", excludeTestng)
// Test Functional Tapestry
testFunctionalTapestryCompile("org.gebish:geb-spock:${versions.geb}")
testFunctionalTapestryCompile("org.seleniumhq.selenium:selenium-support:${versions.selenium}")
testFunctionalTapestryCompile("org.seleniumhq.selenium:htmlunit-driver:${versions.htmlunitDiver}")
// Miscellaneous
runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl")
runtimeOnly("org.eclipse:yasson:${versions.yasson}")
runtimeOnly("org.glassfish:javax.json:${versions.json}")
runtimeOnly("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}")
runtimeOnly("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}")
provided("javax.servlet:javax.servlet-api:${versions.servletApi}")
}
run {
systemProperty 'tapestry.execution-mode', System.getProperty('tapestry.execution-mode')
}
test {
}
task testUnitTapestry(type: Test) {
group = 'Verification'
description = 'Runs the tapestry unit tests.'
systemProperty 'tapestry.service-reloading-enabled', 'false'
systemProperty 'tapestry.execution-mode', 'development'
systemProperty 'geb.driver', 'htmlunit'
testClassesDirs = sourceSets.testUnitTapestry.output.classesDirs
classpath = project.sourceSets.testUnitTapestry.runtimeClasspath
include '**/*Spec*'
}
task testFunctionalTapestry(type: Test) {
group = 'Verification'
description = 'Runs the tapestry functional tests.'
systemProperty 'tapestry.service-reloading-enabled', 'false'
systemProperty 'tapestry.execution-mode', 'development'
systemProperty 'geb.driver', 'htmlunit'
testClassesDirs = sourceSets.testFunctionalTapestry.output.classesDirs
classpath = project.sourceSets.testFunctionalTapestry.runtimeClasspath
}