-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
123 lines (95 loc) · 3.7 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
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin on the JVM.
id 'org.jetbrains.kotlin.jvm' version '1.3.50'
// Apply the application plugin to add support for building a CLI application.
id 'application'
id 'idea'
id 'org.springframework.boot' version '2.2.1.RELEASE'
id "org.asciidoctor.convert" version "1.5.3"
id "io.spring.dependency-management" version "1.0.8.RELEASE"
id "org.jetbrains.kotlin.plugin.spring" version "1.3.50"
id "org.jetbrains.kotlin.plugin.jpa" version "1.3.50"
id "org.jlleitschuh.gradle.ktlint" version "9.1.1"
}
def env = project.hasProperty('env') ? project.property('env') : 'local'
def fullTestOutput = project.hasProperty('fullTestOutput') ? project.property('fullTestOutput') : true
repositories {
jcenter()
mavenCentral()
maven { url "https://repo.spring.io/milestone" }
}
configurations {
ktlint
}
dependencies {
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-reflect'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-webflux'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-integration'
implementation group: 'org.springframework.boot', name: 'spring-boot-devtools'
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.4.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.4.2'
// Use the Kotlin JDK 8 standard library.
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
// Use the Kotlin test library.
testImplementation 'org.jetbrains.kotlin:kotlin-test'
// Use the Kotlin JUnit integration.
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
ktlint "com.pinterest:ktlint:0.33.0"
}
test.dependsOn ktlintCheck
task startServices(type: Exec) {
group = 'Docker Services'
description = 'Start docker containers used for development.'
commandLine 'docker-compose', 'up', '-d'
}
task stopServices(type: Exec) {
group = 'Docker Services'
description = 'Stop docker containers used for development.'
commandLine 'docker-compose', 'down'
}
test {
useJUnitPlatform()
testLogging {
if (fullTestOutput == true) {
showStandardStreams = true
}
events "passed", "failed", "skipped"
}
reports {
html.enabled = true
}
if (project.hasProperty('env')) {
systemProperties.put('spring.profiles.active', env)
}
// systemProperties System.properties
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = ["-Xjsr305=strict"]
}
}
test {
useJUnitPlatform()
testLogging {
if (fullTestOutput == true) {
showStandardStreams = true
}
events "passed", "failed", "skipped"
}
if (project.hasProperty('env')) {
systemProperties.put('spring.profiles.active', env)
}
}
// make sure services are running for test and bootRun in a local environment
if (env == 'local') {
test.dependsOn(startServices)
bootRun.dependsOn(startServices)
}
// Define the main class for the application
mainClassName = 'com.neshant.springbootkotlintemplate.SpringBootKotlinTemplateApplicationKt'