-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
83 lines (72 loc) · 2.25 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
import org.gradle.api.tasks.testing.logging.TestLogEvent
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
scala
alias(libs.plugins.scalatest)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.dokka)
}
val projectRepository = projectDir.resolve("libs")
allprojects {
with(rootProject.libs.plugins) {
apply(plugin = "scala")
apply(plugin = kotlin.jvm.get().pluginId)
apply(plugin = dokka.get().pluginId)
}
if (!this.name.contains("kt")) {
apply(plugin = rootProject.libs.plugins.scalatest.get().pluginId)
}
repositories {
mavenCentral()
}
dependencies {
with(rootProject.libs) {
implementation(kotlin.stdlib)
implementation(scala.stdlib)
// Gears is a wip strawman library for async programming not available on Maven Central: it is
// included as git submodule in this project and added as dependency via jars.
val gears = "gears_3"
implementation(
files(
listOf(
"$gears.jar",
"$gears-javadoc.jar",
"$gears-sources.jar",
).map { projectRepository.resolve(it) },
),
)
implementation(kotlinx.coroutines.core)
testRuntimeOnly(flexmark) // needed to make it works scalatest
testImplementation(scalatest)
testImplementation(bundles.kotlin.testing)
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
kotlin {
target {
compilations.all {
kotlinOptions {
allWarningsAsErrors = true
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
}
}
}
}
tasks.test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
showCauses = true
showStackTraces = true
events(*TestLogEvent.values())
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
tasks.jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}