-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle merge commands classes, improve builder API and 2.3.3 Release
- Loading branch information
Showing
15 changed files
with
106 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
litecommands-core/src/main/java/dev/rollczi/litecommands/LiteCommandsPostProcess.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package dev.rollczi.litecommands; | ||
|
||
import dev.rollczi.litecommands.command.CommandService; | ||
import dev.rollczi.litecommands.injector.Injector; | ||
import dev.rollczi.litecommands.platform.RegistryPlatform; | ||
|
||
public interface LiteCommandsPostProcess<SENDER> { | ||
|
||
void process(LiteCommandsBuilder<SENDER> builder, RegistryPlatform<SENDER> platform, Injector<SENDER> injector, CommandService<SENDER> commandService); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...s-core/src/test/java/dev/rollczi/litecommands/implementation/MergeCommandClassesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package dev.rollczi.litecommands.implementation; | ||
|
||
import dev.rollczi.litecommands.TestFactory; | ||
import dev.rollczi.litecommands.TestPlatform; | ||
import dev.rollczi.litecommands.argument.Arg; | ||
import dev.rollczi.litecommands.command.execute.Execute; | ||
import dev.rollczi.litecommands.command.section.Section; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class MergeCommandClassesTest { | ||
|
||
TestPlatform platform = TestFactory.withCommands(FirstCommandClass.class, SecondCommandClass.class); | ||
|
||
@Section(route = "test") | ||
static class FirstCommandClass { | ||
@Execute(route = "set") public static String set(@Arg String name, @Arg String value) { | ||
return name + " -> " + value; | ||
} | ||
} | ||
|
||
@Section(route = "test") | ||
static class SecondCommandClass { | ||
@Execute(route = "unset") public static String get(@Arg String name) { | ||
return name + " value"; | ||
} | ||
} | ||
|
||
@Test | ||
void test() { | ||
platform.execute("test", "unset", "Rollczi").assertResult("Rollczi value"); | ||
platform.execute("test", "set", "Rollczi", "vip").assertResult("Rollczi -> vip"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters