Skip to content

Commit 9237bab

Browse files
committed
2.0.14 测试版本
1 parent 880293a commit 9237bab

File tree

5 files changed

+406
-94
lines changed

5 files changed

+406
-94
lines changed

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
group = "io.izzel.taboolib"
11-
version = "2.0.13"
11+
version = "2.0.14"
1212

1313
configurations {
1414
create("embed") {

src/main/groovy/io/izzel/taboolib/gradle/TabooLibPlugin.groovy

+26-15
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ class TabooLibPlugin implements Plugin<Project> {
1919
project.repositories.maven {
2020
url project.uri("https://repo.spongepowered.org/maven")
2121
}
22+
2223
// 注册扩展
2324
def tabooExt = project.extensions.create('taboolib', TabooLibExtension)
24-
// 注册配置
25-
def taboo = project.configurations.maybeCreate('taboo')
2625
// 注册任务
2726
def tabooTask = project.tasks.maybeCreate('taboolibMainTask', TabooLibMainTask)
2827
tabooTask.group = "taboolib"
@@ -43,6 +42,11 @@ class TabooLibPlugin implements Plugin<Project> {
4342
project.tasks.maybeCreate('taboolibBuildApi')
4443
project.tasks.taboolibBuildApi.group = "taboolib"
4544

45+
// 注册配置
46+
def taboo = project.configurations.maybeCreate('taboo') // 这个名字起的着实二逼
47+
def include = project.configurations.maybeCreate('include') // 这个代替 "taboo"
48+
def dynamic = project.configurations.maybeCreate('dynamic') // 这个还没做完
49+
4650
// 添加依赖以及重定向配置
4751
project.afterEvaluate {
4852
def api = false
@@ -52,23 +56,28 @@ class TabooLibPlugin implements Plugin<Project> {
5256
} catch (Throwable ignored) {
5357
}
5458

55-
// 继承 "taboo" 配置
59+
// 继承 "taboo", "include" 配置
5660
project.configurations.implementation.extendsFrom(taboo)
61+
project.configurations.implementation.extendsFrom(include)
62+
// 继承 "dynamic" 配置
63+
project.configurations.compileOnly.extendsFrom(dynamic)
64+
project.configurations.testImplementation.extendsFrom(dynamic)
5765

58-
// com.mojang:datafixerupper:4.0.26
59-
project.dependencies.add('implementation', 'com.mojang:datafixerupper:4.0.26')
60-
// org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
66+
// 自动引入 com.mojang:datafixerupper:4.0.26
67+
project.dependencies.add('compileOnly', 'com.mojang:datafixerupper:4.0.26')
68+
// 自动引入 org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
6169
if (tabooExt.version.coroutines != null) {
62-
project.dependencies.add('implementation', 'org.jetbrains.kotlinx:kotlinx-coroutines-core:' + tabooExt.version.coroutines)
70+
project.dependencies.add('compileOnly', 'org.jetbrains.kotlinx:kotlinx-coroutines-core:' + tabooExt.version.coroutines)
71+
project.dependencies.add('testImplementation', 'org.jetbrains.kotlinx:kotlinx-coroutines-core:' + tabooExt.version.coroutines)
6372
}
64-
65-
// subprojects
73+
// 自动引入 TabooLib 模块
6674
tabooExt.env.modules.each {
67-
def dep = project.dependencies.create("io.izzel.taboolib:${it}:${tabooExt.version.taboolib}")
68-
if (api || isIncludeModule(it) && !tabooExt.subproject) {
69-
project.configurations.taboo.dependencies.add(dep)
75+
def dependency = project.dependencies.create("io.izzel.taboolib:${it}:${tabooExt.version.taboolib}")
76+
if (api || isCoreModule(it) && !tabooExt.subproject) {
77+
project.configurations.include.dependencies.add(dependency)
7078
} else {
71-
project.configurations.implementation.dependencies.add(dep)
79+
project.configurations.compileOnly.dependencies.add(dependency)
80+
project.configurations.testImplementation.dependencies.add(dependency)
7281
}
7382
}
7483

@@ -90,7 +99,6 @@ class TabooLibPlugin implements Plugin<Project> {
9099
}
91100

92101
def kotlinVersion = KotlinPluginWrapperKt.getKotlinPluginVersion(project).replaceAll("[._-]", "")
93-
94102
def jarTask = project.tasks.jar as Jar
95103
tabooTask.configure { TabooLibMainTask task ->
96104
task.tabooExt = tabooExt
@@ -116,7 +124,10 @@ class TabooLibPlugin implements Plugin<Project> {
116124
}
117125
}
118126

119-
static def isIncludeModule(String module) {
127+
/**
128+
* 是否为必要模块
129+
*/
130+
static def isCoreModule(String module) {
120131
return module == "common" || module == "platform-application" || Platforms.values().any { p -> p.module == module }
121132
}
122133
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
package io.izzel.taboolib.gradle
2+
3+
/**
4+
* 基础模块:配置文件,任务链
5+
*/
6+
val Basic = arrayOf(
7+
"basic-configuration",
8+
"basic-submit-chain",
9+
)
10+
11+
/**
12+
* Bukkit 虚拟 OP 工具
13+
*/
14+
val BukkitFakeOp = arrayOf(
15+
"bukkit-fake-op",
16+
"bukkit-nms"
17+
)
18+
19+
/**
20+
* Bukkit 与 Vault、PlaceholderAPI 等插件交互
21+
*/
22+
val BukkitHook = arrayOf(
23+
"bukkit-hook",
24+
)
25+
26+
/**
27+
* Bukkit 寻路工具
28+
*/
29+
val BukkitNavigation = arrayOf(
30+
"bukkit-navigation",
31+
"bukkit-nms"
32+
)
33+
34+
/**
35+
* Bukkit 箱子菜单
36+
*/
37+
val BukkitUI = arrayOf(
38+
"bukkit-ui",
39+
"bukkit-ui-12100",
40+
"bukkit-ui-legacy",
41+
"bukkit-util",
42+
"bukkit-xseries",
43+
"bukkit-xseries-item",
44+
"bukkit-nms",
45+
"minecraft-chat",
46+
)
47+
48+
/**
49+
* Bukkit 扩展工具
50+
*/
51+
val BukkitUtil = arrayOf(
52+
"bukkit-util",
53+
"bukkit-xseries",
54+
"minecraft-chat",
55+
"minecraft-i18n",
56+
"basic-configuration"
57+
)
58+
59+
/**
60+
* XSeries
61+
*/
62+
val XSeries = arrayOf(
63+
"bukkit-xseries",
64+
)
65+
66+
/**
67+
* XSeries(XSkull 及 ItemBuilder)
68+
*/
69+
val BukkitXSeriesItem = arrayOf(
70+
"bukkit-xseries",
71+
"bukkit-xseries-item",
72+
)
73+
74+
/**
75+
* Bukkit NMS
76+
*/
77+
val BukkitNMS = arrayOf(
78+
"bukkit-nms",
79+
)
80+
81+
/**
82+
* Bukkit NMS 扩展工具
83+
*/
84+
val BukkitNMSUtil = arrayOf(
85+
"bukkit-nms-legacy",
86+
"bukkit-nms-stable",
87+
"bukkit-nms-tag",
88+
"bukkit-nms-tag-12005",
89+
"bukkit-nms-tag-legacy",
90+
"bukkit-nms",
91+
*BukkitUtil,
92+
)
93+
94+
/**
95+
* Bukkit NMS ItemTag 工具
96+
*/
97+
val BukkitNMSItemTag = arrayOf(
98+
"bukkit-nms-tag",
99+
"bukkit-nms-tag-12005",
100+
"bukkit-nms-tag-legacy",
101+
"bukkit-nms",
102+
"minecraft-chat",
103+
)
104+
105+
/**
106+
* Bukkit NMS 数据序列化工具
107+
*/
108+
val BukkitNMSDataSerializer = arrayOf(
109+
"bukkit-nms-data-serializer",
110+
"bukkit-nms"
111+
)
112+
113+
/**
114+
* Bukkit NMS 实体 AI
115+
*/
116+
val BukkitNMSEntityAI = arrayOf(
117+
"bukkit-nms-ai",
118+
"bukkit-nms"
119+
)
120+
121+
/**
122+
* 数据库
123+
*/
124+
val Database = arrayOf(
125+
"database",
126+
"basic-configuration",
127+
)
128+
129+
/**
130+
* Alkaid Redis
131+
*/
132+
val DatabaseAlkaidRedis = arrayOf(
133+
"database-alkaid-redis",
134+
"basic-configuration",
135+
)
136+
137+
/**
138+
* IOC
139+
*/
140+
val DatabaseIoc = arrayOf(
141+
"database-ioc",
142+
"basic-configuration",
143+
)
144+
145+
/**
146+
* Lettuce Redis
147+
*/
148+
val DatabaseLettuceRedis = arrayOf(
149+
"database-lettuce-redis",
150+
"basic-configuration",
151+
)
152+
153+
/**
154+
* 玩家数据库
155+
*/
156+
val DatabasePlayer = arrayOf(
157+
"database-player",
158+
*Database
159+
)
160+
161+
/**
162+
* Persistent Container
163+
*/
164+
val DatabasePtc = arrayOf(
165+
"database-ptc",
166+
*Database
167+
)
168+
169+
/**
170+
* Persistent Container With Object
171+
*/
172+
val DatabasePtcObject = arrayOf(
173+
"database-ptc-object",
174+
*Database
175+
)
176+
177+
/**
178+
* Minecraft 文本工具
179+
*/
180+
val MinecraftChat = arrayOf(
181+
"minecraft-chat",
182+
)
183+
184+
/**
185+
* Minecraft 效果工具
186+
*/
187+
val MinecraftEffect = arrayOf(
188+
"minecraft-effect",
189+
)
190+
191+
/**
192+
* 指令帮助
193+
*/
194+
val CommandHelper = arrayOf(
195+
"minecraft-command-helper",
196+
"minecraft-chat",
197+
"minecraft-i18n",
198+
)
199+
200+
/**
201+
* 国际化接口
202+
*/
203+
val I18n = arrayOf(
204+
"minecraft-i18n",
205+
"minecraft-chat",
206+
"basic-configuration",
207+
)
208+
209+
/**
210+
* Kether 脚本引擎
211+
*/
212+
val Kether = arrayOf(
213+
"minecraft-kether",
214+
"minecraft-chat",
215+
"minecraft-i18n",
216+
"bukkit-nms",
217+
"bukkit-nms-stable",
218+
"basic-configuration",
219+
)
220+
221+
/**
222+
* BStats 数据统计
223+
*/
224+
val Metrics = arrayOf(
225+
"minecraft-metrics",
226+
"basic-configuration",
227+
)
228+
229+
/**
230+
* BungeeCord 通讯
231+
*/
232+
val Porticus = arrayOf(
233+
"minecraft-porticus",
234+
"basic-configuration",
235+
)
236+
237+
/**
238+
* Javascript 脚本环境
239+
*/
240+
val Javascript = arrayOf("script-javascript")
241+
242+
/**
243+
* Jexl 脚本环境
244+
*/
245+
val Jexl = arrayOf("script-jexl")
246+
247+
/**
248+
* Afybroker 平台
249+
*/
250+
val AfyBroker = arrayOf("platform-afybroker")
251+
252+
/**
253+
* 独立程序
254+
*/
255+
val App = arrayOf("platform-application")
256+
257+
/**
258+
* Bukkit 平台
259+
*/
260+
val Bukkit = arrayOf("platform-bukkit")
261+
262+
/**
263+
* BungeeCord 平台
264+
*/
265+
val BungeeCord = arrayOf("platform-bungee")
266+
267+
/**
268+
* Velocity 平台
269+
*/
270+
val Velocity = arrayOf("platform-velocity")

0 commit comments

Comments
 (0)