feat(build): establish plugin foundation
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package games.dmg.spigotinventoryhelper;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public final class SpigotInventoryHelperPlugin extends JavaPlugin {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
getLogger().info("Spigot Inventory Helper enabled.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
name: SpigotInventoryHelper
|
||||
version: ${version}
|
||||
main: games.dmg.spigotinventoryhelper.SpigotInventoryHelperPlugin
|
||||
api-version: "1.20"
|
||||
description: Inventory sorting and automatic tool replacement utilities.
|
||||
author: dmg.games
|
||||
@@ -0,0 +1,26 @@
|
||||
package games.dmg.spigotinventoryhelper;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
final class PluginFoundationTest {
|
||||
@Test
|
||||
void declaresPluginMetadataAndLoadableEntrypoint() throws ClassNotFoundException {
|
||||
InputStream stream = getClass().getClassLoader().getResourceAsStream("plugin.yml");
|
||||
assertNotNull(stream);
|
||||
|
||||
Map<?, ?> plugin = new Yaml().load(stream);
|
||||
assertEquals("SpigotInventoryHelper", plugin.get("name"));
|
||||
assertEquals(
|
||||
"games.dmg.spigotinventoryhelper.SpigotInventoryHelperPlugin",
|
||||
plugin.get("main")
|
||||
);
|
||||
assertEquals("1.20", plugin.get("api-version"));
|
||||
assertNotNull(Class.forName((String) plugin.get("main")));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user