-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
99 lines (80 loc) · 2.91 KB
/
build.gradle.kts
File metadata and controls
99 lines (80 loc) · 2.91 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.shadow)
alias(libs.plugins.paperweight)
alias(libs.plugins.run.paper) // Adds runServer and runMojangMappedServer tasks for testing
}
group = providers.gradleProperty("group").get()
version = providers.gradleProperty("plugin_version").get()
description = providers.gradleProperty("plugin_description").get()
val serverVersion = providers.gradleProperty("server_version").get()
ext {
set ("kotlin_version", libs.versions.kotlin.get())
set ("kotlinx_coroutines_version", libs.versions.kotlinx.coroutines.get())
}
repositories {
mavenLocal()
mavenCentral()
maven ("https://jitpack.io")
maven ("https://repo.papermc.io/repository/maven-public/")
maven ("https://oss.sonatype.org/content/groups/public/")
maven ("https://repo.william278.net/releases")
maven ("https://repo.flyte.gg/releases")
maven ("https://repo.minebench.de/")
}
dependencies {
paperweight.paperDevBundle(serverVersion)
compileOnly (libs.kotlin.stdlib)
compileOnly (libs.kotlinx.coroutines)
// Libs
implementation(libs.bstats)
implementation(libs.configlib.yaml)
// Twilight Dev API
implementation (libs.twilight)
// Cloud Command Framework
implementation (libs.cloud.paper)
implementation (libs.cloud.annotations)
// Lamp Command Framework
implementation(libs.lamp.common)
implementation(libs.lamp.bukkit)
implementation(libs.lamp.brigadier)
// External libraries
// implementation(libs.netty.codec)
// implementation(libs.netty.codec.http)
// implementation(libs.netty.handler)
// implementation(libs.mysql.connector)
}
val pluginName = providers.gradleProperty("plugin_name").get()
val minecraftVersion = providers.gradleProperty("minecraft_version").get()
val javaVersion: Int = providers.gradleProperty("java_version").get().toInt()
tasks {
build { dependsOn(shadowJar) }
test {useJUnitPlatform() }
runServer { minecraftVersion(minecraftVersion) }
processResources {
filteringCharset = Charsets.UTF_8.name()
filesMatching(listOf("paper-plugin.yml", "plugin.yml")) {
expand(rootProject.properties)
}
}
shadowJar {
archiveFileName.set("$pluginName-$version.jar")
val libraryPath = "io.lcydev.libraries"
relocate("io.github", "$libraryPath.github")
relocate("gg.flyte.twilight", "$libraryPath.twilight")
relocate("revxrsal.commands", "$libraryPath.revxrsal.commands")
relocate("com.mongodb", "$libraryPath.com.mongodb")
relocate("com.google", "$libraryPath.com.google")
relocate("org.bson", "$libraryPath.org.bson")
relocate("org.jetbrains", "$libraryPath.org.jetbrains")
minimize()
}
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(javaVersion)
setSourceCompatibility(javaVersion)
setTargetCompatibility(javaVersion)
}
kotlin {
jvmToolchain(javaVersion)
}