-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathbuild.gradle.kts
85 lines (73 loc) · 2.43 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
import org.apache.tools.ant.taskdefs.condition.Os
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val kotlinVersion: String by System.getProperties()
val swaggerVersion: String by System.getProperties()
plugins {
id("org.springframework.boot") version "2.3.12.RELEASE" apply false
id("io.spring.dependency-management") version "1.0.9.RELEASE" apply false
id("com.google.cloud.tools.jib") version "2.4.0" apply false
kotlin("jvm") version "1.6.10" apply false
kotlin("plugin.spring") version "1.6.10" apply false
}
subprojects {
if (this.name == "common") {
apply {
plugin("org.jetbrains.kotlin.jvm")
plugin("org.jetbrains.kotlin.plugin.spring")
}
} else {
apply {
plugin("io.spring.dependency-management")
plugin("org.springframework.boot")
plugin("org.jetbrains.kotlin.jvm")
plugin("org.jetbrains.kotlin.plugin.spring")
plugin("com.google.cloud.tools.jib")
}
}
group = "org.example"
version = "1.0.0"
val implementation by configurations
dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("io.springfox:springfox-swagger2:$swaggerVersion")
implementation("io.springfox:springfox-swagger-ui:$swaggerVersion")
}
repositories {
mavenCentral()
jcenter()
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.create("helm") {
group = "deploy"
description = "Helm Chart installation"
doLast {
val names = mutableMapOf<String, String>()
fileTree("helm").visit {
if (this.isDirectory && this.name !in listOf("charts", "templates"))
names[this.name] = this.name
.replace("[.,;:_-]?".toRegex(), "")
.replace("chart", "")
}
names.forEach { (key, value) ->
exec {
if (Os.isFamily(Os.FAMILY_WINDOWS))
commandLine("cmd", "/c", "helm upgrade -i $value $key")
else
commandLine("sh", "-c", "helm upgrade -i $value $key")
}
}
}
}