-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
132 lines (102 loc) · 4.19 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
121
122
123
124
125
126
127
128
129
130
131
132
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.tasks.bundling.BootJar
import io.swagger.v3.plugins.gradle.tasks.ResolveTask.Format.JSON
plugins {
id("java")
id("com.gradle.build-scan") version "2.0.2"
id("org.springframework.boot") version "2.1.1.RELEASE"
kotlin("jvm") version "1.3.11"
// https://kotlinlang.org/docs/reference/compiler-plugins.html#spring-support
id("org.jetbrains.kotlin.plugin.spring") version "1.3.11"
// https://kotlinlang.org/docs/reference/compiler-plugins.html#jpa-support
id("org.jetbrains.kotlin.plugin.jpa") version "1.3.11"
// https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-gradle-plugin
id("io.swagger.core.v3.swagger-gradle-plugin") version "2.0.6"
}
repositories {
mavenCentral()
}
group = "cloud.cosmin.checklister"
version = "0.0.7"
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
}
// fixed name for boot JAR (referenced in Dockerfile)
val bootJar: BootJar by tasks
bootJar.archiveName = "app.jar"
sourceSets {
create("integrationTest") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}
}
tasks.test {
useJUnitPlatform()
}
val integrationTestImplementation by configurations.getting {
extendsFrom(configurations.testImplementation.get())
}
configurations["integrationTestRuntimeOnly"].extendsFrom(configurations.runtimeOnly.get())
val integrationTest = task<Test>("integrationTest") {
description = "Runs integration tests."
group = "verification"
testClassesDirs = sourceSets["integrationTest"].output.classesDirs
classpath = sourceSets["integrationTest"].runtimeClasspath
shouldRunAfter("test")
}
tasks.resolve {
outputFileName = "PetStoreAPI"
outputFormat = JSON
prettyPrint = true
classpath = sourceSets["main"].runtimeClasspath
resourcePackages = setOf("io.test")
outputPath = "test"
}
dependencies {
// Kotlin
compile(kotlin("stdlib-jdk8"))
// Spring Boot
compile(enforcedPlatform("org.springframework.boot:spring-boot-dependencies:2.1.1.RELEASE"))
// web
compile("org.springframework.boot:spring-boot-starter-web")
// Swagger
compile("io.springfox:springfox-swagger2:2.9.2")
compile("io.springfox:springfox-swagger-ui:2.9.2")
// database
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("org.hibernate:hibernate-java8")
runtime("org.postgresql:postgresql:42.2.2")
compile("org.flywaydb:flyway-core:5.0.7")
compile("org.bitbucket.cowwoc:requirements-core:4.0.4-RC")
// Jackson
compile("com.fasterxml.jackson.core:jackson-databind:2.9.7")
compile("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.7")
compile("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.7")
// because of Java 9+
// https://stackoverflow.com/questions/43574426/how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception-in-j#43574427
// https://blog.sourced-bvba.be/article/2017/12/17/java9-spring/
compile("javax.xml.bind:jaxb-api:2.3.0")
compile("com.sun.xml.bind:jaxb-impl:2.3.0")
compile("org.glassfish.jaxb:jaxb-runtime:2.3.0")
compile("javax.activation:activation:1.1.1")
// dev tools
compile("org.springframework.boot:spring-boot-devtools")
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("org.springframework.boot:spring-boot-test-autoconfigure")
// JUnit 5
testCompile("org.junit.jupiter:junit-jupiter-api:5.3.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.3.2")
// Support running JUnit 4 tests using JUnit 5
testCompileOnly("junit:junit:4.12")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.3.2")
// H2 in-memory database
testCompile("com.h2database:h2:1.4.197")
// integrationTestCompile("org.seleniumhq.selenium:selenium-java:3.13.0")
// integrationTestCompile("org.seleniumhq.selenium:selenium-remote-driver:3.13.0")
implementation(project("modules:buildconfig"))
}