Polish
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.cli.command;
|
||||
|
||||
import joptsimple.OptionSet;
|
||||
|
||||
import org.springframework.boot.cli.Command;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
/**
|
||||
* {@link Command} to 'create' a new spring groovy script.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
public class CreateCommand extends OptionParsingCommand {
|
||||
|
||||
public CreateCommand() {
|
||||
super("create", "Create an new spring groovy script", new CreateOptionHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsageHelp() {
|
||||
return "[options] <file>";
|
||||
}
|
||||
|
||||
private static class CreateOptionHandler extends OptionHandler {
|
||||
|
||||
@Override
|
||||
protected void options() {
|
||||
option(asList("overwite", "f"), "Overwrite any existing file");
|
||||
option("type", "Create a specific application type").withOptionalArg()
|
||||
.ofType(String.class).describedAs("web, batch, integration");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(OptionSet options) {
|
||||
throw new IllegalStateException("Not implemented"); // FIXME
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -121,8 +121,6 @@ public class RunCommand extends OptionParsingCommand {
|
||||
if ("--".equals(filename)) {
|
||||
break;
|
||||
}
|
||||
// TODO: add support for strict Java compilation
|
||||
// TODO: add support for recursive search in directory
|
||||
if (filename.endsWith(".groovy") || filename.endsWith(".java")) {
|
||||
File file = new File(filename);
|
||||
if (file.isFile() && file.canRead()) {
|
||||
|
||||
@@ -43,12 +43,6 @@ public class SpringMvcCompilerAutoConfiguration extends CompilerAutoConfiguratio
|
||||
|
||||
dependencies.add("org.codehaus.groovy", "groovy-templates",
|
||||
dependencies.getProperty("groovy.version"));
|
||||
// FIXME restore Tomcat when we can get reload to work
|
||||
// dependencies.ifMissingClasses("org.apache.catalina.startup.Tomcat")
|
||||
// .add("org.apache.tomcat.embed", "tomcat-embed-core",
|
||||
// dependencies.getProperty("tomcat.version"))
|
||||
// .add("org.apache.tomcat.embed", "tomcat-embed-logging-juli",
|
||||
// dependencies.getProperty("tomcat.version"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,8 +37,6 @@ public class SpringApplicationRunner {
|
||||
|
||||
private static int runnerCounter = 0;
|
||||
|
||||
// FIXME logging
|
||||
|
||||
private SpringApplicationRunnerConfiguration configuration;
|
||||
|
||||
private final File[] files;
|
||||
|
||||
@@ -32,8 +32,6 @@ import org.codehaus.groovy.control.CompilationFailedException;
|
||||
*/
|
||||
public abstract class GroovyTemplate {
|
||||
|
||||
// FIXME is this used?
|
||||
|
||||
public static String template(String name) throws IOException,
|
||||
CompilationFailedException, ClassNotFoundException {
|
||||
return template(name, Collections.<String, Object> emptyMap());
|
||||
|
||||
Reference in New Issue
Block a user