-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
96 lines (82 loc) · 2.63 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
/*
* This file was generated by the Gradle 'init' task.
*/
plugins {
id "java"
id "java-library"
id "com.github.johnrengelman.shadow" version "7.1.2" // Import utility to package libraries into .jar file.
}
group = "uk.hotten.herobrine"
version = "1.3.2"
repositories {
mavenLocal()
mavenCentral()
maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
content {
includeGroup 'org.bukkit'
includeGroup 'org.spigotmc'
}
}
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
maven { url = 'https://jitpack.io' }
maven { url = "https://repo.dmulloy2.net/repository/public/" }
maven { url = "https://repo.hotten.cloud/snapshots" }
maven { url = "https://repo.hotten.cloud/releases" }
}
dependencies {
api 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.16.1'
api 'com.fasterxml.jackson.core:jackson-databind:2.16.1'
api 'commons-io:commons-io:2.11.0'
api 'org.apache.commons:commons-pool2:2.11.1'
api 'com.mysql:mysql-connector-j:8.2.0'
api 'redis.clients:jedis:3.4.1'
api 'xyz.xenondevs:particle:1.8.3'
api 'me.tigerhix.lib:scoreboard:1.0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT'
compileOnly 'com.comphenix.protocol:ProtocolLib:5.1.0'
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
implementation 'uk.hotten:gxui:1.2.1'
}
tasks.register('updatePluginYmlVersion') {
doLast {
def file = file('src/main/resources/plugin.yml')
def lines = file.readLines()
lines[2] = "version: ${version}-" + getCurrentGitBranch()
file.write(lines.join("\n"))
}
}
def revertPluginYmlVersion() {
def file = file('src/main/resources/plugin.yml')
def lines = file.readLines()
lines[2] = "version: ${version}"
file.write(lines.join("\n"))
}
def getCurrentGitBranch() {
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (ignored) {
return 'unknown'
}
}
shadowJar {
minimize()
archiveClassifier.set(getCurrentGitBranch())
doLast {
revertPluginYmlVersion()
}
}
jar.dependsOn shadowJar
compileJava {
options.compilerArgs += ["-parameters"]
options.fork = true
compileJava.options.encoding = 'UTF-8'
}
compileJava.dependsOn updatePluginYmlVersion