Skip to content

Commit

Permalink
feat: update to cloud beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Citymonstret committed Jan 25, 2024
1 parent 5ae109b commit 68d04da
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
//
package org.incendo.cloud.spring;

import cloud.commandframework.arguments.suggestion.Suggestion;
import org.apiguardian.api.API;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.incendo.cloud.suggestion.Suggestion;
import org.springframework.shell.CompletionProposal;

@API(status = API.Status.STABLE, since = "1.0.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@
//
package org.incendo.cloud.spring;

import cloud.commandframework.CommandManager;
import cloud.commandframework.arguments.suggestion.SuggestionFactory;
import cloud.commandframework.arguments.suggestion.Suggestions;
import cloud.commandframework.context.CommandInput;
import cloud.commandframework.exceptions.ArgumentParseException;
import cloud.commandframework.exceptions.InvalidCommandSenderException;
import cloud.commandframework.exceptions.InvalidSyntaxException;
import cloud.commandframework.exceptions.NoPermissionException;
import cloud.commandframework.exceptions.NoSuchCommandException;
import cloud.commandframework.execution.ExecutionCoordinator;
import cloud.commandframework.keys.CloudKey;
import cloud.commandframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apiguardian.api.API;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.incendo.cloud.CommandManager;
import org.incendo.cloud.context.CommandInput;
import org.incendo.cloud.exception.ArgumentParseException;
import org.incendo.cloud.exception.InvalidCommandSenderException;
import org.incendo.cloud.exception.InvalidSyntaxException;
import org.incendo.cloud.exception.NoPermissionException;
import org.incendo.cloud.exception.NoSuchCommandException;
import org.incendo.cloud.execution.ExecutionCoordinator;
import org.incendo.cloud.key.CloudKey;
import org.incendo.cloud.spring.event.CommandExecutionEvent;
import org.incendo.cloud.suggestion.SuggestionFactory;
import org.incendo.cloud.suggestion.Suggestions;
import org.incendo.cloud.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
Expand Down Expand Up @@ -143,7 +143,8 @@ private void registerDefaultExceptionHandlers() {
.registerHandler(NoSuchCommandException.class, ctx -> LOGGER.error(MESSAGE_UNKNOWN_COMMAND))
.registerHandler(NoPermissionException.class, ctx -> LOGGER.error(MESSAGE_NO_PERMS))
.registerHandler(InvalidCommandSenderException.class, ctx -> LOGGER.error(ctx.exception().getMessage()))
.registerHandler(InvalidSyntaxException.class,
.registerHandler(
InvalidSyntaxException.class,
ctx -> LOGGER.error(MESSAGE_INVALID_SYNTAX + ctx.exception().correctSyntax()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
//
package org.incendo.cloud.spring;

import cloud.commandframework.Command;
import cloud.commandframework.CommandComponent;
import cloud.commandframework.internal.CommandRegistrationHandler;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.apiguardian.api.API;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.incendo.cloud.Command;
import org.incendo.cloud.component.CommandComponent;
import org.incendo.cloud.internal.CommandRegistrationHandler;
import org.incendo.cloud.spring.event.CommandExecutionEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
//
package org.incendo.cloud.spring;

import cloud.commandframework.annotations.injection.InjectionRequest;
import cloud.commandframework.annotations.injection.InjectionService;
import org.apiguardian.api.API;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.incendo.cloud.injection.InjectionRequest;
import org.incendo.cloud.injection.InjectionService;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Qualifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.springframework.beans.factory.annotation.Qualifier;

/**
* Add this to a bean to make it get auto-parsed by the {@link cloud.commandframework.annotations.AnnotationParser}.
* Add this to a bean to make it get auto-parsed by the {@link org.incendo.cloud.annotations.AnnotationParser}.
*
* @since 1.0.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
//
package org.incendo.cloud.spring.config;

import cloud.commandframework.execution.ExecutionCoordinator;
import org.apiguardian.api.API;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.incendo.cloud.execution.ExecutionCoordinator;
import org.incendo.cloud.spring.CommandSenderMapper;
import org.incendo.cloud.spring.SpringCommandPermissionHandler;
import org.incendo.cloud.spring.SpringCommandSender;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
//
package org.incendo.cloud.spring.event;

import cloud.commandframework.Command;
import cloud.commandframework.execution.CommandResult;
import java.io.Serial;
import org.apiguardian.api.API;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.incendo.cloud.Command;
import org.incendo.cloud.execution.CommandResult;
import org.springframework.context.ApplicationEvent;
import org.springframework.shell.command.CommandContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
//
package org.incendo.cloud.spring.registrar;

import cloud.commandframework.annotations.AnnotationParser;
import java.util.Collection;
import org.apiguardian.api.API;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.incendo.cloud.annotations.AnnotationParser;
import org.incendo.cloud.spring.SpringCommandManager;
import org.incendo.cloud.spring.annotation.ScanCommands;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
//
package org.incendo.cloud.spring.registrar;

import cloud.commandframework.CommandBean;
import java.util.List;
import org.apiguardian.api.API;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.incendo.cloud.bean.CommandBean;
import org.incendo.cloud.spring.SpringCommandManager;
import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
//
package org.incendo.cloud.spring;

import cloud.commandframework.Command;
import cloud.commandframework.CommandBean;
import cloud.commandframework.CommandProperties;
import cloud.commandframework.context.CommandContext;
import cloud.commandframework.context.StandardCommandContextFactory;
import cloud.commandframework.execution.ExecutionCoordinator;
import cloud.commandframework.internal.CommandNode;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.incendo.cloud.Command;
import org.incendo.cloud.bean.CommandBean;
import org.incendo.cloud.bean.CommandProperties;
import org.incendo.cloud.context.CommandContext;
import org.incendo.cloud.context.StandardCommandContextFactory;
import org.incendo.cloud.execution.ExecutionCoordinator;
import org.incendo.cloud.internal.CommandNode;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
//
package org.incendo.cloud.spring;

import cloud.commandframework.Command;
import cloud.commandframework.CommandBean;
import cloud.commandframework.CommandDescription;
import cloud.commandframework.CommandProperties;
import cloud.commandframework.arguments.flags.CommandFlag;
import cloud.commandframework.context.CommandContext;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.incendo.cloud.Command;
import org.incendo.cloud.bean.CommandBean;
import org.incendo.cloud.bean.CommandProperties;
import org.incendo.cloud.context.CommandContext;
import org.incendo.cloud.description.CommandDescription;
import org.incendo.cloud.parser.flag.CommandFlag;
import org.incendo.cloud.spring.config.CloudSpringConfig;
import org.incendo.cloud.spring.registrar.BeanRegistrar;
import org.incendo.cloud.spring.registrar.CommandRegistrationCoordinator;
Expand All @@ -48,10 +48,10 @@
import org.springframework.shell.test.autoconfigure.ShellTest;
import org.springframework.test.context.ContextConfiguration;

import static cloud.commandframework.arguments.standard.IntegerParser.integerParser;
import static cloud.commandframework.arguments.standard.StringParser.stringParser;
import static com.google.common.truth.Truth.assertThat;
import static org.awaitility.Awaitility.await;
import static org.incendo.cloud.parser.standard.IntegerParser.integerParser;
import static org.incendo.cloud.parser.standard.StringParser.stringParser;

@Import(CloudSpringConfig.class)
@ContextConfiguration(classes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
//
package org.incendo.cloud.spring.example;

import cloud.commandframework.annotations.AnnotationParser;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.incendo.cloud.annotations.AnnotationParser;
import org.incendo.cloud.spring.SpringCommandManager;
import org.incendo.cloud.spring.SpringCommandSender;
import org.incendo.cloud.spring.annotation.CommandGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,29 @@
//
package org.incendo.cloud.spring.example.commands;

import cloud.commandframework.Command;
import cloud.commandframework.CommandBean;
import cloud.commandframework.CommandProperties;
import cloud.commandframework.arguments.aggregate.AggregateParser;
import cloud.commandframework.arguments.flags.CommandFlag;
import cloud.commandframework.arguments.parser.ArgumentParseResult;
import cloud.commandframework.arguments.suggestion.SuggestionProvider;
import cloud.commandframework.context.CommandContext;
import cloud.commandframework.meta.CommandMeta;
import java.util.List;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.incendo.cloud.Command;
import org.incendo.cloud.bean.CommandBean;
import org.incendo.cloud.bean.CommandProperties;
import org.incendo.cloud.context.CommandContext;
import org.incendo.cloud.meta.CommandMeta;
import org.incendo.cloud.parser.ArgumentParseResult;
import org.incendo.cloud.parser.aggregate.AggregateParser;
import org.incendo.cloud.parser.flag.CommandFlag;
import org.incendo.cloud.spring.CloudCompletionProposal;
import org.incendo.cloud.spring.SpringCommandManager;
import org.incendo.cloud.spring.SpringCommandSender;
import org.incendo.cloud.spring.example.model.Cat;
import org.incendo.cloud.spring.example.service.CatService;
import org.incendo.cloud.suggestion.SuggestionProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import static cloud.commandframework.CommandDescription.commandDescription;
import static cloud.commandframework.arguments.standard.IntegerParser.integerParser;
import static cloud.commandframework.arguments.standard.StringParser.stringParser;
import static org.incendo.cloud.description.CommandDescription.commandDescription;
import static org.incendo.cloud.parser.standard.IntegerParser.integerParser;
import static org.incendo.cloud.parser.standard.StringParser.stringParser;

@Component
public class AddCatCommand extends CommandBean<SpringCommandSender> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
//
package org.incendo.cloud.spring.example.commands;

import cloud.commandframework.annotations.Command;
import cloud.commandframework.annotations.CommandDescription;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.incendo.cloud.annotations.Command;
import org.incendo.cloud.annotations.CommandDescription;
import org.incendo.cloud.spring.SpringCommandSender;
import org.incendo.cloud.spring.annotation.CommandGroup;
import org.incendo.cloud.spring.annotation.ScanCommands;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@
//
package org.incendo.cloud.spring.example.commands;

import cloud.commandframework.Command;
import cloud.commandframework.CommandBean;
import cloud.commandframework.CommandProperties;
import cloud.commandframework.arguments.suggestion.Suggestion;
import cloud.commandframework.arguments.suggestion.SuggestionProvider;
import cloud.commandframework.context.CommandContext;
import cloud.commandframework.meta.CommandMeta;
import java.util.stream.Collectors;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.incendo.cloud.Command;
import org.incendo.cloud.bean.CommandBean;
import org.incendo.cloud.bean.CommandProperties;
import org.incendo.cloud.context.CommandContext;
import org.incendo.cloud.meta.CommandMeta;
import org.incendo.cloud.spring.SpringCommandManager;
import org.incendo.cloud.spring.SpringCommandSender;
import org.incendo.cloud.spring.example.model.Cat;
import org.incendo.cloud.spring.example.service.CatService;
import org.incendo.cloud.suggestion.Suggestion;
import org.incendo.cloud.suggestion.SuggestionProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import static cloud.commandframework.CommandDescription.commandDescription;
import static cloud.commandframework.arguments.standard.StringParser.stringParser;
import static org.incendo.cloud.description.CommandDescription.commandDescription;
import static org.incendo.cloud.parser.standard.StringParser.stringParser;

@Component
public class RemoveCatCommand extends CommandBean<SpringCommandSender> {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group=cloud.commandframework
group=org.incendo
version=1.0.0-SNAPSHOT
description=cloud-spring

Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ kotlin = "1.9.22"
graal = "0.9.28"

slf4j = "2.0.11"
cloud = "2.0.0-SNAPSHOT"
cloud = "2.0.0-beta.1"

springShellBom = "3.2.1"

Expand All @@ -38,8 +38,8 @@ spring-shell-test = { group = "org.springframework.shell", name = "spring-shell-
spring-shell-test-autoconfiguration = { group = "org.springframework.shell", name = "spring-shell-test-autoconfigure" }

# Cloud
cloud-core = { group = "cloud.commandframework", name = "cloud-core", version.ref = "cloud" }
cloud-annotations = { group = "cloud.commandframework", name = "cloud-annotations", version.ref = "cloud" }
cloud-core = { group = "org.incendo", name = "cloud-core", version.ref = "cloud" }
cloud-annotations = { group = "org.incendo", name = "cloud-annotations", version.ref = "cloud" }

# Test
truth = { group = "com.google.truth", name = "truth", version.ref = "truth" }
Expand Down

0 comments on commit 68d04da

Please sign in to comment.