-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbuild.gradle
More file actions
141 lines (123 loc) · 4.18 KB
/
build.gradle
File metadata and controls
141 lines (123 loc) · 4.18 KB
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
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.1.RELEASE")
}
}
plugins {
id 'java'
id "com.moowork.node" version "1.2.0"
id "org.asciidoctor.convert" version "1.5.3"
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: "com.moowork.node"
node {
version = '10.14.1'
download = true
// Set the work directory for unpacking node
workDir = file("${project.buildDir}/nodejs")
// Set the work directory for NPM
npmWorkDir = file("${project.buildDir}/npm")
// Set the work directory where node_modules should be located
nodeModulesDir = file("${project.projectDir}/frontend")
}
bootJar {
baseName = 'gs-spring-boot'
version = '0.1.0'
dependsOn asciidoctor
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}
group 'org.haffson'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext {
snippetsDir = file('target/snippets')
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-hateoas'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'com.h2database:h2'
implementation 'org.postgresql:postgresql:42.2.1'
implementation 'org.liquibase:liquibase-core'
implementation 'com.google.code.findbugs:jsr305:1.3.9'
asciidoctor 'org.springframework.restdocs:spring-restdocs-asciidoctor'
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc")
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'junit:junit'
testImplementation 'org.mockito:mockito-inline:2.8.9'
testImplementation 'com.tngtech.archunit:archunit:0.9.3'
}
test {
outputs.dir snippetsDir
}
asciidoctor {
inputs.dir snippetsDir
dependsOn test
}
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
tasks.withType(Test) {
testLogging {
// set options for log level LIFECYCLE
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED
exceptionFormat TestExceptionFormat.FULL
showExceptions true
showCauses true
showStackTraces true
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
if(Boolean.valueOf(System.getenv("FE_BUILD"))) {
task npmRunScriptBuild(type: NpmTask, dependsOn: 'npmTest') {
args = ['run-script', 'build:jar']
execOverrides {
it.workingDir = 'frontend'
}
}
task npmTest(type: NpmTask, dependsOn: 'npmInstall') {
args = ['test']
}
npmSetup.dependsOn nodeSetup
npmInstall.dependsOn npmSetup
npmTest.dependsOn npmInstall
npmRunScriptBuild.dependsOn npmTest
/** processResources is part of the jar task and copies production resources into the production
* resources directory. This should only happen after then npmRunScriptBuild has generated those
* resources.
*/
processResources.dependsOn npmRunScriptBuild
}