build(project): scaffold plugin delivery
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package games.dmg.spigottyrant;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public final class SpigotTyrantPlugin extends JavaPlugin {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
getLogger().info("Spigot Tyrant enabled.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
name: SpigotTyrant
|
||||
version: ${version}
|
||||
main: games.dmg.spigottyrant.SpigotTyrantPlugin
|
||||
api-version: "1.20"
|
||||
description: Asymmetric Tyrant, Vigilante, Follower, and specialist class gameplay.
|
||||
author: dmg.games
|
||||
@@ -0,0 +1,31 @@
|
||||
package games.dmg.spigottyrant;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
final class PluginMetadataTest {
|
||||
@Test
|
||||
void declaresTyrantPluginMetadata() {
|
||||
InputStream stream = getClass().getClassLoader().getResourceAsStream("plugin.yml");
|
||||
assertNotNull(stream);
|
||||
|
||||
Map<?, ?> plugin = new Yaml().load(stream);
|
||||
assertEquals("SpigotTyrant", plugin.get("name"));
|
||||
assertEquals("games.dmg.spigottyrant.SpigotTyrantPlugin", plugin.get("main"));
|
||||
assertEquals("1.20", plugin.get("api-version"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void declaredEntrypointIsAJavaPlugin() throws ClassNotFoundException {
|
||||
Class<?> entrypoint = Class.forName("games.dmg.spigottyrant.SpigotTyrantPlugin");
|
||||
|
||||
assertTrue(JavaPlugin.class.isAssignableFrom(entrypoint));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user