diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c35f319..58c91814 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.6.0] + +### Added +- Kotlin: Support for suspending command functions using `AnnotationParser.installCoroutineSupport()` + +### Changed +- Added `executeFuture` to `CommandExecutionHandler` which is now used internally. By default, this delegates to the old + `execute` method + ## [1.5.0] ### Added diff --git a/cloud-annotations/src/main/java/cloud/commandframework/annotations/AnnotationParser.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/AnnotationParser.java index fff758ea..f5fc40d4 100644 --- a/cloud-annotations/src/main/java/cloud/commandframework/annotations/AnnotationParser.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/AnnotationParser.java @@ -190,6 +190,7 @@ public final class AnnotationParser { * Returns the command manager that was used to create this parser * * @return Command manager + * @since 1.6.0 */ public @NonNull CommandManager manager() { return this.manager; @@ -201,6 +202,7 @@ public final class AnnotationParser { * * @param predicate The predicate that decides whether or not to apply the custom execution handler to the given method * @param function The function that produces the command execution handler + * @since 1.6.0 */ public void registerCommandExecutionMethodFactory( final @NonNull Predicate<@NonNull Method> predicate, diff --git a/cloud-annotations/src/main/java/cloud/commandframework/annotations/MethodCommandExecutionHandler.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/MethodCommandExecutionHandler.java index 84683f2c..d4869f76 100644 --- a/cloud-annotations/src/main/java/cloud/commandframework/annotations/MethodCommandExecutionHandler.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/MethodCommandExecutionHandler.java @@ -44,6 +44,7 @@ import java.util.Optional; * A command execution handler that invokes a method. * * @param Command sender type. + * @since 1.6.0 (Was made public in 1.6.0) */ public class MethodCommandExecutionHandler implements CommandExecutionHandler { diff --git a/cloud-core/src/main/java/cloud/commandframework/CommandManager.java b/cloud-core/src/main/java/cloud/commandframework/CommandManager.java index afd8e576..ae9a4fd0 100644 --- a/cloud-core/src/main/java/cloud/commandframework/CommandManager.java +++ b/cloud-core/src/main/java/cloud/commandframework/CommandManager.java @@ -914,6 +914,7 @@ public abstract class CommandManager { * Returns the command execution coordinator used in this manager * * @return Command execution coordinator + * @since 1.6.0 */ public @NonNull CommandExecutionCoordinator commandExecutionCoordinator() { return this.commandExecutionCoordinator; diff --git a/cloud-core/src/main/java/cloud/commandframework/execution/CommandExecutionHandler.java b/cloud-core/src/main/java/cloud/commandframework/execution/CommandExecutionHandler.java index 04eb4a17..1b1b915a 100644 --- a/cloud-core/src/main/java/cloud/commandframework/execution/CommandExecutionHandler.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/CommandExecutionHandler.java @@ -52,6 +52,7 @@ public interface CommandExecutionHandler { * * @param commandContext Command context * @return future that completes when the command has finished execution + * @since 1.6.0 */ default CompletableFuture<@Nullable Object> executeFuture(@NonNull CommandContext commandContext) { final CompletableFuture future = new CompletableFuture<>(); @@ -83,6 +84,7 @@ public interface CommandExecutionHandler { * by a command sender * * @param Command sender type + * @since 1.6.0 */ @FunctionalInterface interface FutureCommandExecutionHandler extends CommandExecutionHandler { diff --git a/cloud-kotlin-extensions/src/main/kotlin/cloud/commandframework/kotlin/coroutines/KotlinAnnotatedMethods.kt b/cloud-kotlin-extensions/src/main/kotlin/cloud/commandframework/kotlin/coroutines/KotlinAnnotatedMethods.kt index e7f80320..4c123bfe 100644 --- a/cloud-kotlin-extensions/src/main/kotlin/cloud/commandframework/kotlin/coroutines/KotlinAnnotatedMethods.kt +++ b/cloud-kotlin-extensions/src/main/kotlin/cloud/commandframework/kotlin/coroutines/KotlinAnnotatedMethods.kt @@ -14,7 +14,11 @@ import kotlin.reflect.jvm.kotlinFunction import kotlinx.coroutines.* import kotlinx.coroutines.future.asCompletableFuture -/** Adds coroutine support to the [AnnotationParser]. */ +/** + * Adds coroutine support to the [AnnotationParser]. + * + * @since 1.6.0 + */ public fun AnnotationParser.installCoroutineSupport( scope: CoroutineScope = GlobalScope, context: CoroutineContext = EmptyCoroutineContext