-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
64 lines (53 loc) · 1.44 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
import org.gradle.configurationcache.extensions.capitalized
plugins {
idea
kotlin("jvm") version "1.8.10"
id("io.papermc.paperweight.userdev") version "1.4.1"
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("reflect"))
paperDevBundle("1.19.2-R0.1-SNAPSHOT")
}
extra.apply {
set("pluginClass", "Core")
set("pluginName", project.name.split("-").joinToString("") { it.capitalized() })
set("packageName", project.name.replace("-", ""))
set("kotlinVersion", "1.8.10")
set("paperVersion", "1.19")
}
tasks {
processResources {
filesMatching("*.yml") {
expand(project.properties)
expand(project.extra.properties)
}
}
create<Jar>("paperJar") {
from(sourceSets["main"].output)
archiveBaseName.set(project.extra.properties["pluginName"].toString())
archiveVersion.set("")
doLast {
val plugins = File(rootDir, "server/plugins/")
val update = File(plugins, "update")
copy {
from(archiveFile)
into(if (File(plugins, archiveFileName.get()).exists()) File(plugins, "update") else plugins)
}
File(update, "RELOAD").delete()
}
}
}
idea {
module {
excludeDirs.add(file("server"))
}
}