Skip to content

Commit 69e50e0

Browse files
committed
新增支持AfyBroker平台
1 parent 93e1cdd commit 69e50e0

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package io.izzel.taboolib.gradle.description
2+
3+
import io.izzel.taboolib.gradle.TabooLibExtension
4+
import org.gradle.api.Project
5+
6+
class BuilderAfyBroker extends Builder {
7+
8+
@Override
9+
byte[] build(Description description, Project project, TabooLibExtension tabooLibExt) {
10+
def body = startBukkitFile()
11+
body += "name: ${description.name ?: project.name}"
12+
13+
if (tabooLibExt.version.skipTabooLibRelocate) {
14+
body += "main: taboolib.platform.AfyBrokerPlugin"
15+
} else {
16+
body += "main: ${project.group}.taboolib.platform.BungeePlugin"
17+
}
18+
19+
body += "version: ${project.version}"
20+
writeLine(body)
21+
// authors
22+
def con = description.con.contributors.collect { it.name }.join(', ')
23+
write(body, con, 'author')
24+
writeLine(body)
25+
// dependency
26+
writeList(body, description.dep.dependencies
27+
.findAll { it.with == null || it.with.equalsIgnoreCase('afybroker') }
28+
.findAll { it.forceDepend() }
29+
.collect { it.name }, 'depends')
30+
writeList(body, description.dep.dependencies
31+
.findAll { it.with == null || it.with.equalsIgnoreCase('afybroker') }
32+
.findAll { it.optional }
33+
.collect { it.name }, 'softDepends')
34+
writeLine(body)
35+
// custom nodes
36+
description.bungeeNodes.each {
37+
if (it.value instanceof List) {
38+
writeList(body, it.value, it.key)
39+
} else {
40+
write(body, it.value, it.key)
41+
}
42+
}
43+
return bytes(body)
44+
}
45+
}

src/main/groovy/io/izzel/taboolib/gradle/description/Platforms.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ enum Platforms {
1414

1515
SPONGE7('Sponge7', 'platform-sponge-api7', 'mcmod.info', new BuilderSponge7()),
1616

17-
SPONGE8('Sponge8', 'platform-sponge-api8', 'META-INF/plugins.json', new BuilderSponge8());
17+
SPONGE8('Sponge8', 'platform-sponge-api8', 'META-INF/plugins.json', new BuilderSponge8()),
18+
19+
AFYBROKER("AfyBroker","platform-afybroker","broker.yml",new BuilderAfyBroker());
1820

1921
String key
2022
String module

src/main/kotlin/io/izzel/taboolib/gradle/Standards.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ const val BUNGEE = "platform-bungee"
6666

6767
const val VELOCITY = "platform-velocity"
6868

69+
const val AFYBROKER = "platform-afybroker"
70+
6971
/** Bukkit 完整模块 */
7072
val BUKKIT_ALL = arrayOf(BUKKIT, BUKKIT_HOOK, BUKKIT_UTIL, BUKKIT_XSERIES)
7173

0 commit comments

Comments
 (0)