Gant

Simple way to set verbosity level when using a Gant binding

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Core
  • Labels:
    None
  • Number of attachments :
    0

Description

As discussed in GANT-102, need a simple way to set the verbosity level when using Java to create a Gant binding. Most important is to set silent mode on. An alternative would to control all output (stdout and strerr) creating from executing code using the binding without affecting System.out or System.err.

Activity

Hide
Russel Winder added a comment - - edited

Graeme split Gant.processTargets into Gant.prepareTargets and Gant.executeTargets as part of the Gant 1.9.2 release so that Grails could manipulate the Gant verbosity from Java code. Does this effectively solve this issue?

(This doesn't mean that the whole Gant verbosity setting doesn't need more refactoring.)

Show
Russel Winder added a comment - - edited Graeme split Gant.processTargets into Gant.prepareTargets and Gant.executeTargets as part of the Gant 1.9.2 release so that Grails could manipulate the Gant verbosity from Java code. Does this effectively solve this issue? (This doesn't mean that the whole Gant verbosity setting doesn't need more refactoring.)
Hide
Bob Swift added a comment -

Must have missed this comment earlier . Not sure what you mean. How does Grails manipulate the verbosity now it is split?

Show
Bob Swift added a comment - Must have missed this comment earlier . Not sure what you mean. How does Grails manipulate the verbosity now it is split?
Hide
Russel Winder added a comment -

I think the idea was to call prepareTargets then set the verbosity – which means setting a global variable and calling a function – and then call executeTargets.

Show
Russel Winder added a comment - I think the idea was to call prepareTargets then set the verbosity – which means setting a global variable and calling a function – and then call executeTargets.
Hide
Bob Swift added a comment -

It has been a while since I looked at this but this is the code that I want to prevent system output from being generated. Here is simplified version:

binding = new GantBinding(binding); 
GroovyShell shell = new GroovyShell(binding, configuration);
try {
    Script parsedCode = shell.parse(code, fileName);
    try {
        parsedCode.run();
        parsedCode.invokeMethod("someTarget", null);
    } catch ...
    }
} catch ...
}
Show
Bob Swift added a comment - It has been a while since I looked at this but this is the code that I want to prevent system output from being generated. Here is simplified version:
binding = new GantBinding(binding); 
GroovyShell shell = new GroovyShell(binding, configuration);
try {
    Script parsedCode = shell.parse(code, fileName);
    try {
        parsedCode.run();
        parsedCode.invokeMethod("someTarget", null);
    } catch ...
    }
} catch ...
}
Hide
Bob Swift added a comment -

This is related to GANT-125 as it involves the same problem of controlling where output goes. Suppressing output at least prevents stuff going somewhere it shouldn't, but really prefer (as in GANT-125) to route it to the correct location.

Show
Bob Swift added a comment - This is related to GANT-125 as it involves the same problem of controlling where output goes. Suppressing output at least prevents stuff going somewhere it shouldn't, but really prefer (as in GANT-125) to route it to the correct location.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: