-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
100 lines (82 loc) · 2.59 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
import java.time.LocalDate
import java.time.LocalTime
plugins {
id "idea"
id "java"
id "jacoco"
id "application"
id "net.ltgt.apt" version "0.15"
id "org.flywaydb.flyway" version "5.1.3"
id "com.diffplug.gradle.spotless" version "3.13.0"
id "org.springframework.boot" version "2.0.3.RELEASE"
id "io.spring.dependency-management" version "1.0.5.RELEASE"
}
version = "0.0.1"
group = "com.trevorgowing"
sourceCompatibility = 1.8
targetCompatibility = 1.8
archivesBaseName = "project-log-server"
mainClassName = "com.trevorgowing.projectlog.Application"
spotless {
java {
googleJavaFormat()
}
}
springBoot {
buildInfo()
}
flyway {
baselineVersion = "2017.03.19.18.14.33.897"
outOfOrder = true
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = false
}
}
test {
testLogging {
events "failed"
exceptionFormat "full"
}
}
task resolveDependencies {
description = "Download and cache dependencies"
doLast {
configurations.compileOnly.resolve()
configurations.runtime.resolve()
}
}
task createSqlMigration {
description = "Create a flyway sql migration in the default location, with a version of timestamp now and default description."
doLast {
String version = LocalDate.now().toString().replace('-', '.').concat('.')
.concat(LocalTime.now().toString().replace(':', '.'))
String fileName = 'V'.concat(version).concat('__').concat("description").concat(".sql")
String filePath = "src/main/resources/db/migration/".concat(fileName)
new File(filePath).createNewFile() ? println(filePath.concat(" migration created successfully"))
: println("Failed to create migration ".concat(filePath))
}
}
repositories {
jcenter()
}
dependencies {
compileOnly "org.projectlombok:lombok:1.18.0"
annotationProcessor "org.projectlombok:lombok:1.18.0"
compile 'com.trevorgowing:url-string-builder:1.1.0'
compile "org.flywaydb:flyway-core:5.1.3"
compile "mysql:mysql-connector-java:8.0.11"
compile "org.springframework.boot:spring-boot-devtools"
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-json"
compile "org.springframework.boot:spring-boot-starter-data-jpa"
compile "org.springframework.boot:spring-boot-starter-actuator"
testCompileOnly "org.projectlombok:lombok:1.18.0"
testAnnotationProcessor "org.projectlombok:lombok:1.18.0"
testCompile "io.rest-assured:rest-assured:3.1.0"
testCompile "io.rest-assured:spring-mock-mvc:3.1.0"
testCompile "org.springframework.boot:spring-boot-starter-test"
testRuntime "com.h2database:h2:1.4.197"
}