forked from kousen/kotlin-cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
69 lines (56 loc) · 1.79 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
java
kotlin("jvm") version "1.8.10"
kotlin("plugin.serialization") version "1.8.10"
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.capitalize()}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 {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.named<Test>("test") {
useJUnitPlatform {
maxParallelForks = Runtime.getRuntime().availableProcessors() / 2 + 1
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = listOf("-Xjsr305=strict")
suppressWarnings = true
}
}