Permalink
Browse files

fix verbose output from forked compiler.

  • Loading branch information...
1 parent 932836a commit 2a64d42d9a30795835d00e697fa9cad0c18fa103 @graemerocher graemerocher committed Jan 24, 2013
@@ -23,6 +23,7 @@
import org.apache.tools.ant.DefaultLogger;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.ProjectHelper;
+import org.apache.tools.ant.types.LogLevel;
import org.apache.tools.ant.util.StringUtils;
/**
@@ -67,6 +68,17 @@ public static void addGrailsConsoleBuildListener(Project project) {
logger.setErrorPrintStream(System.err);
project.addBuildListener(logger);
+
+ GrailsConsole instance = GrailsConsole.getInstance();
+ project.addBuildListener(new GrailsConsoleBuildListener(instance));
+
+ if (!instance.isVerbose()) {
+ for (Object buildListener : project.getBuildListeners()) {
+ if (buildListener instanceof BuildLogger) {
+ ((BuildLogger)buildListener).setMessageOutputLevel(LogLevel.ERR.getLevel());
+ }
+ }
+ }
}
private static class GrailsConsoleLogger extends DefaultLogger {
@@ -209,16 +209,6 @@ private void setUIListener(GantBinding binding) {
project.getBuildListeners().clear();
GrailsConsoleAntBuilder.addGrailsConsoleBuildListener(project);
- GrailsConsole instance = GrailsConsole.getInstance();
- project.addBuildListener(new GrailsConsoleBuildListener(instance));
-
- if (!instance.isVerbose()) {
- for (Object buildListener : project.getBuildListeners()) {
- if (buildListener instanceof BuildLogger) {
- ((BuildLogger)buildListener).setMessageOutputLevel(LogLevel.ERR.getLevel());
- }
- }
- }
}
@@ -23,6 +23,7 @@ import org.codehaus.groovy.control.CompilationUnit
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.control.Phases
import org.codehaus.groovy.grails.cli.fork.compile.ForkedGrailsCompiler
+import org.codehaus.groovy.grails.cli.logging.GrailsConsoleAntBuilder
import org.codehaus.groovy.grails.compiler.injection.GrailsAwareClassLoader
import org.codehaus.groovy.grails.compiler.injection.GrailsAwareInjectionOperation
import org.codehaus.groovy.grails.plugins.GrailsPluginInfo
@@ -114,7 +115,7 @@ class GrailsProjectCompiler {
AntBuilder getAnt() {
if (ant == null) {
- ant = new AntBuilder()
+ ant = new GrailsConsoleAntBuilder()
AntTypeDefinition atd = new AntTypeDefinition();
atd.setName('groovyc');
atd.setClassName(org.codehaus.groovy.grails.compiler.Grailsc.name);
@@ -123,6 +124,7 @@ class GrailsProjectCompiler {
ComponentHelper.getComponentHelper(ant.project)
.addDataTypeDefinition(atd);
ant.path(id: "grails.compile.classpath", compileClasspath)
+
}
return ant
}

0 comments on commit 2a64d42

Please sign in to comment.