-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
125 lines (106 loc) · 3.52 KB
/
build.gradle
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
//file:noinspection VulnerableLibrariesLocal
//file:noinspection GroovyAssignabilityCheck
//file:noinspection GroovyAccessibility
import xyz.jpenilla.runtask.task.AbstractRun
plugins {
id 'java'
id 'net.minecrell.plugin-yml.bukkit' version '0.6.0'
id "xyz.jpenilla.run-paper" version "2.3.1"
}
group = 'me.adrigamer2950'
version = properties.get("version") + (
project.hasProperty("BUILD_NUMBER") ?
("-DEV" + (
project.property("BUILD_NUMBER") == "0" ? "" : ("-b" + project.property("BUILD_NUMBER")))
)
: ""
)
var description = properties.get("description")
var author = properties.get("author")
var mainClass = properties.get("main")
repositories {
mavenCentral()
maven {
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
name = "devadri"
url = "https://repo.devadri.es/repository/releases"
}
}
dependencies {
// JetBrains Annotations
compileOnly "org.jetbrains:annotations:24.1.0"
// Paper API
compileOnly "io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT"
// AdriAPI
compileOnly "me.adrigamer2950:AdriAPI:2.0.1"
// Lombok
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
}
def targetJavaVersion = 17
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
options.encoding = 'UTF-8'
}
}
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
bukkit {
name = rootProject.name
version = version
main = mainClass
apiVersion = "1.18"
author = this.author
description = this.description
website = "https://github.com/Adrigamer2950/" + rootProject.name
load = 'POSTWORLD'
foliaSupported = true
depend = ["AdriAPI"]
commands {
premiumtags {
usage = "/pt help"
aliases = ["pt"]
}
}
}
jar {
archiveBaseName.set(rootProject.name)
archiveVersion.set(version)
}
runServer {
minecraftVersion("1.20.2")
downloadPlugins {
// AdriAPI
modrinth("adriapi", "2.0.1")
// ViaVersion
hangar("ViaVersion", "5.0.3")
}
}
tasks.withType(AbstractRun).configureEach {
javaLauncher = javaToolchains.launcherFor {
vendor = JvmVendorSpec.JETBRAINS
languageVersion = JavaLanguageVersion.of(21)
}
jvmArgs(
// Hot Swap
"-XX:+AllowEnhancedClassRedefinition",
// Aikar Flags
"--add-modules=jdk.incubator.vector", "-XX:+UseG1GC", "-XX:+ParallelRefProcEnabled",
"-XX:MaxGCPauseMillis=200", "-XX:+UnlockExperimentalVMOptions", "-XX:+DisableExplicitGC",
"-XX:+AlwaysPreTouch", "-XX:G1NewSizePercent=30", "-XX:G1MaxNewSizePercent=40",
"-XX:G1HeapRegionSize=8M", "-XX:G1ReservePercent=20", "-XX:G1HeapWastePercent=5",
"-XX:G1MixedGCCountTarget=4", "-XX:InitiatingHeapOccupancyPercent=15",
"-XX:G1MixedGCLiveThresholdPercent=90", "-XX:G1RSetUpdatingPauseTimePercent=5",
"-XX:SurvivorRatio=32", "-XX:+PerfDisableSharedMem", "-XX:MaxTenuringThreshold=1",
"-Dusing.aikars.flags=https://mcflags.emc.gs", "-Daikars.new.flags=true"
)
}