-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
83 lines (69 loc) · 1.84 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
81
82
83
val kotlinVersion = "1.9.0"
val javaVersion = 17
val paperVersion = "1.20.1"
group = "io.github.pleahmacaka"
version = "0.1.0"
plugins {
val kotlinVersion = "1.9.0"
idea
kotlin("jvm") version kotlinVersion
id("io.papermc.paperweight.userdev") version "1.5.3"
}
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("reflect"))
paperweight.paperDevBundle("$paperVersion-R0.1-SNAPSHOT")
}
extra.apply {
set("pluginName", project.name.split('-').joinToString(""))
set("packageName", project.name.replace('-', '.'))
set("pluginVersion", version)
set("kotlinVersion", kotlinVersion)
set("paperVersion", paperVersion)
}
tasks {
processResources {
filesMatching("*.yml") {
expand(project.properties)
expand(extra.properties)
}
}
jar {
archiveFileName.set(project.name + "-dev.jar")
destinationDirectory.set(file(".server/plugins"))
}
withType<JavaCompile>().configureEach {
if (javaVersion >= 10 || JavaVersion.current().isJava10Compatible) {
options.release.set(javaVersion)
}
}
processResources {
val props = mapOf("version" to version)
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("paper-plugin.yml") {
expand(props)
}
}
}
idea {
module {
excludeDirs.add(file(".server"))
}
}
kotlin {
jvmToolchain(javaVersion)
}
java {
val javaVersion = JavaVersion.toVersion(javaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion)
toolchain.languageVersion.set(JavaLanguageVersion.of(this@Build_gradle.javaVersion))
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}