-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle.kts
112 lines (97 loc) · 3.92 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
import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.dsl.SpringBootExtension
import org.springframework.boot.gradle.tasks.run.BootRun
val logbackKafkaAppenderVersion by project
val logstashLogbackEncoderVersion by project
val kafkaVersion by project
val springCloudVersion by project
val springCloudStreamVersion by project
plugins {
val kotlinVersion = "1.1.61"
val springDependencyManagement = "1.0.4.RELEASE"
val springBootVersion = "2.0.0.M7" //TODO: "2.0.0.RELEASE"
val junitGradleVersion = "1.0.2"
val dockerPluginVersion = "0.17.2"
base
id("org.jetbrains.kotlin.jvm") version kotlinVersion
id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion apply false
id("org.jetbrains.kotlin.plugin.noarg") version kotlinVersion // apply false
id("org.springframework.boot") version springBootVersion apply false
id("org.junit.platform.gradle.plugin") version junitGradleVersion apply false
id("io.spring.dependency-management") version springDependencyManagement apply false
id("com.palantir.docker") version dockerPluginVersion apply false
}
subprojects {
// if (name.startsWith("shared")) {
// apply { plugin("org.gradle.sample.hello") }
// } else {
// apply { plugin("org.gradle.sample.goodbye") }
// }
apply {
plugin("org.jetbrains.kotlin.jvm")
plugin("org.jetbrains.kotlin.plugin.spring")
plugin("org.jetbrains.kotlin.plugin.noarg")
plugin("org.junit.platform.gradle.plugin")
plugin("io.spring.dependency-management")
plugin("org.springframework.boot")
}
repositories {
mavenCentral()
maven("https://repo.spring.io/milestone")
}
// configure<DependencyManagementExtension> {
// imports {
// mavenBom("org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion")
// mavenBom("org.springframework.cloud:spring-cloud-stream-dependencies:$springCloudStreamVersion")
// }
// }
dependencies {
// kotlin
compile("org.jetbrains.kotlin:kotlin-stdlib-jre8")
compile("org.jetbrains.kotlin:kotlin-reflect")
// Web
compile("org.springframework.boot:spring-boot-starter-webflux")
compile("com.fasterxml.jackson.module:jackson-module-kotlin")
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
// Testing
testCompile("org.springframework.boot:spring-boot-starter-test") {
exclude(module = "junit")
}
testCompile("org.junit.jupiter:junit-jupiter-api")
testCompile("io.projectreactor:reactor-test")
testRuntime("org.junit.jupiter:junit-jupiter-engine")
// Logging
runtime("com.github.danielwegener:logback-kafka-appender:$logbackKafkaAppenderVersion")
runtime("net.logstash.logback:logstash-logback-encoder:$logstashLogbackEncoderVersion")
// Tooling
compileOnly("org.springframework:spring-context-indexer")
compile("org.springframework.boot:spring-boot-devtools")
compile("org.springframework.boot:spring-boot-starter-actuator")
compile("io.micrometer:micrometer-registry-prometheus")
}
configurations.all {
resolutionStrategy {
force("org.apache.kafka:kafka-clients:$kafkaVersion")
}
}
tasks {
withType<KotlinCompile>().all {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjsr305=strict")
}
}
withType<BootRun> {
// Ensures IntelliJ can live reload resource files
val sourceSets = the<JavaPluginConvention>().sourceSets
sourceResources(sourceSets["main"])
}
}
configure<SpringBootExtension> {
buildInfo()
}
noArg {
annotation("com.example.NoArg")
}
}