-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
120 lines (96 loc) · 3.55 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
val kotlin_version: String by project
val logback_version: String by project
val exposedVersion: String by project
plugins {
kotlin("jvm") version "1.8.20"
id("io.ktor.plugin") version "2.2.4"
kotlin("plugin.serialization").version("1.7.22")
id("org.jlleitschuh.gradle.ktlint") version "11.3.2"
}
group = "org.jetbrains.research"
version = "0.0.1"
application {
mainClass.set("org.jetbrains.research.ictl.riskypatterns.ApplicationKt")
val isDevelopment: Boolean = project.ext.has("development")
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
}
repositories {
mavenCentral()
}
dependencies {
implementation("io.ktor:ktor-server-metrics-micrometer")
implementation("io.micrometer:micrometer-registry-prometheus:1.10.5")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
implementation("io.ktor:ktor-client-content-negotiation")
implementation("io.ktor:ktor-serialization-gson")
implementation("io.ktor:ktor-server-core-jvm")
implementation("io.ktor:ktor-server-cors-jvm")
implementation("io.ktor:ktor-server-caching-headers-jvm")
implementation("io.ktor:ktor-server-netty-jvm")
implementation("io.ktor:ktor-server-content-negotiation")
implementation("io.ktor:ktor-server-status-pages")
implementation("io.ktor:ktor-serialization-kotlinx-json")
implementation("io.ktor:ktor-server-config-yaml")
implementation("io.ktor:ktor-server-call-id")
implementation("io.ktor:ktor-server-call-logging")
implementation("ch.qos.logback:logback-core:$logback_version")
implementation("ch.qos.logback:logback-classic:$logback_version")
implementation("net.logstash.logback:logstash-logback-encoder:7.3")
implementation("org.eclipse.jgit:org.eclipse.jgit:6.3.0.202209071007-r")
implementation("org.apache.commons:commons-csv:1.10.0")
implementation("io.ktor:ktor-client-core")
implementation("io.ktor:ktor-client-apache")
implementation("io.ktor:ktor-client-resources:2.2.4")
implementation("io.ktor:ktor-client-logging-jvm:2.2.4")
testImplementation("io.ktor:ktor-server-tests-jvm")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
}
val buildReactApp = tasks.register("buildReactApp") {
val react = project(":frontend")
dependsOn(react.tasks.named("build"))
}
val prepareAppResources = tasks.register("prepareAppResources") {
dependsOn(buildReactApp)
finalizedBy("processResources")
}
tasks.register("runApp") {
dependsOn(prepareAppResources)
finalizedBy("run")
}
tasks {
ktlint {
ignoreFailures.set(false)
disabledRules.set(setOf("no-wildcard-imports"))
}
jib {
from {
// we need git in container
image = "maven:3.9.0-eclipse-temurin-17"
platforms {
platform {
architecture = if (System.getProperty("os.arch").equals("aarch64")) "arm64" else "amd64"
os = "linux"
}
}
}
to {
image = "ghcr.io/jetbrains-research/bus-factor-explorer/${rootProject.name}:$version"
tags = setOf("latest", "$version")
}
}
test {
useJUnitPlatform()
// Show test results.
testLogging {
showStandardStreams = true
events("passed", "skipped", "failed")
}
}
}
tasks.named("jib") {
dependsOn(prepareAppResources)
}
tasks.named("jibDockerBuild") {
dependsOn(prepareAppResources)
}