Skip to content

Commit e3ef67e

Browse files
committed
refactor(lib): Removed libby and simple shaded all libraries.
1 parent 9ba9b1f commit e3ef67e

File tree

12 files changed

+25
-105
lines changed

12 files changed

+25
-105
lines changed

core/pom.xml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,10 @@
6868
<scope>provided</scope>
6969
</dependency>
7070

71-
<dependency>
72-
<groupId>net.byteflux</groupId>
73-
<artifactId>libby-core</artifactId>
74-
<version>${deps.libby.version}</version>
75-
<scope>compile</scope>
76-
</dependency>
77-
7871
<dependency>
7972
<groupId>com.github.chris2018998</groupId>
8073
<artifactId>beecp</artifactId>
81-
<scope>provided</scope>
74+
<scope>compile</scope>
8275
</dependency>
8376

8477
<dependency>
@@ -87,6 +80,24 @@
8780
<scope>compile</scope>
8881
</dependency>
8982

83+
<dependency>
84+
<groupId>org.mariadb.jdbc</groupId>
85+
<artifactId>mariadb-java-client</artifactId>
86+
<scope>compile</scope>
87+
</dependency>
88+
89+
<dependency>
90+
<groupId>com.mysql</groupId>
91+
<artifactId>mysql-connector-j</artifactId>
92+
<scope>compile</scope>
93+
</dependency>
94+
95+
<dependency>
96+
<groupId>com.h2database</groupId>
97+
<artifactId>h2</artifactId>
98+
<scope>compile</scope>
99+
</dependency>
100+
90101
<dependency>
91102
<groupId>cc.carm.lib</groupId>
92103
<artifactId>easyplugin-githubchecker</artifactId>

