build: establish Leaf build and release pipeline
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package games.dmg.leaf;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public final class LeafPlugin extends JavaPlugin {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
getLogger().info("Leaf enabled.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
name: Leaf
|
||||
version: ${version}
|
||||
main: games.dmg.leaf.LeafPlugin
|
||||
api-version: "1.20"
|
||||
description: Voluntary visible Resistance protection for non-aggressive players.
|
||||
author: dmg.games
|
||||
commands:
|
||||
leaf:
|
||||
description: Control or administer Leaf protection.
|
||||
usage: /leaf <on|off|status|enabled|strength|player>
|
||||
permissions:
|
||||
leaf.use:
|
||||
description: Allows a player to control their own Leaf protection.
|
||||
default: true
|
||||
leaf.admin:
|
||||
description: Allows administration of Leaf.
|
||||
default: op
|
||||
@@ -0,0 +1,31 @@
|
||||
package games.dmg.leaf;
|
||||
|
||||
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 PluginMetadataTest {
|
||||
@Test
|
||||
void declaresLeafEntrypointCommandAndPermissions() {
|
||||
InputStream stream = getClass().getClassLoader().getResourceAsStream("plugin.yml");
|
||||
assertNotNull(stream);
|
||||
|
||||
Map<?, ?> plugin = new Yaml().load(stream);
|
||||
assertEquals("Leaf", plugin.get("name"));
|
||||
assertEquals("games.dmg.leaf.LeafPlugin", plugin.get("main"));
|
||||
assertEquals("1.20", plugin.get("api-version"));
|
||||
|
||||
Map<?, ?> commands = (Map<?, ?>) plugin.get("commands");
|
||||
assertNotNull(commands.get("leaf"));
|
||||
|
||||
Map<?, ?> permissions = (Map<?, ?>) plugin.get("permissions");
|
||||
Map<?, ?> usePermission = (Map<?, ?>) permissions.get("leaf.use");
|
||||
assertEquals(true, usePermission.get("default"));
|
||||
Map<?, ?> adminPermission = (Map<?, ?>) permissions.get("leaf.admin");
|
||||
assertEquals("op", adminPermission.get("default"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user