-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
190 lines (154 loc) · 5.11 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
plugins {
id 'java'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '1.9.21'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
id 'xyz.jpenilla.run-paper' version '2.3.1'
}
group = 'ir.syrent.velocityreport'
version = findProperty("version")
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
// Velocity-API / PaperLib
maven {
name 'papermc'
url 'https://repo.papermc.io/repository/maven-public/'
}
// AdventureAPI/MiniMessage
maven {
name = "sonatype-oss-snapshots"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
// SpigotAPI
maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
// As of Gradle 5.1, you can limit this to only those
// dependencies you expect from it
content {
includeGroup 'org.bukkit'
includeGroup 'org.spigotmc'
}
}
// PlaceholderAPI
maven {
url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
}
maven {
name = "jitpack"
url = 'https://jitpack.io'
}
maven {
name = 'sonatype-oss-snapshots'
url = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
}
maven {
name = 'sayandevelopment-repository'
url = 'https://repo.sayandev.org/snapshots'
}
maven {
name = "sonatype-oss-snapshots1"
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
}
maven {
name = "codeberg"
url = uri("https://codeberg.org/api/packages/Andre601/maven/")
}
maven {
name = "discordsrv"
url = uri("https://nexus.scarsz.me/content/groups/public/")
}
}
dependencies {
compileOnly 'me.clip:placeholderapi:2.11.5'
compileOnly 'com.velocitypowered:velocity-api:3.1.1'
compileOnly 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
compileOnly 'org.sayandev:sayanvanish-api:1.5.2-SNAPSHOT'
compileOnly 'org.sayandev:sayanvanish-bukkit:1.5.2-SNAPSHOT'
compileOnly 'org.sayandev:sayanvanish-proxy-velocity:1.5.2-SNAPSHOT'
// gson is not exist in legacy minecraft version
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.zaxxer:HikariCP:5.1.0'
implementation 'io.papermc:paperlib:1.0.8'
implementation 'org.bstats:bstats-bukkit:3.0.2'
implementation 'club.minnced:discord-webhooks:0.8.4'
implementation 'com.github.cryptomorin:XSeries:11.2.0'
implementation 'net.kyori:adventure-api:4.17.0'
implementation 'net.kyori:adventure-platform-bukkit:4.3.4'
implementation 'net.kyori:adventure-text-minimessage:4.17.0'
annotationProcessor 'com.velocitypowered:velocity-api:3.1.1'
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
shadowJar {
minimize()
relocate('com.cryptomorin.xseries', 'ir.syrent.velocityreport.xseries')
relocate('net.kyori', 'ir.syrent.velocityreport.kyori.adventure')
relocate('org.bstats', 'ir.syrent.velocityreport.bstats')
// relocate('kotlin', 'ir.syrent.velocityreport.kotlin')
relocate('com.jeff_media.updatechecker', 'ir.syrent.velocityreport.updatechecker')
relocate('com.zaxxer.hikari', 'ir.syrent.velocityreport.zaaxer.hikari')
manifest {
attributes["paperweight-mappings-namespace"] = "mojang"
}
archiveFileName = findProperty("plugin-name") + " v" + findProperty("version") + ".jar"
}
jar {
archiveFileName = findProperty("plugin-name") + " v" + findProperty("version") + " " + "unshaded" + ".jar"
}
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
disableAutoTargetJvm()
}
tasks.withType(JavaCompile).configureEach {
options.deprecation = true
options.encoding = 'UTF-8'
}
compileJava.options.encoding = 'UTF-8'
compileJava.dependsOn clean
build.dependsOn shadowJar
tasks.withType(Jar) {
destinationDirectory = file("$rootDir/bin/")
}
tasks {
jar {
manifest {
attributes["paperweight-mappings-namespace"] = "mojang"
}
}
runServer {
minecraftVersion("1.19.4")
}
}
clean.doLast {
file("${rootDir}/bin").deleteDir()
}
def templateSource = file('src/main/templates')
def templateDest = layout.buildDirectory.dir('generated/sources/templates')
def generateTemplates = tasks.register('generateTemplates', Copy) { task ->
def props = [
'version': project.version
]
task.inputs.properties props
task.from templateSource
task.into templateDest
task.expand props
}
sourceSets.main.java.srcDir(generateTemplates.map { it.outputs })
rootProject.idea.project.settings.taskTriggers.afterSync generateTemplates