Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minimal changes to allow STS 'long running process' to execute comman…

…ds and properly redirect to a new GrailsConsole for each command.
  • Loading branch information...
commit e57e404fc2c0ab15eedc36f4a85de011427d4a78 1 parent 413fdfc
@kdvolder authored
View
9 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java
@@ -241,16 +241,19 @@ private boolean isWindows() {
public static synchronized GrailsConsole getInstance() {
if (instance == null) {
try {
- instance = createInstance();
+ setInstance(createInstance());
} catch (IOException e) {
throw new RuntimeException("Cannot create grails console: " + e.getMessage(), e);
}
}
-
+ return instance;
+ }
+
+ public static void setInstance(GrailsConsole newConsole) {
+ instance = newConsole;
if (!(System.out instanceof GrailsConsolePrintStream)) {
System.setOut(new GrailsConsolePrintStream(instance.out));
}
- return instance;
}
public static GrailsConsole createInstance() throws IOException {
View
10 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsEclipseConsole.java
@@ -45,8 +45,14 @@
private Boolean eclipseSupportsAnsi = null; //lazy initialized because implicitly used from super constructor.
- protected GrailsEclipseConsole() throws IOException {
- super();
+ /**
+ * Create a GrailsConsole that has some customizations to work better with STS. Note that
+ * this console implicitly captures and redirects System.out, System.err and System.in in the
+ * super class. So extreme care must be taken to ensure these streams are setup correctly
+ * before creating an instance.
+ */
+ public GrailsEclipseConsole() throws IOException {
+ super();
}
@Override
Please sign in to comment.
Something went wrong with that request. Please try again.