-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
100 lines (83 loc) · 2.62 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.9.21"
kotlin("plugin.serialization") version "1.9.21"
}
group = "fr.corpauration"
version = "1.3.1"
repositories {
mavenCentral()
maven { url = uri("https://dl.bintray.com/kotlinx/kotlinx") }
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
}
dependencies {
// implementation("org.jetbrains.kotlinx:kotlinx-coroutines:2.1.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("org.quartz-scheduler:quartz:2.3.2")
implementation(project(":cy-celcat"))
implementation("org.postgresql:postgresql:42.5.1")
implementation("org.slf4j:slf4j-jdk14:2.0.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
implementation("io.prometheus:simpleclient:0.16.0")
implementation("org.latencyutils:LatencyUtils:2.0.3")
implementation("io.ktor:ktor-server-core:2.3.6")
implementation("io.ktor:ktor-server-netty:2.3.6")
implementation("io.ktor:ktor-server-auth:2.3.6")
implementation("io.ktor:ktor-server-metrics-micrometer:2.3.6")
implementation("io.micrometer:micrometer-registry-prometheus:1.9.2")
implementation("io.ktor:ktor-server-auth-jvm:2.3.6")
implementation("io.ktor:ktor-server-core-jvm:2.3.6")
testImplementation(kotlin("test"))
implementation(kotlin("reflect"))
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = JavaVersion.VERSION_16.toString()
}
abstract class DockeriseTask : DefaultTask() {
@Input
var ver: String = ""
init {
dependsOn("jar")
}
@TaskAction
fun dockerise() {
val process = ProcessBuilder("docker", "image", "build", "-t", "cyrel-sync:${ver}", ".").start()
process.inputStream.reader(Charsets.UTF_8).use {
println(it.readText())
}
process.errorStream.reader(Charsets.UTF_8).use {
println(it.readText())
}
while (process.isAlive) {
}
}
}
abstract class DeleteJarTask : DefaultTask() {
@TaskAction
fun deleteJar() {
}
}
tasks.register<DockeriseTask>("dockerise") {
ver = version as String
}
tasks.register<DeleteJarTask>("deleteJar") {
delete(fileTree("build/libs") {
include("**/*.jar")
})
}
tasks.build {
dependsOn("deleteJar")
}
tasks.jar {
manifest {
attributes["Main-Class"] = "MainKt"
}
configurations["compileClasspath"].forEach { file: File ->
println(file.name)
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from(zipTree(file.absoluteFile))
}
}