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
a624245b
Commit
a624245b
authored
Jan 28, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead code
Remove what appears to be unused CLI code.
parent
bcd74bb7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
33 deletions
+5
-33
SourceOptions.java
...a/org/springframework/boot/cli/command/SourceOptions.java
+3
-13
SpringApplicationRunner.java
...amework/boot/cli/command/run/SpringApplicationRunner.java
+1
-1
TestRunner.java
...org/springframework/boot/cli/command/test/TestRunner.java
+1
-1
GroovyCompiler.java
...org/springframework/boot/cli/compiler/GroovyCompiler.java
+0
-18
No files found.
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/SourceOptions.java
View file @
a624245b
...
...
@@ -23,6 +23,7 @@ import java.util.List;
import
joptsimple.OptionSet
;
import
org.springframework.boot.cli.util.ResourceUtils
;
import
org.springframework.util.Assert
;
/**
* Extract source file options (anything following '--' in an {@link OptionSet}).
...
...
@@ -54,11 +55,8 @@ public class SourceOptions {
* @param optionSet the source option set
* @param classLoader an optional classloader used to try and load files that are not
* found in the local filesystem
* @param defaultPaths the default paths to use if no files are provided in the option
* set
*/
public
SourceOptions
(
OptionSet
optionSet
,
ClassLoader
classLoader
,
String
...
defaultPaths
)
{
public
SourceOptions
(
OptionSet
optionSet
,
ClassLoader
classLoader
)
{
List
<?>
nonOptionArguments
=
optionSet
.
nonOptionArguments
();
List
<
String
>
sources
=
new
ArrayList
<
String
>();
int
sourceArgCount
=
0
;
...
...
@@ -86,15 +84,7 @@ public class SourceOptions {
}
this
.
args
=
Collections
.
unmodifiableList
(
nonOptionArguments
.
subList
(
sourceArgCount
,
nonOptionArguments
.
size
()));
if
(
sources
.
size
()
==
0
)
{
if
(
defaultPaths
.
length
==
0
)
{
throw
new
IllegalArgumentException
(
"Please specify at least one file to run"
);
}
for
(
String
path
:
defaultPaths
)
{
sources
.
addAll
(
ResourceUtils
.
getUrls
(
path
,
classLoader
));
}
}
Assert
.
isTrue
(
sources
.
size
()
>
0
,
"Please specify at least one file to run"
);
this
.
sources
=
Collections
.
unmodifiableList
(
sources
);
}
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/run/SpringApplicationRunner.java
View file @
a624245b
...
...
@@ -78,7 +78,7 @@ public class SpringApplicationRunner {
stop
();
// Compile
Object
[]
compiledSources
=
this
.
compiler
.
sources
(
this
.
sources
);
Object
[]
compiledSources
=
this
.
compiler
.
compile
(
this
.
sources
);
if
(
compiledSources
.
length
==
0
)
{
throw
new
RuntimeException
(
"No classes found in '"
+
this
.
sources
+
"'"
);
}
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestRunner.java
View file @
a624245b
...
...
@@ -50,7 +50,7 @@ public class TestRunner {
}
public
void
compileAndRunTests
()
throws
Exception
{
Object
[]
sources
=
this
.
compiler
.
sources
(
this
.
sources
);
Object
[]
sources
=
this
.
compiler
.
compile
(
this
.
sources
);
if
(
sources
.
length
==
0
)
{
throw
new
RuntimeException
(
"No classes found in '"
+
this
.
sources
+
"'"
);
}
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java
View file @
a624245b
...
...
@@ -24,7 +24,6 @@ import java.io.IOException;
import
java.lang.reflect.Field
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.LinkedList
;
import
java.util.List
;
...
...
@@ -153,23 +152,6 @@ public class GroovyCompiler {
this
.
loader
.
getConfiguration
().
addCompilationCustomizers
(
customizers
);
}
public
Object
[]
sources
(
String
...
sources
)
throws
CompilationFailedException
,
IOException
{
List
<
String
>
compilables
=
new
ArrayList
<
String
>();
List
<
Object
>
others
=
new
ArrayList
<
Object
>();
for
(
String
source
:
sources
)
{
if
(
source
.
endsWith
(
".groovy"
)
||
source
.
endsWith
(
".java"
))
{
compilables
.
add
(
source
);
}
else
{
others
.
add
(
source
);
}
}
Class
<?>[]
compiled
=
compile
(
compilables
.
toArray
(
new
String
[
compilables
.
size
()]));
others
.
addAll
(
0
,
Arrays
.
asList
(
compiled
));
return
others
.
toArray
(
new
Object
[
others
.
size
()]);
}
/**
* Compile the specified Groovy sources, applying any
* {@link CompilerAutoConfiguration}s. All classes defined in the sources will be
...
...
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