ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: per-task diagnostics
Date Mon, 12 Feb 2007 11:47:34 GMT
>I've been thinking about how we could improve our diagnostics, 
>by moving 
>more of the diags into tasks themselves. Every task could have a 
>diagnostics(PrintStream) method that would be called to do the diags.
>With this the -diagnostics routine could run through all tasks that it 
>knows about, creates them, and for everyone one that can be created, 
>asks for its diagnostics.
>This would move logic into the tasks, let junit be aware about its 
>needs, xslt and junit report probe for an XSL engine, etc.

Sounds good. In that way eg the optional tasks could print their needed
libraries when not present.
  script: No scripting engine available - install BSF or use Java 6. See

>1. we could introspect for a public static void
>throws BuildException method. This would let us diagnose even if you 
>cannot instantiate the task enough for new() to work.
>2. or we'd use an interface Diagnostics that things could implement

Add an empty 
  public void diagnostics(PrintStream) throws BuildException 
method to Task?

Mmh ... I would prefer a helper object
  Task {
    public void diagnostics(DiagnosticsHelper) throws BuildException 
  DiagnosticsHelper {
    write(PrintStream)  // direct access to output
    write(Object)       // direct access to output
    newLine()           // prints a new line directly to output
    print(Object)       // handles indents and prefixes
    setPrefix(String)   // the prefix to use; set while processing the
several tasks

>3. the -diagnostics command and <diagnostics> tasks could be made to 
>diagnose a single task
>  ant -diagonistics -task junit
>and maybe even a single antlib namespace
>  ant -diagnostics -xmlns antlib:org.example.something

While I think that it's a good idea to narrow the output I dont like
that kind of parameters:
>  ant -diagonistics -task junit
"junit" would normally be the name of a target ...
What about special properties? ant.diagnostics=junit

Ok, your way would be easier for the user ....
When using -diagonistics, do we process the target names? If not why not
simply use
  ant -diagonistics 
  ant -diagonistics junit
  ant -diagonistics antlib:org.example.something
or in combination
  ant -diagonistics junit antlib:org.example.something copy ...


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message