core/src/main/java/cc/carm/plugin/minesql/MineSQLCore.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
import cc.carm.plugin.minesql.command.MineSQLHelpFormatter;
1515
import cc.carm.plugin.minesql.conf.PluginConfiguration;
1616
import cc.carm.plugin.minesql.conf.SQLSourceGroup;
17-
import cc.carm.plugin.minesql.lib.PluginLibraries;
1817
import cc.carm.plugin.minesql.util.DBPropertiesUtil;
1918
import co.aikar.commands.CommandManager;
2019
import co.aikar.commands.InvalidCommandArgument;
2120
import co.aikar.commands.Locales;
22-
import net.byteflux.libby.Library;
2321
import org.jetbrains.annotations.NotNull;
2422
import org.jetbrains.annotations.Nullable;
2523
import org.stone.beecp.BeeDataSource;
@@ -50,17 +48,6 @@ public MineSQLCore(MineSQLPlatform platform) {
5048
instance = this;
5149
this.platform = platform;
5250

53-
getLogger().info("加载数据库依赖文件...");
54-
getPlatform().getLibraryManager().addMavenLocal();
55-
getPlatform().getLibraryManager().addMavenCentral();
56-
getPlatform().getLibraryManager().addSonatype();
57-
58-
for (PluginLibraries value : PluginLibraries.values()) {
59-
Library lib = value.getLibrary();
60-
getLogger().info(" 加载 " + lib.getArtifactId() + " (" + lib.getVersion() + ") ...");
61-
getPlatform().getLibraryManager().loadLibrary(value.getLibrary());
62-
}
63-
6451
getLogger().info("加载配置文件...");
6552
this.configProvider = EasyConfiguration.from(new File(platform.getPluginFolder(), "config.yml"));
6653
this.config = new PluginConfiguration();

core/src/main/java/cc/carm/plugin/minesql/MineSQLPlatform.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cc.carm.plugin.minesql;
22

33
import co.aikar.commands.CommandManager;
4-
import net.byteflux.libby.LibraryManager;
54
import org.jetbrains.annotations.NotNull;
65
import org.jetbrains.annotations.Nullable;
76

@@ -16,6 +15,4 @@ public interface MineSQLPlatform {
1615

1716
@Nullable CommandManager<?, ?, ?, ?, ?, ?> getCommandManager();
1817

19-
@NotNull LibraryManager getLibraryManager();
20-
2118
}

core/src/main/java/cc/carm/plugin/minesql/lib/PluginLibraries.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cc.carm.plugin.minesql.lib;
22

33
import cc.carm.plugin.minesql.util.VersionReader;
4-
import net.byteflux.libby.Library;
54
import org.jetbrains.annotations.NotNull;
65

76
public enum PluginLibraries {
@@ -21,16 +20,8 @@ public enum PluginLibraries {
2120
this.artifactID = artifactID;
2221
}
2322

24-
public @NotNull Library getLibrary() {
25-
return Library.builder().id(name())
26-
.groupId(this.groupID).artifactId(this.artifactID)
27-
.version(getVersion())
28-
.build();
29-
}
30-
3123
public @NotNull String getVersion() {
3224
return READER.get(name().toLowerCase().replace('_', '-'));
3325
}
3426

35-
3627
}

platforms/bukkit/src/main/java/cc/carm/plugin/minesql/MineSQLBukkit.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ public boolean isDebugging() {
8585
return commandManager;
8686
}
8787

88-
@Override
89-
public @NotNull LibraryManager getLibraryManager() {
90-
return this.libraryManager;
91-
}
92-
9388
@Override
9489
public @NotNull File getPluginFolder() {
9590
return getDataFolder();

platforms/bungee/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@
7272
<scope>provided</scope>
7373
</dependency>
7474

75-
<dependency>
76-
<groupId>net.byteflux</groupId>
77-
<artifactId>libby-bungee</artifactId>
78-
<version>${deps.libby.version}</version>
79-
<scope>compile</scope>
80-
</dependency>
81-
8275
<dependency>
8376
<groupId>org.bstats</groupId>
8477
<artifactId>bstats-bungeecord</artifactId>

platforms/bungee/src/main/java/cc/carm/plugin/minesql/MineSQLBungee.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import cc.carm.plugin.minesql.conf.PluginConfiguration;
66
import co.aikar.commands.BungeeCommandManager;
77
import co.aikar.commands.CommandManager;
8-
import net.byteflux.libby.BungeeLibraryManager;
9-
import net.byteflux.libby.LibraryManager;
108
import net.md_5.bungee.api.ProxyServer;
119
import net.md_5.bungee.api.plugin.Plugin;
1210
import org.bstats.bungeecord.Metrics;
@@ -22,18 +20,13 @@ public class MineSQLBungee extends Plugin implements MineSQLPlatform {
2220

2321
protected static MineSQLBungee instance;
2422

25-
protected BungeeLibraryManager libraryManager;
26-
2723
protected MineSQLCore core;
2824
protected BungeeCommandManager commandManager;
2925

3026
@Override
3127
public void onLoad() {
3228
MineSQLBungee.instance = this;
3329

34-
getLogger().info("加载依赖管理器...");
35-
this.libraryManager = new BungeeLibraryManager(this);
36-
3730
getLogger().info("加载基础核心...");
3831
this.core = new MineSQLCore(this);
3932
}
@@ -99,11 +92,6 @@ public static MineSQLBungee getInstance() {
9992
return this.commandManager;
10093
}
10194

102-
@Override
103-
public @NotNull LibraryManager getLibraryManager() {
104-
return this.libraryManager;
105-
}
106-
10795
@SuppressWarnings("deprecation")
10896
public void outputInfo() {
10997
Optional.ofNullable(JarResourceUtils.readResource(this.getResourceAsStream("PLUGIN_INFO")))

platforms/sponge8/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,6 @@
8484
</exclusions>
8585
</dependency>
8686

87-
<dependency>
88-
<groupId>net.byteflux</groupId>
89-
<artifactId>libby-sponge</artifactId>
90-
<version>${deps.libby.version}</version>
91-
<scope>compile</scope>
92-
</dependency>
93-
9487
<dependency>
9588
<groupId>org.bstats</groupId>
9689
<artifactId>bstats-sponge</artifactId>

platforms/sponge8/src/main/java/cc/carm/plugin/minesql/MineSQLSponge.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import cc.carm.plugin.minesql.conf.PluginConfiguration;
66
import co.aikar.commands.CommandManager;
77
import com.google.inject.Inject;
8-
import net.byteflux.libby.LibraryManager;
9-
import net.byteflux.libby.SpongeLibraryManager;
108
import net.kyori.adventure.text.Component;
119
import org.bstats.charts.SimplePie;
1210
import org.bstats.sponge.Metrics;
@@ -43,17 +41,13 @@ public class MineSQLSponge implements MineSQLPlatform {
4341
private final PluginContainer pluginContainer;
4442
private final Metrics.Factory metricsFactory;
4543

46-
protected final SpongeLibraryManager<MineSQLSponge> libraryManager;
4744
protected final MineSQLCore core;
4845
// protected SpongeCommandManager commandManager;
4946

5047
@Inject
51-
public MineSQLSponge(Metrics.Factory factory,
52-
PluginContainer pluginContainer,
53-
SpongeLibraryManager<MineSQLSponge> libraryManager) {
48+
public MineSQLSponge(Metrics.Factory factory, PluginContainer pluginContainer) {
5449
this.pluginContainer = pluginContainer;
5550
this.metricsFactory = factory;
56-
this.libraryManager = libraryManager;
5751

5852
getLogger().info("加载基础核心...");
5953
this.core = new MineSQLCore(this);
@@ -115,11 +109,6 @@ public void disable(StoppingEngineEvent<Server> e) {
115109
return null;
116110
}
117111

118-
@Override
119-
public @NotNull LibraryManager getLibraryManager() {
120-
return this.libraryManager;
121-
}
122-
123112
public String getVersion() {
124113
return pluginContainer.metadata().version().toString();
125114
}

platforms/velocity/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@
8282
<scope>compile</scope>
8383
</dependency>
8484

85-
<dependency>
86-
<groupId>net.byteflux</groupId>
87-
<artifactId>libby-velocity</artifactId>
88-
<version>${deps.libby.version}</version>
89-
<scope>compile</scope>
90-
</dependency>
91-
9285
<dependency>
9386
<groupId>org.bstats</groupId>
9487
<artifactId>bstats-velocity</artifactId>

0 commit comments

Comments
 (0)