-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
80 lines (68 loc) · 1.9 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven("https://maven.aliyun.com/repository/public/")
maven("https://maven.aliyun.com/repository/gradle-plugin")
maven("https://plugins.gradle.org/m2/")
}
dependencies {
classpath(Deps.Kotlin.Gradle)
}
}
plugins {
`java-library`
id("com.google.devtools.ksp") version Deps.Ksp.Version apply false
}
subprojects {
repositories {
mavenLocal()
mavenCentral()
maven("https://maven.aliyun.com/repository/public/")
}
apply(plugin = "kotlin")
apply(plugin = "com.google.devtools.ksp")
group = "me.play"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
val api by configurations
val implementation by configurations
val testImplementation by configurations
dependencies {
implementation(Deps.Kotlin.Jvm)
testImplementation(kotlin("test"))
}
tasks {
"test"(Test::class) {
useJUnitPlatform()
}
}
val javaVersion = JavaVersion.VERSION_17
java {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
val kotlinCompilerArgs = listOf(
"-Xallow-result-return-type",
"-XXLanguage:+InlineClasses",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.ExperimentalUnsignedTypes",
"-opt-in=kotlin.time.ExperimentalTime",
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlin.experimental.ExperimentalTypeInference",
"-opt-in=kotlin.io.path.ExperimentalPathApi",
"-opt-in=kotlin.ExperimentalStdlibApi",
"-opt-in=kotlinx.serialization.InternalSerializationApi",
"-Xjvm-default=all",
"-Xstring-concat=indy-with-constants",
"-Xcontext-receivers"
)
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = javaVersion.toString()
kotlinOptions.javaParameters = true
kotlinOptions.freeCompilerArgs = kotlinCompilerArgs
}
}