-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle.kts
121 lines (98 loc) · 2.71 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
121
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
kotlin("jvm") version "1.6.20"
id("net.bitsandbobs.kradle") version "2.3.1"
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation("io.netty:netty5-all:5.0.0.Alpha1")
implementation("org.apache.logging.log4j:log4j-api:2.17.2")
implementation("org.apache.logging.log4j:log4j-core:2.17.2")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
}
group = "com.github.gavinray97"
version = "1.0.0-SNAPSHOT"
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
kradle {
// general {
// bootstrap.enable()
// git.enable()
// projectProperties.enable()
// buildProperties.enable()
// }
jvm {
kotlin {
useCoroutines()
lint {
ktlint.enable()
}
test {
//useKotest()
useMockk()
}
}
application {
mainClass("Netty5PostgresWireServerKt")
}
//dependencies.enable()
//vulnerabilityScan.enable()
lint.enable()
codeAnalysis.enable()
developmentMode.enable()
test {
junitJupiter.enable {
version("5.8.2")
}
prettyPrint(true)
showStandardStreams(true)
withIntegrationTests()
withFunctionalTests()
}
codeCoverage.enable()
benchmark.enable()
packaging.enable()
docker {
withJvmKill()
}
documentation.enable()
}
}
tasks {
val ENABLE_PREVIEW = "--enable-preview"
withType<JavaCompile> {
options.compilerArgs.add(ENABLE_PREVIEW)
options.compilerArgs.add("-Xlint:preview")
}
withType<Test> {
useJUnitPlatform()
jvmArgs!!.add(ENABLE_PREVIEW)
}
withType<JavaExec> {
jvmArgs!!.add(ENABLE_PREVIEW)
}
withType<KotlinCompile> {
kotlinOptions.javaParameters = true
kotlinOptions.freeCompilerArgs =
listOf(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.Experimental",
// Enables automatic inference of generic type parameters
// when calling buildMap { ... }, buildList { ... }, etc.
"-Xenable-builder-inference",
// [Kotlin 1.6.20]
// Parallelize compilation of source files to number of cores
"-Xbackend-threads=0",
// [Kotlin 1.6.20]
// Enables experimental support for Context Receivers
"-Xcontext-receivers",
)
}
}