Commit 420fc699 authored by Dave Syer's avatar Dave Syer

Only run InitCommand if there is code to process

This appears to be a significant improvement in performance
(checking for the existence of init.grooy is cheap, but compiling
it is expensive).

I'm going to say this fixes gh-212.
parent 322af41d
...@@ -79,7 +79,7 @@ public class InitCommand extends OptionParsingCommand { ...@@ -79,7 +79,7 @@ public class InitCommand extends OptionParsingCommand {
"init.groovy", "spring.groovy"); "init.groovy", "spring.groovy");
String[] sources = sourceOptions.getSourcesArray(); String[] sources = sourceOptions.getSourcesArray();
if (!(loader instanceof GroovyClassLoader)) { if (!(loader instanceof GroovyClassLoader) && sources.length > 0) {
List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
.createDefaultRepositoryConfiguration(); .createDefaultRepositoryConfiguration();
......
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