Commit 70cb8cfe authored by Phillip Webb's avatar Phillip Webb

Fix CLI package and class tangles

parent 15527595
...@@ -14,12 +14,14 @@ ...@@ -14,12 +14,14 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli.command; package org.springframework.boot.cli;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.CommandFactory;
import org.springframework.boot.cli.command.core.VersionCommand; import org.springframework.boot.cli.command.core.VersionCommand;
import org.springframework.boot.cli.command.grab.GrabCommand; import org.springframework.boot.cli.command.grab.GrabCommand;
import org.springframework.boot.cli.command.jar.JarCommand; import org.springframework.boot.cli.command.jar.JarCommand;
......
...@@ -19,7 +19,9 @@ package org.springframework.boot.cli; ...@@ -19,7 +19,9 @@ package org.springframework.boot.cli;
import java.util.ServiceLoader; import java.util.ServiceLoader;
import org.springframework.boot.cli.command.CommandFactory; import org.springframework.boot.cli.command.CommandFactory;
import org.springframework.boot.cli.command.CommandRunner;
import org.springframework.boot.cli.command.core.HelpCommand; import org.springframework.boot.cli.command.core.HelpCommand;
import org.springframework.boot.cli.command.core.HintCommand;
import org.springframework.boot.cli.command.core.VersionCommand; import org.springframework.boot.cli.command.core.VersionCommand;
import org.springframework.boot.cli.command.shell.ShellCommand; import org.springframework.boot.cli.command.shell.ShellCommand;
...@@ -37,10 +39,10 @@ public class SpringCli { ...@@ -37,10 +39,10 @@ public class SpringCli {
System.setProperty("java.awt.headless", Boolean.toString(true)); System.setProperty("java.awt.headless", Boolean.toString(true));
CommandRunner runner = new CommandRunner("spring"); CommandRunner runner = new CommandRunner("spring");
runner.addHelpCommand(); runner.addCommand(new HelpCommand(runner));
addServiceLoaderCommands(runner); addServiceLoaderCommands(runner);
runner.addCommand(new ShellCommand()); runner.addCommand(new ShellCommand());
runner.addHintCommand(); runner.addCommand(new HintCommand(runner));
runner.setOptionCommands(HelpCommand.class, VersionCommand.class); runner.setOptionCommands(HelpCommand.class, VersionCommand.class);
int exitCode = runner.runAndHandleErrors(args); int exitCode = runner.runAndHandleErrors(args);
......
...@@ -19,6 +19,8 @@ package org.springframework.boot.cli.command; ...@@ -19,6 +19,8 @@ package org.springframework.boot.cli.command;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import org.springframework.boot.cli.command.options.OptionHelp;
/** /**
* Abstract {@link Command} implementation. * Abstract {@link Command} implementation.
* *
......
...@@ -18,6 +18,8 @@ package org.springframework.boot.cli.command; ...@@ -18,6 +18,8 @@ package org.springframework.boot.cli.command;
import java.util.Collection; import java.util.Collection;
import org.springframework.boot.cli.command.options.OptionHelp;
/** /**
* A single command that can be run from the CLI. * A single command that can be run from the CLI.
* *
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli; package org.springframework.boot.cli.command;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli; package org.springframework.boot.cli.command;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -24,9 +24,7 @@ import java.util.Iterator; ...@@ -24,9 +24,7 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.springframework.boot.cli.command.Command; import org.springframework.boot.cli.util.Log;
import org.springframework.boot.cli.command.core.HelpCommand;
import org.springframework.boot.cli.command.core.HintCommand;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
...@@ -64,20 +62,6 @@ public class CommandRunner implements Iterable<Command> { ...@@ -64,20 +62,6 @@ public class CommandRunner implements Iterable<Command> {
return this.name; return this.name;
} }
/**
* Add 'help' support.
*/
public void addHelpCommand() {
this.commands.add(new HelpCommand(this));
}
/**
* Add 'hint' support for command line completion.
*/
public void addHintCommand() {
this.commands.add(new HintCommand(this));
}
/** /**
* Add the specified commands. * Add the specified commands.
* @param commands the commands to add * @param commands the commands to add
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli; package org.springframework.boot.cli.command;
/** /**
* Exception used to indicate that no arguemnts were specified. * Exception used to indicate that no arguemnts were specified.
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli; package org.springframework.boot.cli.command;
/** /**
* Exception used to when the help command is called without arguments. * Exception used to when the help command is called without arguments.
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli; package org.springframework.boot.cli.command;
/** /**
* Exception used when a command is not found. * Exception used when a command is not found.
......
...@@ -18,6 +18,9 @@ package org.springframework.boot.cli.command; ...@@ -18,6 +18,9 @@ package org.springframework.boot.cli.command;
import java.util.Collection; import java.util.Collection;
import org.springframework.boot.cli.command.options.OptionHandler;
import org.springframework.boot.cli.command.options.OptionHelp;
/** /**
* Base class for a {@link Command} that parse options using an {@link OptionHandler}. * Base class for a {@link Command} that parse options using an {@link OptionHandler}.
* *
......
...@@ -22,13 +22,13 @@ import java.util.Collections; ...@@ -22,13 +22,13 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.springframework.boot.cli.CommandRunner;
import org.springframework.boot.cli.Log;
import org.springframework.boot.cli.NoHelpCommandArgumentsException;
import org.springframework.boot.cli.NoSuchCommandException;
import org.springframework.boot.cli.command.AbstractCommand; import org.springframework.boot.cli.command.AbstractCommand;
import org.springframework.boot.cli.command.Command; import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.OptionHelp; import org.springframework.boot.cli.command.CommandRunner;
import org.springframework.boot.cli.command.NoHelpCommandArgumentsException;
import org.springframework.boot.cli.command.NoSuchCommandException;
import org.springframework.boot.cli.command.options.OptionHelp;
import org.springframework.boot.cli.util.Log;
/** /**
* Internal {@link Command} used for 'help' requests. * Internal {@link Command} used for 'help' requests.
......
...@@ -20,11 +20,11 @@ import java.util.ArrayList; ...@@ -20,11 +20,11 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import org.springframework.boot.cli.CommandRunner;
import org.springframework.boot.cli.Log;
import org.springframework.boot.cli.command.AbstractCommand; import org.springframework.boot.cli.command.AbstractCommand;
import org.springframework.boot.cli.command.Command; import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.OptionHelp; import org.springframework.boot.cli.command.CommandRunner;
import org.springframework.boot.cli.command.options.OptionHelp;
import org.springframework.boot.cli.util.Log;
/** /**
* Internal {@link Command} to provide hints for shell auto-completion. Expects to be * Internal {@link Command} to provide hints for shell auto-completion. Expects to be
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
package org.springframework.boot.cli.command.core; package org.springframework.boot.cli.command.core;
import org.springframework.boot.cli.Log;
import org.springframework.boot.cli.command.AbstractCommand; import org.springframework.boot.cli.command.AbstractCommand;
import org.springframework.boot.cli.command.Command; import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.util.Log;
/** /**
* {@link Command} to display the 'version' number. * {@link Command} to display the 'version' number.
......
...@@ -21,12 +21,12 @@ import java.util.List; ...@@ -21,12 +21,12 @@ import java.util.List;
import joptsimple.OptionSet; import joptsimple.OptionSet;
import org.springframework.boot.cli.command.Command; import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.CompilerOptionHandler;
import org.springframework.boot.cli.command.OptionParsingCommand; import org.springframework.boot.cli.command.OptionParsingCommand;
import org.springframework.boot.cli.command.SourceOptions; import org.springframework.boot.cli.command.options.CompilerOptionHandler;
import org.springframework.boot.cli.command.options.OptionSetGroovyCompilerConfiguration;
import org.springframework.boot.cli.command.options.SourceOptions;
import org.springframework.boot.cli.compiler.GroovyCompiler; import org.springframework.boot.cli.compiler.GroovyCompiler;
import org.springframework.boot.cli.compiler.GroovyCompilerConfiguration; import org.springframework.boot.cli.compiler.GroovyCompilerConfiguration;
import org.springframework.boot.cli.compiler.GroovyCompilerConfigurationAdapter;
import org.springframework.boot.cli.compiler.RepositoryConfigurationFactory; import org.springframework.boot.cli.compiler.RepositoryConfigurationFactory;
import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration; import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration;
...@@ -51,7 +51,7 @@ public class GrabCommand extends OptionParsingCommand { ...@@ -51,7 +51,7 @@ public class GrabCommand extends OptionParsingCommand {
List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
.createDefaultRepositoryConfiguration(); .createDefaultRepositoryConfiguration();
GroovyCompilerConfiguration configuration = new GroovyCompilerConfigurationAdapter( GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
options, this, repositoryConfiguration); options, this, repositoryConfiguration);
if (System.getProperty("grape.root") == null) { if (System.getProperty("grape.root") == null) {
......
...@@ -42,13 +42,13 @@ import org.codehaus.groovy.ast.expr.ConstantExpression; ...@@ -42,13 +42,13 @@ import org.codehaus.groovy.ast.expr.ConstantExpression;
import org.codehaus.groovy.control.SourceUnit; import org.codehaus.groovy.control.SourceUnit;
import org.codehaus.groovy.transform.ASTTransformation; import org.codehaus.groovy.transform.ASTTransformation;
import org.springframework.boot.cli.command.Command; import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.CompilerOptionHandler;
import org.springframework.boot.cli.command.OptionParsingCommand; import org.springframework.boot.cli.command.OptionParsingCommand;
import org.springframework.boot.cli.command.SourceOptions;
import org.springframework.boot.cli.command.jar.ResourceMatcher.MatchedResource; import org.springframework.boot.cli.command.jar.ResourceMatcher.MatchedResource;
import org.springframework.boot.cli.command.options.CompilerOptionHandler;
import org.springframework.boot.cli.command.options.OptionSetGroovyCompilerConfiguration;
import org.springframework.boot.cli.command.options.SourceOptions;
import org.springframework.boot.cli.compiler.GroovyCompiler; import org.springframework.boot.cli.compiler.GroovyCompiler;
import org.springframework.boot.cli.compiler.GroovyCompilerConfiguration; import org.springframework.boot.cli.compiler.GroovyCompilerConfiguration;
import org.springframework.boot.cli.compiler.GroovyCompilerConfigurationAdapter;
import org.springframework.boot.cli.compiler.RepositoryConfigurationFactory; import org.springframework.boot.cli.compiler.RepositoryConfigurationFactory;
import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration; import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration;
import org.springframework.boot.cli.jar.PackagedSpringApplicationLauncher; import org.springframework.boot.cli.jar.PackagedSpringApplicationLauncher;
...@@ -137,7 +137,7 @@ public class JarCommand extends OptionParsingCommand { ...@@ -137,7 +137,7 @@ public class JarCommand extends OptionParsingCommand {
private GroovyCompiler createCompiler(OptionSet options) { private GroovyCompiler createCompiler(OptionSet options) {
List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
.createDefaultRepositoryConfiguration(); .createDefaultRepositoryConfiguration();
GroovyCompilerConfiguration configuration = new GroovyCompilerConfigurationAdapter( GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
options, this, repositoryConfiguration); options, this, repositoryConfiguration);
GroovyCompiler groovyCompiler = new GroovyCompiler(configuration); GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
groovyCompiler.getAstTransformations().add(0, new GrabAnnotationTransform()); groovyCompiler.getAstTransformations().add(0, new GrabAnnotationTransform());
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli.command; package org.springframework.boot.cli.command.options;
import joptsimple.OptionSpec; import joptsimple.OptionSpec;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli.command; package org.springframework.boot.cli.command.options;
import groovy.lang.Closure; import groovy.lang.Closure;
...@@ -31,6 +31,8 @@ import java.util.Map; ...@@ -31,6 +31,8 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
import org.springframework.boot.cli.command.OptionParsingCommand;
import joptsimple.BuiltinHelpFormatter; import joptsimple.BuiltinHelpFormatter;
import joptsimple.HelpFormatter; import joptsimple.HelpFormatter;
import joptsimple.OptionDescriptor; import joptsimple.OptionDescriptor;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli.command; package org.springframework.boot.cli.command.options;
import java.util.Set; import java.util.Set;
......
...@@ -14,14 +14,16 @@ ...@@ -14,14 +14,16 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli.compiler; package org.springframework.boot.cli.command.options;
import java.util.List; import java.util.List;
import joptsimple.OptionSet; import joptsimple.OptionSet;
import joptsimple.OptionSpec; import joptsimple.OptionSpec;
import org.springframework.boot.cli.command.CompilerOptionHandler; import org.springframework.boot.cli.compiler.GroovyCompilerConfiguration;
import org.springframework.boot.cli.compiler.GroovyCompilerScope;
import org.springframework.boot.cli.compiler.RepositoryConfigurationFactory;
import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration; import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration;
/** /**
...@@ -30,7 +32,7 @@ import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration; ...@@ -30,7 +32,7 @@ import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class GroovyCompilerConfigurationAdapter implements GroovyCompilerConfiguration { public class OptionSetGroovyCompilerConfiguration implements GroovyCompilerConfiguration {
private final OptionSet options; private final OptionSet options;
...@@ -38,13 +40,13 @@ public class GroovyCompilerConfigurationAdapter implements GroovyCompilerConfigu ...@@ -38,13 +40,13 @@ public class GroovyCompilerConfigurationAdapter implements GroovyCompilerConfigu
private final List<RepositoryConfiguration> repositoryConfiguration; private final List<RepositoryConfiguration> repositoryConfiguration;
protected GroovyCompilerConfigurationAdapter(OptionSet optionSet, protected OptionSetGroovyCompilerConfiguration(OptionSet optionSet,
CompilerOptionHandler compilerOptionHandler) { CompilerOptionHandler compilerOptionHandler) {
this(optionSet, compilerOptionHandler, RepositoryConfigurationFactory this(optionSet, compilerOptionHandler, RepositoryConfigurationFactory
.createDefaultRepositoryConfiguration()); .createDefaultRepositoryConfiguration());
} }
public GroovyCompilerConfigurationAdapter(OptionSet optionSet, public OptionSetGroovyCompilerConfiguration(OptionSet optionSet,
CompilerOptionHandler compilerOptionHandler, CompilerOptionHandler compilerOptionHandler,
List<RepositoryConfiguration> repositoryConfiguration) { List<RepositoryConfiguration> repositoryConfiguration) {
this.options = optionSet; this.options = optionSet;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli.command; package org.springframework.boot.cli.command.options;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
......
...@@ -25,10 +25,10 @@ import joptsimple.OptionSet; ...@@ -25,10 +25,10 @@ import joptsimple.OptionSet;
import joptsimple.OptionSpec; import joptsimple.OptionSpec;
import org.springframework.boot.cli.command.Command; import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.CompilerOptionHandler;
import org.springframework.boot.cli.command.OptionParsingCommand; import org.springframework.boot.cli.command.OptionParsingCommand;
import org.springframework.boot.cli.command.SourceOptions; import org.springframework.boot.cli.command.options.CompilerOptionHandler;
import org.springframework.boot.cli.compiler.GroovyCompilerConfigurationAdapter; import org.springframework.boot.cli.command.options.OptionSetGroovyCompilerConfiguration;
import org.springframework.boot.cli.command.options.SourceOptions;
import org.springframework.boot.cli.compiler.GroovyCompilerScope; import org.springframework.boot.cli.compiler.GroovyCompilerScope;
import org.springframework.boot.cli.compiler.RepositoryConfigurationFactory; import org.springframework.boot.cli.compiler.RepositoryConfigurationFactory;
import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration; import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration;
...@@ -121,7 +121,7 @@ public class RunCommand extends OptionParsingCommand { ...@@ -121,7 +121,7 @@ public class RunCommand extends OptionParsingCommand {
* {@link SpringApplicationRunnerConfiguration}. * {@link SpringApplicationRunnerConfiguration}.
*/ */
private class SpringApplicationRunnerConfigurationAdapter extends private class SpringApplicationRunnerConfigurationAdapter extends
GroovyCompilerConfigurationAdapter implements OptionSetGroovyCompilerConfiguration implements
SpringApplicationRunnerConfiguration { SpringApplicationRunnerConfiguration {
public SpringApplicationRunnerConfigurationAdapter(OptionSet options, public SpringApplicationRunnerConfigurationAdapter(OptionSet options,
......
...@@ -30,9 +30,9 @@ import jline.console.completer.Completer; ...@@ -30,9 +30,9 @@ import jline.console.completer.Completer;
import jline.console.completer.FileNameCompleter; import jline.console.completer.FileNameCompleter;
import jline.console.completer.StringsCompleter; import jline.console.completer.StringsCompleter;
import org.springframework.boot.cli.Log;
import org.springframework.boot.cli.command.Command; import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.OptionHelp; import org.springframework.boot.cli.command.options.OptionHelp;
import org.springframework.boot.cli.util.Log;
/** /**
* JLine {@link Completer} for Spring Boot {@link Command}s. * JLine {@link Completer} for Spring Boot {@link Command}s.
......
...@@ -22,7 +22,7 @@ import java.util.Collection; ...@@ -22,7 +22,7 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import org.springframework.boot.cli.command.Command; import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.OptionHelp; import org.springframework.boot.cli.command.options.OptionHelp;
import org.springframework.boot.cli.util.JavaExecutable; import org.springframework.boot.cli.util.JavaExecutable;
/** /**
......
...@@ -31,9 +31,10 @@ import jline.console.ConsoleReader; ...@@ -31,9 +31,10 @@ import jline.console.ConsoleReader;
import jline.console.completer.CandidateListCompletionHandler; import jline.console.completer.CandidateListCompletionHandler;
import org.fusesource.jansi.AnsiRenderer.Code; import org.fusesource.jansi.AnsiRenderer.Code;
import org.springframework.boot.cli.CommandRunner;
import org.springframework.boot.cli.command.Command; import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.CommandFactory; import org.springframework.boot.cli.command.CommandFactory;
import org.springframework.boot.cli.command.CommandRunner;
import org.springframework.boot.cli.command.core.HelpCommand;
import org.springframework.boot.cli.command.core.VersionCommand; import org.springframework.boot.cli.command.core.VersionCommand;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
...@@ -83,7 +84,7 @@ public class Shell { ...@@ -83,7 +84,7 @@ public class Shell {
private ShellCommandRunner createCommandRunner() { private ShellCommandRunner createCommandRunner() {
ShellCommandRunner runner = new ShellCommandRunner(); ShellCommandRunner runner = new ShellCommandRunner();
runner.addHelpCommand(); runner.addCommand(new HelpCommand(runner));
runner.addCommands(getCommands()); runner.addCommands(getCommands());
runner.addAliases("exit", "quit"); runner.addAliases("exit", "quit");
runner.addAliases("help", "?"); runner.addAliases("help", "?");
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
package org.springframework.boot.cli.command.shell; package org.springframework.boot.cli.command.shell;
import org.springframework.boot.cli.CommandException; import org.springframework.boot.cli.command.CommandException;
/** /**
* Exception used to stop the {@link Shell}. * Exception used to stop the {@link Shell}.
......
...@@ -19,10 +19,10 @@ package org.springframework.boot.cli.command.test; ...@@ -19,10 +19,10 @@ package org.springframework.boot.cli.command.test;
import joptsimple.OptionSet; import joptsimple.OptionSet;
import org.springframework.boot.cli.command.Command; import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.CompilerOptionHandler;
import org.springframework.boot.cli.command.OptionParsingCommand; import org.springframework.boot.cli.command.OptionParsingCommand;
import org.springframework.boot.cli.command.SourceOptions; import org.springframework.boot.cli.command.options.CompilerOptionHandler;
import org.springframework.boot.cli.compiler.GroovyCompilerConfigurationAdapter; import org.springframework.boot.cli.command.options.OptionSetGroovyCompilerConfiguration;
import org.springframework.boot.cli.command.options.SourceOptions;
/** /**
* {@link Command} to run a groovy test script or scripts. * {@link Command} to run a groovy test script or scripts.
...@@ -60,7 +60,7 @@ public class TestCommand extends OptionParsingCommand { ...@@ -60,7 +60,7 @@ public class TestCommand extends OptionParsingCommand {
* {@link TestRunnerConfiguration}. * {@link TestRunnerConfiguration}.
*/ */
private class TestRunnerConfigurationAdapter extends private class TestRunnerConfigurationAdapter extends
GroovyCompilerConfigurationAdapter implements TestRunnerConfiguration { OptionSetGroovyCompilerConfiguration implements TestRunnerConfiguration {
public TestRunnerConfigurationAdapter(OptionSet options, public TestRunnerConfigurationAdapter(OptionSet options,
CompilerOptionHandler optionHandler) { CompilerOptionHandler optionHandler) {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli; package org.springframework.boot.cli.util;
/** /**
* Simple logger used by the CLI. * Simple logger used by the CLI.
......
org.springframework.boot.cli.command.DefaultCommandFactory org.springframework.boot.cli.DefaultCommandFactory
...@@ -14,10 +14,11 @@ ...@@ -14,10 +14,11 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli; package org.springframework.boot.cli.command;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.springframework.boot.cli.command.CommandRunner;
import org.springframework.boot.cli.command.run.RunCommand; import org.springframework.boot.cli.command.run.RunCommand;
import org.springframework.boot.cli.util.OutputCapture; import org.springframework.boot.cli.util.OutputCapture;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli; package org.springframework.boot.cli.command;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Set; import java.util.Set;
...@@ -26,7 +26,8 @@ import org.junit.Test; ...@@ -26,7 +26,8 @@ import org.junit.Test;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;
import org.mockito.Mock; import org.mockito.Mock;
import org.mockito.MockitoAnnotations; import org.mockito.MockitoAnnotations;
import org.springframework.boot.cli.command.Command; import org.springframework.boot.cli.command.core.HelpCommand;
import org.springframework.boot.cli.command.core.HintCommand;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
...@@ -95,8 +96,8 @@ public class CommandRunnerTests { ...@@ -95,8 +96,8 @@ public class CommandRunnerTests {
given(this.regularCommand.getName()).willReturn("command"); given(this.regularCommand.getName()).willReturn("command");
given(this.regularCommand.getDescription()).willReturn("A regular command"); given(this.regularCommand.getDescription()).willReturn("A regular command");
this.commandRunner.addCommand(this.regularCommand); this.commandRunner.addCommand(this.regularCommand);
this.commandRunner.addHelpCommand(); this.commandRunner.addCommand(new HelpCommand(this.commandRunner));
this.commandRunner.addHintCommand(); this.commandRunner.addCommand(new HintCommand(this.commandRunner));
} }
@Test @Test
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package org.springframework.boot.cli.command; package org.springframework.boot.cli.command;
import org.junit.Test; import org.junit.Test;
import org.springframework.boot.cli.command.options.OptionHandler;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment