-
Notifications
You must be signed in to change notification settings - Fork 153
/
build.gradle.kts
120 lines (103 loc) · 3.41 KB
/
build.gradle.kts
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
/*
* Copyright 2019 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id("com.gradle.build-scan") version "2.4.2"
java
jacoco
id("org.springframework.boot") version "2.1.8.RELEASE"
id("com.github.kt3k.coveralls") version "2.8.4"
id("com.palantir.docker-run") version "0.22.1"
kotlin("jvm") version "1.3.50"
kotlin("plugin.spring") version "1.3.50"
}
apply(from = "gradle/git-version-data.gradle")
apply(from = "gradle/build-scan-data.gradle")
group = "com.github.britter"
version = "0.2.9"
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation(platform("org.springframework.boot:spring-boot-dependencies:2.1.8.RELEASE"))
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
implementation("org.hsqldb:hsqldb:2.3.3")
implementation("javax.xml.bind:jaxb-api:2.2.11")
implementation("javax.validation:validation-api:1.1.0.Final")
implementation("org.postgresql:postgresql:9.4-1203-jdbc42")
testImplementation(platform("org.springframework.boot:spring-boot-dependencies:2.1.8.RELEASE"))
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.5.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.5.2")
testImplementation("org.assertj:assertj-core:3.13.2")
testImplementation("io.mockk:mockk:1.9")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks {
processResources {
filesMatching("**/*.properties") {
expand(project.properties)
}
}
compileJava {
options.encoding = "UTF-8"
}
compileKotlin {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
test {
useJUnitPlatform()
}
val jacocoTestReport = named<JacocoReport>("jacocoTestReport") {
reports {
xml.isEnabled = true
}
}
coveralls {
jacocoReportPath = jacocoTestReport.map { it.reports.xml.destination }
}
bootJar {
archiveFileName.set("app.jar")
}
bootRun {
if (project.hasProperty("postgres")) {
setArgsString("--spring.profiles.active=postgres")
}
}
}
dockerRun {
image = "postgres:9.4.4"
name = "postgres-db"
ports("5432:5432")
env(mapOf(
"POSTGRES_PASSWORD" to "spring-boot-heroku-example",
"POSTGRES_USER" to "spring-boot-heroku-example"
))
}
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
publishAlways()
}