forked from nothub/SafeTPA
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
101 lines (87 loc) · 3.06 KB
/
build.gradle
File metadata and controls
101 lines (87 loc) · 3.06 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
100
101
plugins {
id 'java-library'
id 'io.github.goooler.shadow' version '8.1.8'
id 'xyz.jpenilla.run-paper' version '3.0.2'
}
group = 'lol.hub'
version = pluginVersion
description = 'Minecraft self-service teleport requests'
ext {
minecraftVersion = project.findProperty('minecraftVersion') ?: '1.20.4'
javaVersion = JavaVersion.toVersion(project.findProperty('javaVersion') ?: '21')
pluginVersion = project.findProperty('pluginVersion') ?: '1.0.0'
}
repositories {
mavenCentral()
maven {
url = 'https://repo.papermc.io/repository/maven-public/'
content {
includeGroup 'com.mojang'
includeGroup 'dev.folia'
includeGroup 'io.papermc.paper'
includeGroup 'net.kyori'
includeGroup 'net.md-5'
}
}
maven {
// FoliaLib
url = 'https://repo.tcoded.com/releases/'
content {
includeGroup 'com.tcoded'
}
}
}
dependencies {
// paper api
// https://jd.papermc.io/paper/1.20/
compileOnly group: 'io.papermc.paper', name: 'paper-api', version: "${minecraftVersion}-R0.1-SNAPSHOT"
// folia api
// https://jd.papermc.io/folia/1.20/
//compileOnly group: 'dev.folia', name: 'folia-api', version: "${minecraftVersion}-R0.1-SNAPSHOT"
// https://github.com/TechnicallyCoded/FoliaLib
shadow group: 'com.tcoded', name: 'FoliaLib', version: "0.5.1"
// Other dependencies
shadow 'org.bstats:bstats-bukkit:3.1.0'
}
java {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.release = sourceCompatibility.toInteger()
}
processResources {
filteringCharset "UTF-8"
filesMatching("plugin.yml") {
filter { line -> line.replace("@VERSION@", project.version) }
filter { line -> line.replace("@DESCRIPTION@", project.description) }
}
}
// https://imperceptiblethoughts.com/shadow/
shadowJar {
configurations = [project.configurations.shadow]
archiveFileName = "${project.name}-${project.version}+${minecraftVersion}.jar"
destinationDirectory = layout.buildDirectory.dir('dist')
relocate 'org.bstats', 'lol.hub.bstats'
relocate 'com.tcoded', 'lol.hub.tcoded'
// delete unshaded jar
doLast {
file(jar.archiveFile).delete()
}
}
tasks.named('build') { finalizedBy(shadowJar) }
tasks {
runServer {
runDirectory = project.layout.projectDirectory.dir('run')
minecraftVersion(minecraftVersion)
dependsOn('build')
systemProperty('com.mojang.eula.agree', 'true')
downloadPlugins {
url("https://github.com/ViaVersion/ViaBackwards/releases/download/5.5.0/ViaBackwards-5.5.0.jar")
url("https://github.com/ViaVersion/ViaVersion/releases/download/5.5.0/ViaVersion-5.5.0.jar")
url("https://github.com/dmulloy2/ProtocolLib/releases/download/5.4.0/ProtocolLib.jar")
url("https://ci.codemc.io/job/Updated-NoCheatPlus/job/Updated-NoCheatPlus/198/artifact/target/NoCheatPlus.jar")
}
}
}