Formatting and cleanup
This commit is contained in:
@@ -106,7 +106,7 @@ public class RunCommand extends OptionParsingCommand {
|
||||
this.runner = new SpringApplicationRunner(configuration,
|
||||
sourceOptions.getSourcesArray(), sourceOptions.getArgsArray());
|
||||
this.runner.compileAndRun();
|
||||
|
||||
|
||||
return ExitStatus.OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,8 @@ public abstract class AstUtils {
|
||||
String... annotations) {
|
||||
for (AnnotationNode annotationNode : node.getAnnotations()) {
|
||||
for (String annotation : annotations) {
|
||||
if (PatternMatchUtils.simpleMatch(annotation, annotationNode.getClassNode().getName())) {
|
||||
if (PatternMatchUtils.simpleMatch(annotation, annotationNode
|
||||
.getClassNode().getName())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.boot.cli.compiler.grape.DependencyResolutionContext;
|
||||
* <p>
|
||||
* This class provides a fluent API for conditionally adding dependencies. For example:
|
||||
* {@code dependencies.ifMissing("com.corp.SomeClass").add(module)}.
|
||||
*
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
|
||||
@@ -265,7 +265,8 @@ public class GroovyCompiler {
|
||||
public void call(SourceUnit source, GeneratorContext context, ClassNode classNode)
|
||||
throws CompilationFailedException {
|
||||
|
||||
ImportCustomizer importCustomizer = new SmartImportCustomizer(source, context, classNode);
|
||||
ImportCustomizer importCustomizer = new SmartImportCustomizer(source,
|
||||
context, classNode);
|
||||
ClassNode mainClassNode = getMainClass(source.getAST().getClasses());
|
||||
|
||||
// Additional auto configuration
|
||||
|
||||
@@ -42,10 +42,8 @@ public class JUnitCompilerAutoConfiguration extends CompilerAutoConfiguration {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyImports(ImportCustomizer imports)
|
||||
throws CompilationFailedException {
|
||||
imports.addStarImports("org.junit")
|
||||
.addStaticStars("org.junit.Assert")
|
||||
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
|
||||
imports.addStarImports("org.junit").addStaticStars("org.junit.Assert")
|
||||
.addStaticStars("org.hamcrest.MatcherAssert")
|
||||
.addStaticStars("org.hamcrest.Matchers");
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ReactorCompilerAutoConfiguration extends CompilerAutoConfiguration
|
||||
public void applyImports(ImportCustomizer imports) {
|
||||
imports.addImports("reactor.core.Reactor", "reactor.core.spec.Reactors",
|
||||
"reactor.core.Observable", "reactor.event.Event",
|
||||
"reactor.function.Functions", "reactor.function.Predicates",
|
||||
"reactor.function.Functions", "reactor.function.Predicates",
|
||||
"reactor.function.Suppliers",
|
||||
"reactor.spring.context.annotation.Consumer",
|
||||
"reactor.spring.context.annotation.Selector",
|
||||
|
||||
@@ -45,8 +45,10 @@ public class SpringBootCompilerAutoConfiguration extends CompilerAutoConfigurati
|
||||
|
||||
@Override
|
||||
public void applyImports(ImportCustomizer imports) {
|
||||
imports.addImports("javax.annotation.PostConstruct",
|
||||
"javax.annotation.PreDestroy", "groovy.util.logging.Log",
|
||||
imports.addImports(
|
||||
"javax.annotation.PostConstruct",
|
||||
"javax.annotation.PreDestroy",
|
||||
"groovy.util.logging.Log",
|
||||
"org.springframework.stereotype.Controller",
|
||||
"org.springframework.stereotype.Service",
|
||||
"org.springframework.stereotype.Component",
|
||||
|
||||
@@ -50,8 +50,7 @@ public class SpringMvcCompilerAutoConfiguration extends CompilerAutoConfiguratio
|
||||
public void applyImports(ImportCustomizer imports) {
|
||||
imports.addStarImports("org.springframework.web.bind.annotation",
|
||||
"org.springframework.web.servlet.config.annotation",
|
||||
"org.springframework.web.servlet",
|
||||
"org.springframework.http",
|
||||
"org.springframework.web.servlet", "org.springframework.http",
|
||||
"org.springframework.web.servlet.handler", "org.springframework.http",
|
||||
"org.springframework.ui", "groovy.text");
|
||||
imports.addStaticImport(GroovyTemplate.class.getName(), "template");
|
||||
|
||||
@@ -23,7 +23,7 @@ package org.springframework.boot.cli.compiler.dependencies;
|
||||
* the relevant piece from the identifier. Alternatively the identifier may be in the form
|
||||
* {@code artifactId}, in which case coordinate resolution uses implementation-specific
|
||||
* metadata to resolve the groupId and version.
|
||||
*
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
public interface ArtifactCoordinatesResolver {
|
||||
|
||||
@@ -48,7 +48,7 @@ import org.eclipse.aether.util.filter.DependencyFilterUtils;
|
||||
* A {@link GrapeEngine} implementation that uses <a
|
||||
* href="http://eclipse.org/aether">Aether</a>, the dependency resolution system used by
|
||||
* Maven.
|
||||
*
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
|
||||
@@ -27,8 +27,7 @@ import org.springframework.boot.dependency.tools.ManagedDependencies;
|
||||
import org.springframework.boot.dependency.tools.PomDependencies;
|
||||
|
||||
/**
|
||||
* Factory to create Maven {@link Dependency} objects from Boot
|
||||
* {@link PomDependencies}.
|
||||
* Factory to create Maven {@link Dependency} objects from Boot {@link PomDependencies}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
|
||||
@@ -55,8 +55,8 @@ public abstract class GroovyTemplate {
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
private static Template getTemplate(TemplateEngine engine, String name) throws CompilationFailedException,
|
||||
ClassNotFoundException, IOException {
|
||||
private static Template getTemplate(TemplateEngine engine, String name)
|
||||
throws CompilationFailedException, ClassNotFoundException, IOException {
|
||||
|
||||
File file = new File("templates", name);
|
||||
if (file.exists()) {
|
||||
|
||||
Reference in New Issue
Block a user