generated from MineBuilders/allaymc-kotlin-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
43 lines (37 loc) · 1.52 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
plugins {
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.compose.multiplatform) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.gradleup.shadow) apply false
}
version = libs.versions.allaymc.kotlinx.get()
subprojects {
afterEvaluate {
runCatching {
kotlin {
sourceSets.all { // all is jvm :P
dependencies {
@Suppress("VulnerableLibrariesLocal", "RedundantSuppression")
compileOnly(libs.allaymc.api)
}
}
compilerOptions.freeCompilerArgs.addAll(
"-Xcontext-receivers", // https://kotlinlang.org/docs/whatsnew2020.html#phased-replacement-of-context-receivers-with-context-parameters
)
}
}
if (projectDir.resolve("src/main/resources/plugin.json").exists()) {
val version = rootProject.libs.versions.allaymc.kotlinx.get()
tasks.named("processResources") {
doLast {
val origin = file("src/main/resources/plugin.json")
val processed = file("${layout.buildDirectory.get()}/resources/main/plugin.json")
val content = origin.readText().replace("\${version}", version)
processed.writeText(content)
}
}
}
}
}