This repository was archived by the owner on Dec 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
85 lines (69 loc) · 2.26 KB
/
build.gradle.kts
File metadata and controls
85 lines (69 loc) · 2.26 KB
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
84
85
plugins {
java
`java-library`
kotlin("jvm") version "1.9.0"
id("io.papermc.paperweight.userdev") version "1.5.5"
id("xyz.jpenilla.run-paper") version "2.1.0" // Adds runServer and runMojangMappedServer tasks for testing
id("com.github.johnrengelman.shadow") version "8.1.1"
}
group = "dev.worldsw"
version = "2.0.0"
description = "The plugin for the architecture king(YouTuber)."
repositories {
mavenCentral()
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
dependencies {
paperweight.paperDevBundle("1.20.2-R0.1-SNAPSHOT")
implementation(kotlin("stdlib"))
implementation(kotlin("reflect"))
testImplementation(kotlin("test"))
}
val pluginName = rootProject.name.split('-').joinToString("") { it.replaceFirstChar(Char::titlecase) }
tasks {
processResources {
filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything
val props = mapOf(
"name" to project.name,
"version" to project.version,
"description" to project.description,
"apiVersion" to "1.20"
)
inputs.properties(props)
filesMatching("*plugin*.yml") {
expand(props)
}
}
test {
useJUnitPlatform()
}
runServer {
minecraftVersion("1.20.2")
jvmArgs("-Dcom.mojang.eula.agree=true")
}
assemble {
dependsOn(reobfJar)
dependsOn(shadowJar)
}
compileJava {
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable.
// See https://openjdk.java.net/jeps/247 for more information.
options.release.set(17)
}
javadoc {
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
}
shadowJar {
dependencies {
include(dependency("org.jetbrains.kotlin:kotlin-stdlib"))
include(dependency("org.jetbrains.kotlin:kotlin-reflect"))
}
}
task<Exec>("uploadToServer") {
dependsOn(assemble)
commandLine("scp", "./build/libs/${project.name}-${project.version}.jar", "ubuntu@xxx.xxx.xxx.xxx:/home/ubuntu/xxx/plugins")
}
}