-
Notifications
You must be signed in to change notification settings - Fork 83
/
build.gradle.kts
73 lines (60 loc) · 1.99 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
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import java.util.*
plugins {
java
kotlin("jvm") version "2.0.0"
kotlin("plugin.serialization") version "2.0.0"
alias(libs.plugins.versions)
alias(libs.plugins.version.catalog.update)
alias(libs.plugins.graal)
}
group = "com.kousenit"
version = "1.0"
val scriptname: String by project // read value from gradle.properties
graal {
mainClass("scripts.${scriptname.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString()
}}Kt")
outputName(scriptname) // output is build/graal/${scriptname}
}
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("reflect"))
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.datetime)
implementation(libs.kotlinx.serialization.json)
implementation(libs.commons.math3)
implementation(libs.gson)
implementation(libs.commons.validator) {
// Avoid security vulnerability in commons-collections 3.2.2
exclude(group = "commons-collections", module = "commons-collections")
}
implementation(libs.commons.collections4)
implementation(libs.bundles.ktor.client)
testImplementation(libs.assertj)
testImplementation(libs.bundles.junit)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(kotlin("test-junit5"))
implementation(kotlin("script-runtime"))
implementation(kotlin("stdlib-jdk8"))
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
tasks.named<Test>("test") {
useJUnitPlatform {
maxParallelForks = Runtime.getRuntime().availableProcessors() / 2 + 1
}
}
tasks.named("compileKotlin", KotlinCompilationTask::class.java) {
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_2_0)
freeCompilerArgs = listOf("-Xjsr305=strict", "-Xuse-fir-lt=false")
suppressWarnings = true
}
}