Disable test by default, config desc.

#79
Fixed IntelliJ compiler version...
This commit is contained in:
Norbi Peti 2019-11-16 01:01:52 +01:00
parent dea1a46f55
commit 34637ac536
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
7 changed files with 32 additions and 33 deletions

View file

@ -9,28 +9,16 @@
<outputRelativeToContentRoot value="true" /> <outputRelativeToContentRoot value="true" />
<processorPath useClasspath="false"> <processorPath useClasspath="false">
<entry name="$PROJECT_DIR$/ButtonProcessor/target/classes" /> <entry name="$PROJECT_DIR$/ButtonProcessor/target/classes" />
<entry name="$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.12.2-R0.1-SNAPSHOT/spigot-api-1.12.2-R0.1-20180712.012057-156.jar" /> <entry name="$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.21/snakeyaml-1.21.jar" />
<entry name="$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.12.2-R0.1-SNAPSHOT/spigot-api-1.12.2-R0.1-SNAPSHOT.jar" />
<entry name="$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" /> <entry name="$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" />
<entry name="$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar" /> <entry name="$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar" />
<entry name="$MAVEN_REPOSITORY$/com/google/guava/guava/21.0/guava-21.0.jar" />
<entry name="$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar" /> <entry name="$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar" />
<entry name="$MAVEN_REPOSITORY$/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-20180712.114550-97.jar" /> <entry name="$MAVEN_REPOSITORY$/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-20180712.114550-97.jar" />
</processorPath> </processorPath>
<module name="BuildConfigUpdater" /> <module name="BuildConfigUpdater" />
</profile> </profile>
<profile name="Annotation profile for ButtonProcessor" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<processorPath useClasspath="false">
<entry name="$PROJECT_DIR$/ButtonProcessor/target/classes" />
<entry name="$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.12.2-R0.1-SNAPSHOT/spigot-api-1.12.2-R0.1-20180712.012057-156.jar" />
<entry name="$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" />
<entry name="$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar" />
<entry name="$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar" />
<entry name="$MAVEN_REPOSITORY$/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-20180712.114550-97.jar" />
</processorPath>
<module name="ButtonProcessor" />
</profile>
<profile name="Annotation profile for ButtonCore Parent" enabled="true"> <profile name="Annotation profile for ButtonCore Parent" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" /> <sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
@ -44,9 +32,11 @@
<entry name="$MAVEN_REPOSITORY$/net/bytebuddy/byte-buddy-agent/1.10.1/byte-buddy-agent-1.10.1.jar" /> <entry name="$MAVEN_REPOSITORY$/net/bytebuddy/byte-buddy-agent/1.10.1/byte-buddy-agent-1.10.1.jar" />
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.10/lombok-1.18.10.jar" /> <entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.10/lombok-1.18.10.jar" />
<entry name="$PROJECT_DIR$/ButtonProcessor/target/classes" /> <entry name="$PROJECT_DIR$/ButtonProcessor/target/classes" />
<entry name="$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.12.2-R0.1-SNAPSHOT/spigot-api-1.12.2-R0.1-20180712.012057-156.jar" /> <entry name="$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.21/snakeyaml-1.21.jar" />
<entry name="$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.12.2-R0.1-SNAPSHOT/spigot-api-1.12.2-R0.1-SNAPSHOT.jar" />
<entry name="$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" /> <entry name="$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" />
<entry name="$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar" /> <entry name="$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar" />
<entry name="$MAVEN_REPOSITORY$/com/google/guava/guava/21.0/guava-21.0.jar" />
<entry name="$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar" /> <entry name="$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar" />
<entry name="$MAVEN_REPOSITORY$/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-20180712.114550-97.jar" /> <entry name="$MAVEN_REPOSITORY$/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-20180712.114550-97.jar" />
</processorPath> </processorPath>
@ -54,19 +44,19 @@
</profile> </profile>
</annotationProcessing> </annotationProcessing>
<bytecodeTargetLevel> <bytecodeTargetLevel>
<module name="BuildConfigUpdater" target="1.5" /> <module name="BuildConfigUpdater" target="8" />
<module name="ButtonCore" target="1.5" /> <module name="ButtonCore" target="1.5" />
<module name="ButtonCore (1) (com.github.TBMCPlugins.ButtonCore)" target="13" /> <module name="ButtonCore (1) (com.github.TBMCPlugins.ButtonCore)" target="11" />
<module name="ButtonProcessor" target="1.5" /> <module name="ButtonProcessor" target="8" />
<module name="ChunkArchive" target="1.8" /> <module name="ChunkArchive" target="1.8" />
<module name="CorePOM" target="13" /> <module name="CorePOM" target="11" />
<module name="RandomTeleport" target="1.8" /> <module name="RandomTeleport" target="1.8" />
</bytecodeTargetLevel> </bytecodeTargetLevel>
</component> </component>
<component name="JavacSettings"> <component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE"> <option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="BuildConfigUpdater" options="" /> <module name="BuildConfigUpdater" options="" />
<module name="ButtonCore (1) (com.github.TBMCPlugins.ButtonCore)" options="--enable-preview" /> <module name="ButtonCore (1) (com.github.TBMCPlugins.ButtonCore)" options="" />
<module name="ButtonProcessor" options="-proc:none" /> <module name="ButtonProcessor" options="-proc:none" />
</option> </option>
</component> </component>

