-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
build.gradle.kts
55 lines (45 loc) · 1.78 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
plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.dokka)
id("xyz.xenondevs.bundler-jar-plugin")
}
fun RepositoryHandler.configureRepos() {
mavenLocal { content { includeGroupAndSubgroups("xyz.xenondevs") }}
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.xenondevs.xyz/releases")
}
repositories { configureRepos() }
subprojects {
group = "xyz.xenondevs.nova"
version = properties["version"] as String
repositories { configureRepos() }
tasks {
register<Jar>("sources") {
dependsOn(JavaPlugin.CLASSES_TASK_NAME)
from("src/main/java", "src/main/kotlin")
archiveClassifier.set("sources")
}
withType<JavaCompile> {
sourceCompatibility = "21"
targetCompatibility = "21"
}
withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile> {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
freeCompilerArgs.addAll(
"-Xjvm-default=all", // Emit JVM default methods for interface declarations with bodies
// experimental features
"-opt-in=kotlin.io.path.ExperimentalPathApi",
"-opt-in=kotlin.time.ExperimentalTime",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
)
if (!project.hasProperty("release")) {
freeCompilerArgs.addAll(
"-Xdebug" // https://kotlinlang.org/docs/debug-coroutines-with-idea.html#optimized-out-variables
)
}
}
}
}
}