-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
214 lines (182 loc) · 5.55 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
buildscript {
ext {
springBootVersion = '2.0.4.RELEASE'
cucumberVersion = '0.9'
asciidoctorVersion = '1.5.8'
nodePluginVersion = '1.2.0'
}
repositories {
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("com.github.samueltbrown:gradle-cucumber-plugin:${cucumberVersion}")
classpath("org.asciidoctor:asciidoctor-gradle-plugin:${asciidoctorVersion}")
classpath("com.moowork.gradle:gradle-node-plugin:${nodePluginVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'jdepend'
apply plugin: 'findbugs'
apply plugin: 'project-report'
apply plugin: 'org.springframework.boot'
apply plugin: 'com.github.samueltbrown.cucumber'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'org.asciidoctor.convert'
apply plugin: 'com.moowork.node'
apply plugin: 'com.moowork.gulp'
version = '1.0.0'
if(!"$BRANCH_NAME".isEmpty() && "$BRANCH_NAME" != "master") {
version = version + "-$BUILD_NUMBER" + "-SNAPSHOT"
PROJECT_NAME = PROJECT_NAME + " $BRANCH_NAME"
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
}
wrapper {
gradleVersion = '4.8'
distributionType = Wrapper.DistributionType.ALL
}
asciidoctor {
}
findbugs {
toolVersion = '3.0.1'
ignoreFailures = true
effort = 'max'
}
sourceSets {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
}
resources {
srcDirs file('src/integration-test/resources')
}
}
acceptanceTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDirs file('src/acceptance-test/java')
}
resources {
srcDirs file('src/acceptance-test/resources')
}
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
acceptanceTestCompile.extendsFrom testCompile
acceptanceTestRuntime.extendsFrom testRuntime
}
task integrationTest(type: Test) {
description = "Runs Integration Tests"
setTestClassesDirs(sourceSets.integrationTest.output.getClassesDirs())
classpath += sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
}
task acceptanceTest(type: Test) {
description = "Runs Acceptance Tests"
setTestClassesDirs(sourceSets.acceptanceTest.output.getClassesDirs())
classpath += sourceSets.acceptanceTest.runtimeClasspath
outputs.upToDateWhen { false }
}
task downloadDependencies() {
description 'Download all dependencies to the Gradle cache'
doLast {
configurations.findAll { it.canBeResolved }.files
}
}
tasks.withType(Test) {
reports.html.setDestination(file("${reporting.baseDir}/${name}"))
}
test {
ignoreFailures = true
exclude 'com/yourproject/UnitTestsRunner.class'
jacoco {
destinationFile = file("$buildDir/jacoco/test.exec")
}
}
integrationTest {
ignoreFailures = true
exclude 'com/yourproject/IntegrationTestsRunner.class'
jacoco {
destinationFile = file("$buildDir/jacoco/test.exec")
}
}
acceptanceTest {
ignoreFailures = true
exclude 'com/yourproject/AcceptanceTestsRunner.class'
environment "DATABASE_URL", "postgres://develop:develop@localhost:5432/develop"
jacoco {
destinationFile = file("$buildDir/jacoco/test.exec")
}
}
node {
version = '10.11.0'
npmVersion = '6.4.1'
download = true
workDir = file("${project.buildDir}/yourproject-frontend")
npmWorkDir = file("${project.buildDir}/yourproject-frontend")
nodeModulesDir = file("${project.projectDir}/yourproject-frontend")
}
gulp {
workDir = file("${project.projectDir}/yourproject-frontend")
colors = true
bufferOutput = true
}
task rebuildSASS(type: NpmTask) {
args = ['rebuild', 'node-sass']
}
rebuildSASS.dependsOn npmInstall
task buildUI(type: GulpTask) {
args = ['--production']
}
buildUI.dependsOn rebuildSASS
check.dependsOn integrationTest
integrationTest.mustRunAfter test
check.dependsOn acceptanceTest
acceptanceTest.mustRunAfter integrationTest
dependencies {
annotationProcessor (
['org.projectlombok:lombok']
)
compileOnly (
['org.projectlombok:lombok']
)
compile (
['org.springframework.boot:spring-boot-starter-data-jpa'],
['org.springframework.boot:spring-boot-starter-web'],
['org.springframework.boot:spring-boot-starter-jetty'],
['org.springframework.boot:spring-boot-starter-security'],
['org.springframework.boot:spring-boot-starter-thymeleaf'],
['org.apache.commons:commons-dbcp2']
)
testCompile (
['org.springframework.boot:spring-boot-starter-test'],
['org.springframework.security:spring-security-test'],
['net.sourceforge.htmlunit:htmlunit'],
["io.cucumber:cucumber-junit:${cucumberLibraryVersion}"],
["io.cucumber:cucumber-java8:${cucumberLibraryVersion}"],
["io.cucumber:cucumber-spring:${cucumberLibraryVersion}"]
)
runtime (
['org.springframework.boot:spring-boot-devtools'],
['com.h2database:h2'],
['org.postgresql:postgresql'],
['org.springframework.boot:spring-boot-properties-migrator']
)
}