View file

@ -18,8 +18,6 @@
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="ButtonCore (1) (com.github.TBMCPlugins.ButtonCore)" /> <orderEntry type="module" module-name="ButtonCore (1) (com.github.TBMCPlugins.ButtonCore)" />
<orderEntry type="module" module-name="ButtonCore (1) (com.github.TBMCPlugins.ButtonCore)" />
<orderEntry type="module" module-name="ButtonCore (1) (com.github.TBMCPlugins.ButtonCore)" />
<orderEntry type="library" name="Maven: org.reflections:reflections:0.9.10" level="project" /> <orderEntry type="library" name="Maven: org.reflections:reflections:0.9.10" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:annotations:2.0.1" level="project" /> <orderEntry type="library" name="Maven: com.google.code.findbugs:annotations:2.0.1" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.20.0-GA" level="project" /> <orderEntry type="library" name="Maven: org.javassist:javassist:3.20.0-GA" level="project" />

View file

@ -23,7 +23,10 @@ public class ComponentCommand extends ICommand2MC {
getManager().addParamConverter(Plugin.class, arg -> Bukkit.getPluginManager().getPlugin(arg), "Plugin not found!"); getManager().addParamConverter(Plugin.class, arg -> Bukkit.getPluginManager().getPlugin(arg), "Plugin not found!");
} }
@Subcommand @Subcommand(helpText = {
"Enable component",
"Temporarily enables a component. If you want to permanently enable a component, change it's 'enabled' config option.\""
})
public boolean enable(CommandSender sender, Plugin plugin, String component) { public boolean enable(CommandSender sender, Plugin plugin, String component) {
if (plugin instanceof ButtonPlugin) if (plugin instanceof ButtonPlugin)
((ButtonPlugin) plugin).justReload(); ((ButtonPlugin) plugin).justReload();
@ -32,12 +35,18 @@ public class ComponentCommand extends ICommand2MC {
return enable_disable(sender, plugin, component, true); return enable_disable(sender, plugin, component, true);
} }
@Subcommand @Subcommand(helpText = {
"Disable component",
"Temporarily disables a component. If you want to permanently disable a component, change it's 'enabled' config option."
})
public boolean disable(CommandSender sender, Plugin plugin, String component) { public boolean disable(CommandSender sender, Plugin plugin, String component) {
return enable_disable(sender, plugin, component, false); return enable_disable(sender, plugin, component, false);
} }
@Subcommand @Subcommand(helpText = {
"List components",
"Lists all of the registered Chroma components"
})
public boolean list(CommandSender sender, @Command2.OptionalArg String plugin) { public boolean list(CommandSender sender, @Command2.OptionalArg String plugin) {
sender.sendMessage("§6List of components:"); sender.sendMessage("§6List of components:");
Component.getComponents().values().stream().filter(c -> plugin == null || c.getPlugin().getName().equalsIgnoreCase(plugin)) //If plugin is null, don't check Component.getComponents().values().stream().filter(c -> plugin == null || c.getPlugin().getName().equalsIgnoreCase(plugin)) //If plugin is null, don't check

View file

@ -71,7 +71,7 @@ public class MainPlugin extends ButtonPlugin {
} }
public ConfigData<Boolean> test() { public ConfigData<Boolean> test() {
return getIConfig().getData("test", true); return getIConfig().getData("test", false);
} }
@Override @Override

View file

@ -247,7 +247,7 @@ public abstract class Command2<TC extends ICommand2, TP extends Command2Sender>
public abstract void registerCommand(TC command); public abstract void registerCommand(TC command);
protected void registerCommand(TC command, char commandChar) { protected void registerCommand(TC command, @SuppressWarnings("SameParameterValue") char commandChar) {
val path = command.getCommandPath(); val path = command.getCommandPath();
int x = path.indexOf(' '); int x = path.indexOf(' ');
val mainPath = commandChar + path.substring(0, x == -1 ? path.length() : x); val mainPath = commandChar + path.substring(0, x == -1 ? path.length() : x);
@ -277,7 +277,7 @@ public abstract class Command2<TC extends ICommand2, TP extends Command2Sender>
if (ht != null) { if (ht != null) {
val subcommand = commandChar + path + //Add command path (class name by default) val subcommand = commandChar + path + //Add command path (class name by default)
(method.getName().equals("def") ? "" : " " + method.getName().replace('_', ' ').toLowerCase()); //Add method name, unless it's 'def' (method.getName().equals("def") ? "" : " " + method.getName().replace('_', ' ').toLowerCase()); //Add method name, unless it's 'def'
ht = getHelpText(method, ht, subcommand); ht = getParameterHelp(method, ht, subcommand);
subcommands.put(subcommand, new SubcommandData<>(method, command, ht)); //Result of the above (def) is that it will show the help text subcommands.put(subcommand, new SubcommandData<>(method, command, ht)); //Result of the above (def) is that it will show the help text
scmdHelpList.add(subcommand); scmdHelpList.add(subcommand);
nosubs = false; nosubs = false;
@ -299,7 +299,7 @@ public abstract class Command2<TC extends ICommand2, TP extends Command2Sender>
} }
} }
private String[] getHelpText(Method method, String[] ht, String subcommand) { private String[] getParameterHelp(Method method, String[] ht, String subcommand) {
val str = method.getDeclaringClass().getResourceAsStream("/commands.yml"); val str = method.getDeclaringClass().getResourceAsStream("/commands.yml");
if (str == null) if (str == null)
TBMCCoreAPI.SendException("Error while getting command data!", new Exception("Resource not found!")); TBMCCoreAPI.SendException("Error while getting command data!", new Exception("Resource not found!"));

View file

@ -5,7 +5,7 @@
<module name="ButtonProcessor" /> <module name="ButtonProcessor" />
</modules> </modules>
</component> </component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_13_PREVIEW"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_11">
<output url="file://$MODULE_DIR$/target/classes" /> <output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" /> <output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">

View file

@ -95,10 +95,12 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<release>13</release> <release>11</release>
<!--
<compilerArgs> <compilerArgs>
<arg>--enable-preview</arg> <arg>HYPHENHYPHENenable-preview</arg>
</compilerArgs> </compilerArgs>
-->
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>