Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.0
-
Fix Version/s: 1.9.2
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
See GANT-90 item 2.
The following test should not produce any per target output
globalPreHook = []
globalPostHook = []
target(test: 'my test') {
}
Currently the global hooks and the per-target hooks are different and independent lists. I think they should perhaps stay that way rather than create a complex interdependencies, the rules for which will always annoy someone.
This implies that what is needed is a global way of managing the per-target tests. Currently the verbosity level is the only tool available. This is changed by setting the org.codehaus.gant.GantState.verbosity variable. However the system is somewhat silly in that you also need to explicitly transfer this to the AntBuilder instance:
import org.codehaus.gant.GantState GantState.verbosity = GantState.SILENT ant.logger.setMessageOutputLevel ( GantState.verbosity ) target ( sayHello : '' ) { println 'Hello' } target ( hello : 'Say hello.' ) { sayHello ( ) } setDefaultTarget ( hello )If manipulating the verbosity level is what this issue is about then the job of work is actually to make the setting of the verbosity level easier – both in Gant scripts and in the Gant source itself.
import org.codehaus.gant.GantState GantState.verbosity = GantState.SILENT ant.logger.setMessageOutputLevel ( GantState.verbosity ) target ( sayHello : '' ) { println 'Hello' } target ( hello : 'Say hello.' ) { sayHello ( ) } setDefaultTarget ( hello )