-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle.kts
79 lines (68 loc) · 2.7 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
@Suppress("DSL_SCOPE_VIOLATION") // TODO remove when https://youtrack.jetbrains.com/issue/KTIJ-19369 is fixed
plugins {
alias(libs.plugins.gradle.native)
alias(libs.plugins.gradle.jib)
application
}
dependencies {
implementation(projects.libs.proto)
implementation(projects.libs.grpc)
implementation("org.bouncycastle:bctsp-jdk16:1.46")
// Grpc `io.grpc:grpc-all` has grpc-auth, grpc-alts, grpc-protobuf, grpc-xds ...
runtimeOnly(libs.grpc.netty)
implementation(libs.grpc.protobuf)
implementation(libs.grpc.kotlin.stub)
implementation(libs.grpc.services) // Optional. includes grpc-protobuf
implementation(libs.grpc.xds) // Optional. includes grpc-services, grpc-auth, grpc-alts
implementation(libs.bundles.kotlinx.coroutines)
// Protobuf - If you want to use features like protobuf JsonFormat, `protobuf-java-util` instead of `protobuf-java`
implementation(libs.protobuf.java)
implementation(libs.protobuf.kotlin)
// Google
implementation(libs.guava)
// Kotlin Config
implementation(libs.bundles.konf)
// Resilience frameworks
implementation(libs.sentinel.grpc.adapter)
// implementation(libs.concurrency.limits.grpc)
// Test
// testImplementation("io.kotest.extensions:kotest-extensions-koin:{version}")
testImplementation(testFixtures(projects.libs.test))
testImplementation(testFixtures(projects.libs.model))
testImplementation(testFixtures(projects.libs.proto))
// grpc testing TODO: https://github.com/grpc/grpc-java/issues/5331
testImplementation(libs.grpc.test)
// testImplementation("io.grpc:grpc-testing:$grpcVersion")
}
affectedTestConfiguration { jvmTestTask = "check" }
application {
mainClass.set("micro.apps.service.KeyingApplicationKt")
// applicationDefaultJvmArgs = listOf("-noverify", "-XX:TieredStopAtLevel=1")
applicationDefaultJvmArgs = listOf("-Dorg.slf4j.simpleLogger.log.micro.apps=debug")
}
tasks {
register<JavaExec>("runKeyingClient") {
mainClass.set("micro.apps.service.KeyingClientKt")
classpath = sourceSets["main"].runtimeClasspath
workingDir = rootDir
jvmArgs = listOf("-Dorg.slf4j.simpleLogger.log.micro.apps=debug")
}
run.configure {
// HINT: config/certs are at project root
workingDir = rootDir
}
test {
workingDir = rootDir
}
}
jib {
containerizingMode = "packaged"
container {
// since we have many main classes, it cannot be Inferred. lets help
mainClass = application.mainClass.get()
}
// extraDirectories {
// setPaths("src/main/custom-extra-dir,/home/user/jib-extras")
// permissions = mapOf("/work" to "775", "/distr" to "775")
// }
}