-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
76 lines (71 loc) · 2.23 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
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
with(libs.plugins) {
alias(kotlin.jvm) apply false
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.kotlin.link")
// maven("https://oss.sonatype.org/content/repositories/snapshots")
}
}
val jvmTargetVersion: String by properties
stal {
action {
on("kotlin jvm") {
apply(plugin = "org.jetbrains.kotlin.jvm")
configure<KotlinJvmProjectExtension> {
target.compilations.all {
kotlinOptions {
jvmTarget = jvmTargetVersion
}
compileTaskProvider.apply {
// TODO: Check if really is necessary
kotlinOptions {
jvmTarget = jvmTargetVersion
}
}
}
sourceSets {
all {
languageSettings {
progressiveMode = true
}
}
val test by getting {
dependencies {
implementation(kotlin("test"))
}
}
}
}
tasks.named<Test>("test") {
useJUnitPlatform()
}
}
on("kotlin common settings") {
configure<org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension> {
sourceSets {
all {
languageSettings {
progressiveMode = true
optIn("kotlin.contracts.ExperimentalContracts")
}
}
}
}
pluginManager.withPlugin("org.gradle.java") {
configure<JavaPluginExtension> {
targetCompatibility = JavaVersion.toVersion(jvmTargetVersion)
}
tasks.withType<Test> {
useJUnitPlatform()
}
}
}
}
}