Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Minimal changes to allow STS 'long running process' to execute commands ... #269

Merged
merged 1 commit into from almost 2 years ago

2 participants

Kris De Volder graemerocher
Kris De Volder

...and redirect to a new GrailsConsole for each command.

These are a 'minimal' set of changes that will allow STS to provide a 'long running' grails process to execute Grails commands from within STS. This considerably speeds up command execution from STS compared to the current execution mechanims which starts a new process for each command.

I know it is tight... but I hope that these changes can still make it into Grails 2.2.0 release.

Kris De Volder kdvolder Minimal changes to allow STS 'long running process' to execute comman…
…ds and properly redirect to a new GrailsConsole for each command.
e57e404
graemerocher graemerocher merged commit c53161e into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 20, 2012
Kris De Volder kdvolder Minimal changes to allow STS 'long running process' to execute comman…
…ds and properly redirect to a new GrailsConsole for each command.
e57e404
This page is out of date. Refresh to see the latest.
9 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java
@@ -241,16 +241,19 @@ private boolean isWindows() {
241 241 public static synchronized GrailsConsole getInstance() {
242 242 if (instance == null) {
243 243 try {
244   - instance = createInstance();
  244 + setInstance(createInstance());
245 245 } catch (IOException e) {
246 246 throw new RuntimeException("Cannot create grails console: " + e.getMessage(), e);
247 247 }
248 248 }
249   -
  249 + return instance;
  250 + }
  251 +
  252 + public static void setInstance(GrailsConsole newConsole) {
  253 + instance = newConsole;
250 254 if (!(System.out instanceof GrailsConsolePrintStream)) {
251 255 System.setOut(new GrailsConsolePrintStream(instance.out));
252 256 }
253   - return instance;
254 257 }
255 258
256 259 public static GrailsConsole createInstance() throws IOException {
10 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsEclipseConsole.java
@@ -45,8 +45,14 @@
45 45
46 46 private Boolean eclipseSupportsAnsi = null; //lazy initialized because implicitly used from super constructor.
47 47
48   - protected GrailsEclipseConsole() throws IOException {
49   - super();
  48 + /**
  49 + * Create a GrailsConsole that has some customizations to work better with STS. Note that
  50 + * this console implicitly captures and redirects System.out, System.err and System.in in the
  51 + * super class. So extreme care must be taken to ensure these streams are setup correctly
  52 + * before creating an instance.
  53 + */
  54 + public GrailsEclipseConsole() throws IOException {
  55 + super();
50 56 }
51 57
52 58 @Override

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.