Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
70cb8cfe
Commit
70cb8cfe
authored
Feb 04, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CLI package and class tangles
parent
15527595
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
76 additions
and
72 deletions
+76
-72
DefaultCommandFactory.java
...a/org/springframework/boot/cli/DefaultCommandFactory.java
+3
-1
SpringCli.java
...src/main/java/org/springframework/boot/cli/SpringCli.java
+4
-2
AbstractCommand.java
...org/springframework/boot/cli/command/AbstractCommand.java
+2
-0
Command.java
...in/java/org/springframework/boot/cli/command/Command.java
+2
-0
CommandException.java
...rg/springframework/boot/cli/command/CommandException.java
+1
-1
CommandRunner.java
...a/org/springframework/boot/cli/command/CommandRunner.java
+2
-18
NoArgumentsException.java
...pringframework/boot/cli/command/NoArgumentsException.java
+2
-1
NoHelpCommandArgumentsException.java
...ork/boot/cli/command/NoHelpCommandArgumentsException.java
+1
-1
NoSuchCommandException.java
...ingframework/boot/cli/command/NoSuchCommandException.java
+1
-1
OptionParsingCommand.java
...pringframework/boot/cli/command/OptionParsingCommand.java
+3
-0
HelpCommand.java
...rg/springframework/boot/cli/command/core/HelpCommand.java
+5
-5
HintCommand.java
...rg/springframework/boot/cli/command/core/HintCommand.java
+3
-3
VersionCommand.java
...springframework/boot/cli/command/core/VersionCommand.java
+1
-1
GrabCommand.java
...rg/springframework/boot/cli/command/grab/GrabCommand.java
+4
-4
JarCommand.java
.../org/springframework/boot/cli/command/jar/JarCommand.java
+4
-4
CompilerOptionHandler.java
...ework/boot/cli/command/options/CompilerOptionHandler.java
+1
-1
OptionHandler.java
...ringframework/boot/cli/command/options/OptionHandler.java
+3
-1
OptionHelp.java
.../springframework/boot/cli/command/options/OptionHelp.java
+1
-1
OptionSetGroovyCompilerConfiguration.java
...command/options/OptionSetGroovyCompilerConfiguration.java
+7
-5
SourceOptions.java
...ringframework/boot/cli/command/options/SourceOptions.java
+1
-1
RunCommand.java
.../org/springframework/boot/cli/command/run/RunCommand.java
+4
-4
CommandCompleter.java
...ingframework/boot/cli/command/shell/CommandCompleter.java
+2
-2
ForkProcessCommand.java
...gframework/boot/cli/command/shell/ForkProcessCommand.java
+1
-1
Shell.java
...ava/org/springframework/boot/cli/command/shell/Shell.java
+3
-2
ShellExitException.java
...gframework/boot/cli/command/shell/ShellExitException.java
+1
-1
TestCommand.java
...rg/springframework/boot/cli/command/test/TestCommand.java
+4
-4
DependencyAutoConfigurationTransformation.java
...i/compiler/DependencyAutoConfigurationTransformation.java
+0
-0
GroovyBeansTransformation.java
...ramework/boot/cli/compiler/GroovyBeansTransformation.java
+0
-0
ResolveDependencyCoordinatesTransformation.java
.../compiler/ResolveDependencyCoordinatesTransformation.java
+0
-0
Log.java
.../src/main/java/org/springframework/boot/cli/util/Log.java
+1
-1
org.springframework.boot.cli.command.CommandFactory
...vices/org.springframework.boot.cli.command.CommandFactory
+1
-1
CommandRunnerIntegrationTests.java
...ework/boot/cli/command/CommandRunnerIntegrationTests.java
+2
-1
CommandRunnerTests.java
.../springframework/boot/cli/command/CommandRunnerTests.java
+5
-4
OptionParsingCommandTests.java
...framework/boot/cli/command/OptionParsingCommandTests.java
+1
-0
ResolveDependencyCoordinatesTransformationTests.java
...iler/ResolveDependencyCoordinatesTransformationTests.java
+0
-0
No files found.
spring-boot-cli/src/main/java/org/springframework/boot/cli/
command/
DefaultCommandFactory.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java
View file @
70cb8cfe
...
...
@@ -14,12 +14,14 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
.
command
;
package
org
.
springframework
.
boot
.
cli
;
import
java.util.Arrays
;
import
java.util.Collection
;
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.grab.GrabCommand
;
import
org.springframework.boot.cli.command.jar.JarCommand
;
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/SpringCli.java
View file @
70cb8cfe
...
...
@@ -19,7 +19,9 @@ package org.springframework.boot.cli;
import
java.util.ServiceLoader
;
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.HintCommand
;
import
org.springframework.boot.cli.command.core.VersionCommand
;
import
org.springframework.boot.cli.command.shell.ShellCommand
;
...
...
@@ -37,10 +39,10 @@ public class SpringCli {
System
.
setProperty
(
"java.awt.headless"
,
Boolean
.
toString
(
true
));
CommandRunner
runner
=
new
CommandRunner
(
"spring"
);
runner
.
add
HelpCommand
(
);
runner
.
add
Command
(
new
HelpCommand
(
runner
)
);
addServiceLoaderCommands
(
runner
);
runner
.
addCommand
(
new
ShellCommand
());
runner
.
add
HintCommand
(
);
runner
.
add
Command
(
new
HintCommand
(
runner
)
);
runner
.
setOptionCommands
(
HelpCommand
.
class
,
VersionCommand
.
class
);
int
exitCode
=
runner
.
runAndHandleErrors
(
args
);
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/AbstractCommand.java
View file @
70cb8cfe
...
...
@@ -19,6 +19,8 @@ package org.springframework.boot.cli.command;
import
java.util.Collection
;
import
java.util.Collections
;
import
org.springframework.boot.cli.command.options.OptionHelp
;
/**
* Abstract {@link Command} implementation.
*
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/Command.java
View file @
70cb8cfe
...
...
@@ -18,6 +18,8 @@ package org.springframework.boot.cli.command;
import
java.util.Collection
;
import
org.springframework.boot.cli.command.options.OptionHelp
;
/**
* A single command that can be run from the CLI.
*
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/CommandException.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/
command/
CommandException.java
View file @
70cb8cfe
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
;
package
org
.
springframework
.
boot
.
cli
.
command
;
import
java.util.Arrays
;
import
java.util.Collections
;
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/CommandRunner.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/
command/
CommandRunner.java
View file @
70cb8cfe
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
;
package
org
.
springframework
.
boot
.
cli
.
command
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
...
...
@@ -24,9 +24,7 @@ import java.util.Iterator;
import
java.util.List
;
import
java.util.Set
;
import
org.springframework.boot.cli.command.Command
;
import
org.springframework.boot.cli.command.core.HelpCommand
;
import
org.springframework.boot.cli.command.core.HintCommand
;
import
org.springframework.boot.cli.util.Log
;
import
org.springframework.util.Assert
;
import
org.springframework.util.StringUtils
;
...
...
@@ -64,20 +62,6 @@ public class CommandRunner implements Iterable<Command> {
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.
* @param commands the commands to add
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/NoArgumentsException.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/
command/
NoArgumentsException.java
View file @
70cb8cfe
...
...
@@ -14,7 +14,8 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
;
package
org
.
springframework
.
boot
.
cli
.
command
;
/**
* Exception used to indicate that no arguemnts were specified.
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/NoHelpCommandArgumentsException.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/
command/
NoHelpCommandArgumentsException.java
View file @
70cb8cfe
...
...
@@ -14,7 +14,7 @@
* 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.
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/NoSuchCommandException.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/
command/
NoSuchCommandException.java
View file @
70cb8cfe
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
;
package
org
.
springframework
.
boot
.
cli
.
command
;
/**
* Exception used when a command is not found.
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/OptionParsingCommand.java
View file @
70cb8cfe
...
...
@@ -18,6 +18,9 @@ package org.springframework.boot.cli.command;
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}.
*
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java
View file @
70cb8cfe
...
...
@@ -22,13 +22,13 @@ import java.util.Collections;
import
java.util.List
;
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.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.
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HintCommand.java
View file @
70cb8cfe
...
...
@@ -20,11 +20,11 @@ import java.util.ArrayList;
import
java.util.Collections
;
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.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
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/VersionCommand.java
View file @
70cb8cfe
...
...
@@ -16,9 +16,9 @@
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.Command
;
import
org.springframework.boot.cli.util.Log
;
/**
* {@link Command} to display the 'version' number.
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/grab/GrabCommand.java
View file @
70cb8cfe
...
...
@@ -21,12 +21,12 @@ import java.util.List;
import
joptsimple.OptionSet
;
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.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.GroovyCompilerConfiguration
;
import
org.springframework.boot.cli.compiler.GroovyCompilerConfigurationAdapter
;
import
org.springframework.boot.cli.compiler.RepositoryConfigurationFactory
;
import
org.springframework.boot.cli.compiler.grape.RepositoryConfiguration
;
...
...
@@ -51,7 +51,7 @@ public class GrabCommand extends OptionParsingCommand {
List
<
RepositoryConfiguration
>
repositoryConfiguration
=
RepositoryConfigurationFactory
.
createDefaultRepositoryConfiguration
();
GroovyCompilerConfiguration
configuration
=
new
GroovyCompilerConfigurationAdapter
(
GroovyCompilerConfiguration
configuration
=
new
OptionSetGroovyCompilerConfiguration
(
options
,
this
,
repositoryConfiguration
);
if
(
System
.
getProperty
(
"grape.root"
)
==
null
)
{
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/jar/JarCommand.java
View file @
70cb8cfe
...
...
@@ -42,13 +42,13 @@ import org.codehaus.groovy.ast.expr.ConstantExpression;
import
org.codehaus.groovy.control.SourceUnit
;
import
org.codehaus.groovy.transform.ASTTransformation
;
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.SourceOptions
;
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.GroovyCompilerConfiguration
;
import
org.springframework.boot.cli.compiler.GroovyCompilerConfigurationAdapter
;
import
org.springframework.boot.cli.compiler.RepositoryConfigurationFactory
;
import
org.springframework.boot.cli.compiler.grape.RepositoryConfiguration
;
import
org.springframework.boot.cli.jar.PackagedSpringApplicationLauncher
;
...
...
@@ -137,7 +137,7 @@ public class JarCommand extends OptionParsingCommand {
private
GroovyCompiler
createCompiler
(
OptionSet
options
)
{
List
<
RepositoryConfiguration
>
repositoryConfiguration
=
RepositoryConfigurationFactory
.
createDefaultRepositoryConfiguration
();
GroovyCompilerConfiguration
configuration
=
new
GroovyCompilerConfigurationAdapter
(
GroovyCompilerConfiguration
configuration
=
new
OptionSetGroovyCompilerConfiguration
(
options
,
this
,
repositoryConfiguration
);
GroovyCompiler
groovyCompiler
=
new
GroovyCompiler
(
configuration
);
groovyCompiler
.
getAstTransformations
().
add
(
0
,
new
GrabAnnotationTransform
());
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CompilerOptionHandler.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/
options/
CompilerOptionHandler.java
View file @
70cb8cfe
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
.
command
;
package
org
.
springframework
.
boot
.
cli
.
command
.
options
;
import
joptsimple.OptionSpec
;
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/OptionHandler.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/
options/
OptionHandler.java
View file @
70cb8cfe
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
.
command
;
package
org
.
springframework
.
boot
.
cli
.
command
.
options
;
import
groovy.lang.Closure
;
...
...
@@ -31,6 +31,8 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.TreeSet
;
import
org.springframework.boot.cli.command.OptionParsingCommand
;
import
joptsimple.BuiltinHelpFormatter
;
import
joptsimple.HelpFormatter
;
import
joptsimple.OptionDescriptor
;
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/OptionHelp.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/
options/
OptionHelp.java
View file @
70cb8cfe
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
.
command
;
package
org
.
springframework
.
boot
.
cli
.
command
.
options
;
import
java.util.Set
;
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/com
piler/GroovyCompilerConfigurationAdapter
.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/com
mand/options/OptionSetGroovyCompilerConfiguration
.java
View file @
70cb8cfe
...
...
@@ -14,14 +14,16 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
.
com
piler
;
package
org
.
springframework
.
boot
.
cli
.
com
mand
.
options
;
import
java.util.List
;
import
joptsimple.OptionSet
;
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
;
/**
...
...
@@ -30,7 +32,7 @@ import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration;
*
* @author Andy Wilkinson
*/
public
class
GroovyCompilerConfigurationAdapter
implements
GroovyCompilerConfiguration
{
public
class
OptionSetGroovyCompilerConfiguration
implements
GroovyCompilerConfiguration
{
private
final
OptionSet
options
;
...
...
@@ -38,13 +40,13 @@ public class GroovyCompilerConfigurationAdapter implements GroovyCompilerConfigu
private
final
List
<
RepositoryConfiguration
>
repositoryConfiguration
;
protected
GroovyCompilerConfigurationAdapter
(
OptionSet
optionSet
,
protected
OptionSetGroovyCompilerConfiguration
(
OptionSet
optionSet
,
CompilerOptionHandler
compilerOptionHandler
)
{
this
(
optionSet
,
compilerOptionHandler
,
RepositoryConfigurationFactory
.
createDefaultRepositoryConfiguration
());
}
public
GroovyCompilerConfigurationAdapter
(
OptionSet
optionSet
,
public
OptionSetGroovyCompilerConfiguration
(
OptionSet
optionSet
,
CompilerOptionHandler
compilerOptionHandler
,
List
<
RepositoryConfiguration
>
repositoryConfiguration
)
{
this
.
options
=
optionSet
;
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/SourceOptions.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/
options/
SourceOptions.java
View file @
70cb8cfe
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
.
command
;
package
org
.
springframework
.
boot
.
cli
.
command
.
options
;
import
java.util.ArrayList
;
import
java.util.Collections
;
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/run/RunCommand.java
View file @
70cb8cfe
...
...
@@ -25,10 +25,10 @@ import joptsimple.OptionSet;
import
joptsimple.OptionSpec
;
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.SourceOptions
;
import
org.springframework.boot.cli.compiler.GroovyCompilerConfigurationAdapter
;
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.GroovyCompilerScope
;
import
org.springframework.boot.cli.compiler.RepositoryConfigurationFactory
;
import
org.springframework.boot.cli.compiler.grape.RepositoryConfiguration
;
...
...
@@ -121,7 +121,7 @@ public class RunCommand extends OptionParsingCommand {
* {@link SpringApplicationRunnerConfiguration}.
*/
private
class
SpringApplicationRunnerConfigurationAdapter
extends
GroovyCompilerConfigurationAdapter
implements
OptionSetGroovyCompilerConfiguration
implements
SpringApplicationRunnerConfiguration
{
public
SpringApplicationRunnerConfigurationAdapter
(
OptionSet
options
,
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/CommandCompleter.java
View file @
70cb8cfe
...
...
@@ -30,9 +30,9 @@ import jline.console.completer.Completer;
import
jline.console.completer.FileNameCompleter
;
import
jline.console.completer.StringsCompleter
;
import
org.springframework.boot.cli.Log
;
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.
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ForkProcessCommand.java
View file @
70cb8cfe
...
...
@@ -22,7 +22,7 @@ import java.util.Collection;
import
java.util.List
;
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
;
/**
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/Shell.java
View file @
70cb8cfe
...
...
@@ -31,9 +31,10 @@ import jline.console.ConsoleReader;
import
jline.console.completer.CandidateListCompletionHandler
;
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.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.util.StringUtils
;
...
...
@@ -83,7 +84,7 @@ public class Shell {
private
ShellCommandRunner
createCommandRunner
()
{
ShellCommandRunner
runner
=
new
ShellCommandRunner
();
runner
.
add
HelpCommand
(
);
runner
.
add
Command
(
new
HelpCommand
(
runner
)
);
runner
.
addCommands
(
getCommands
());
runner
.
addAliases
(
"exit"
,
"quit"
);
runner
.
addAliases
(
"help"
,
"?"
);
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/ShellExitException.java
View file @
70cb8cfe
...
...
@@ -16,7 +16,7 @@
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}.
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestCommand.java
View file @
70cb8cfe
...
...
@@ -19,10 +19,10 @@ package org.springframework.boot.cli.command.test;
import
joptsimple.OptionSet
;
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.SourceOptions
;
import
org.springframework.boot.cli.compiler.GroovyCompilerConfigurationAdapter
;
import
org.springframework.boot.cli.command.options.CompilerOptionHandler
;
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.
...
...
@@ -60,7 +60,7 @@ public class TestCommand extends OptionParsingCommand {
* {@link TestRunnerConfiguration}.
*/
private
class
TestRunnerConfigurationAdapter
extends
GroovyCompilerConfigurationAdapter
implements
TestRunnerConfiguration
{
OptionSetGroovyCompilerConfiguration
implements
TestRunnerConfiguration
{
public
TestRunnerConfigurationAdapter
(
OptionSet
options
,
CompilerOptionHandler
optionHandler
)
{
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/
transformation/
DependencyAutoConfigurationTransformation.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/DependencyAutoConfigurationTransformation.java
View file @
70cb8cfe
File moved
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/
transformation/
GroovyBeansTransformation.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyBeansTransformation.java
View file @
70cb8cfe
File moved
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/
transformation/
ResolveDependencyCoordinatesTransformation.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ResolveDependencyCoordinatesTransformation.java
View file @
70cb8cfe
File moved
spring-boot-cli/src/main/java/org/springframework/boot/cli/Log.java
→
spring-boot-cli/src/main/java/org/springframework/boot/cli/
util/
Log.java
View file @
70cb8cfe
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
;
package
org
.
springframework
.
boot
.
cli
.
util
;
/**
* Simple logger used by the CLI.
...
...
spring-boot-cli/src/main/resources/META-INF/services/org.springframework.boot.cli.command.CommandFactory
View file @
70cb8cfe
org.springframework.boot.cli.
command.
DefaultCommandFactory
org.springframework.boot.cli.DefaultCommandFactory
spring-boot-cli/src/test/java/org/springframework/boot/cli/CommandRunnerIntegrationTests.java
→
spring-boot-cli/src/test/java/org/springframework/boot/cli/
command/
CommandRunnerIntegrationTests.java
View file @
70cb8cfe
...
...
@@ -14,10 +14,11 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
;
package
org
.
springframework
.
boot
.
cli
.
command
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.springframework.boot.cli.command.CommandRunner
;
import
org.springframework.boot.cli.command.run.RunCommand
;
import
org.springframework.boot.cli.util.OutputCapture
;
...
...
spring-boot-cli/src/test/java/org/springframework/boot/cli/CommandRunnerTests.java
→
spring-boot-cli/src/test/java/org/springframework/boot/cli/
command/
CommandRunnerTests.java
View file @
70cb8cfe
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
;
package
org
.
springframework
.
boot
.
cli
.
command
;
import
java.util.EnumSet
;
import
java.util.Set
;
...
...
@@ -26,7 +26,8 @@ import org.junit.Test;
import
org.junit.rules.ExpectedException
;
import
org.mockito.Mock
;
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
.
junit
.
Assert
.
assertEquals
;
...
...
@@ -95,8 +96,8 @@ public class CommandRunnerTests {
given
(
this
.
regularCommand
.
getName
()).
willReturn
(
"command"
);
given
(
this
.
regularCommand
.
getDescription
()).
willReturn
(
"A regular command"
);
this
.
commandRunner
.
addCommand
(
this
.
regularCommand
);
this
.
commandRunner
.
add
HelpCommand
(
);
this
.
commandRunner
.
add
HintCommand
(
);
this
.
commandRunner
.
add
Command
(
new
HelpCommand
(
this
.
commandRunner
)
);
this
.
commandRunner
.
add
Command
(
new
HintCommand
(
this
.
commandRunner
)
);
}
@Test
...
...
spring-boot-cli/src/test/java/org/springframework/boot/cli/command/OptionParsingCommandTests.java
View file @
70cb8cfe
...
...
@@ -17,6 +17,7 @@
package
org
.
springframework
.
boot
.
cli
.
command
;
import
org.junit.Test
;
import
org.springframework.boot.cli.command.options.OptionHandler
;
import
static
org
.
hamcrest
.
Matchers
.
containsString
;
import
static
org
.
junit
.
Assert
.
assertThat
;
...
...
spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/
transformation/
ResolveDependencyCoordinatesTransformationTests.java
→
spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/ResolveDependencyCoordinatesTransformationTests.java
View file @
70cb8cfe
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment