-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
128 lines (108 loc) · 3.79 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
plugins {
id 'java'
id 'maven-publish'
id 'com.gradleup.shadow' version '8.3.5'
id "xyz.jpenilla.run-paper" version "2.3.1"
}
def versionOnly = property("version")
def versionWithGit = versionOnly + "-${getGitHash()}"
String getGitHash() {
def output = new ByteArrayOutputStream()
exec {
standardOutput = output
commandLine 'git', 'rev-parse', '--short', 'HEAD'
}
return output.toString().trim()
}
String getDate() {
def date = new Date()
def formattedDate = date.format('yyyy.MM.dd')
return formattedDate
}
allprojects {
group = 'cc.happyareabean'
version = versionWithGit
description = 'SWMHook'
repositories {
mavenCentral()
maven { url = uri('https://repo.fantasyrealms.net/other-snapshots') }
maven { url = uri('https://repo.fantasyrealms.net/other-libraries') }
maven { url = uri('https://repo.fantasyrealms.net/releases') }
maven { url = uri('https://repo.codemc.io/repository/nms/') }
maven { url = uri('https://repo.extendedclip.com/content/repositories/placeholderapi/') }
maven { url = uri('https://repo.glaremasters.me/repository/concuncan/') }
maven { url = uri('https://repo.glaremasters.me/repository/public/') }
maven { url = uri('https://repo.maven.apache.org/maven2/') }
maven { url = uri('https://jitpack.io') }
mavenLocal()
}
}
dependencies {
implementation(project("aswm"))
implementation(project("plugin"))
implementation(project("core"))
implementation(project("slimeworldplugin"))
}
def mcVersion = "1.8.8"
def runDirectoryDir = project.hasProperty('runPaper.runDirectory') ? property('runPaper.runDirectory') : "${project.rootProject.projectDir}/.run"
def runServerJar = project.hasProperty('runPaper.serverJar') ? property('runPaper.serverJar') : null
tasks.runServer {
// Configure the Minecraft version for our task.
// This is the only required configuration besides applying the plugin.
// Your plugin's jar (or shadowJar if present) will be used automatically.
minecraftVersion(mcVersion)
if (runServerJar != null)
serverJar(runDirectory.file(runServerJar as String))
runDirectory.set(file(runDirectoryDir))
jvmArgs '-javaagent:slimeworldmanager-classmodifier-2.2.1.jar'
}
tasks.processResources {
expand("pluginVersion": project.version, "commit": getGitHash(), "buildDate": getDate())
}
def relocatePackage = "cc.happyareabean.swmhook.libs"
shadowJar {
archiveClassifier.set('')
archiveVersion.set('')
relocate("de.exlll.configlib", "${relocatePackage}.configlib")
relocate("net.kyori", "${relocatePackage}.kyori")
relocate("org.bstats", "${relocatePackage}.bstats")
relocate("org.semver4j", "${relocatePackage}.semver4j")
relocate("org.yaml", "${relocatePackage}.yaml")
relocate("revxrsal.commands", "${relocatePackage}.commands")
}
build {
finalizedBy {
tasks.shadowJar
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withJavadocJar()
}
compileJava { // Preserve parameter names in the bytecode
options.compilerArgs += ["-parameters"]
options.fork = true
options.encoding = 'UTF-8'
}
javadoc {
options.encoding = 'UTF-8'
}
publishing {
repositories {
maven {
name = "frsReleases"
url = "https://repo.fantasyrealms.net/releases/"
credentials {
username findProperty("frsRepositoryUsername").toString()
password findProperty("frsRepositoryPassword").toString()
}
}
}
publications {
maven(MavenPublication) { publication ->
project.shadow.component(publication)
version = versionOnly
}
}
}