-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
162 lines (127 loc) · 4.93 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
import java.nio.file.Files
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'kr.entree.spigradle' version '2.4.2'
id 'java'
id "xyz.jpenilla.run-paper" version "2.1.0"
id 'net.kyori.indra.git' version "3.1.3"
}
group 'cc.happyareabean'
version '1.1.7'
def gitCommit = indraGit.commit().abbreviate(7).name()
def fullVersion = "${project.version}-${gitCommit}"
sourceCompatibility = JavaLanguageVersion.of(8)
targetCompatibility = JavaLanguageVersion.of(8)
compileJava.options.encoding = 'UTF-8'
archivesBaseName = rootProject.name
repositories {
mavenCentral()
//Added spigot repository
maven {
name = 'Spigot'
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
//Added md5's repository to add the missing BungeeCord-Chat api
maven {
name = 'BungeeCord-Chat'
url = 'https://oss.sonatype.org/content/repositories/snapshots'
}
maven {
url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
}
maven {
name = "sonatype-oss-snapshots1"
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url = "https://repo.fantasyrealms.net/releases"
}
maven {
url = "https://repo.fantasyrealms.net/other-snapshots"
}
maven { url 'https://jitpack.io' }
//Add your repositories here
mavenLocal()
}
ext {
//Define one of the supported mc versions
mcVersion = '1.20.1'
}
dependencies {
//Adds the spigot api to your plugin
compileOnly "org.spigotmc:spigot-api:${mcVersion}-R0.1-SNAPSHOT"
//Add your dependencies here
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
testCompileOnly 'org.projectlombok:lombok:1.18.24'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.24'
compileOnly 'me.clip:placeholderapi:2.11.6'
implementation "net.kyori:adventure-api:4.17.0"
implementation "net.kyori:adventure-text-minimessage:4.17.0"
implementation "net.kyori:adventure-platform-bukkit:4.3.3"
implementation 'cc.happyareabean.spiget-update:bukkit:1.4.7-SNAPSHOT'
implementation "com.squareup.okhttp3:okhttp:4.12.0"
implementation 'com.github.Revxrsal.Lamp:bukkit:3.2.1'
implementation 'com.github.Revxrsal.Lamp:common:3.2.1'
implementation("de.exlll:configlib-core:2.3.0")
implementation 'org.bstats:bstats-bukkit:3.0.2'
}
spigot {
// The 'name' and 'version' will be set to project.version and project.name,
// But we may set those manually.
version = project.version.toString().endsWith("-SNAPSHOT") ? fullVersion : project.version
apiVersion '1.13'
excludeLibraries = ['*']
softDepends 'PlaceholderAPI'
authors 'HappyAreaBean'
permissions {
'sjm.admin' {
description = 'Allows to use SimpleJoinMessage commands.'
defaults = 'op'
}
}
}
processResources {
project.properties.put("version", this.version)
expand project.properties
}
def runDirectoryDir = project.hasProperty('runPaper.runDirectory') ? project.getProperty('runPaper.runDirectory') : "${project.rootProject.projectDir}/working"
def runServerJar = project.hasProperty('runPaper.serverJar') ? project.getProperty('runPaper.serverJar') : null
def libsPackage = group + ".sjm.libs"
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))
}
shadowJar {
archiveClassifier.set('')
relocate("revxrsal.commands", "${libsPackage}.lamp")
relocate("org.bstats", "${libsPackage}.bstats")
relocate("org.inventivetalent.update.spiget", "${libsPackage}.spigetupdater")
relocate("de.exlll.configlib", "${libsPackage}.configlib")
relocate("org.yaml.snakeyaml", "${libsPackage}.snakeyaml")
relocate("net.kyori", "${libsPackage}.kyori")
relocate("okio", "${libsPackage}.okio")
relocate("okhttp3", "${libsPackage}.okhttp3")
relocate("org.intellij", "${libsPackage}.intellij")
relocate("org.jetbrains.annotations", "${libsPackage}.annotations")
relocate("kotlin", "${libsPackage}.kotlin")
}
}
abstract class PrintSnapshotVersionTask extends DefaultTask {
@TaskAction
def print() {
File versionsDir = project.file("$project.buildDir/versions")
File textFile = project.file("$project.buildDir/versions/snapshot.txt")
versionsDir.mkdirs()
Files.deleteIfExists(textFile.toPath())
textFile.createNewFile()
textFile << "$project.version"
}
}
tasks.register('snapshotVersion', PrintSnapshotVersionTask)