ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Validating task attributes
Date Thu, 01 Jun 2000 13:21:46 GMT

You could do it at either time; it really depends on the task and how soon
you want to catch potential errors.  Any property replacement for an
attribute is done at parse time (well, right now anyway.  The proposed spec
indicates that it should be done just before target execution -  If
you want your whole build to fail due to bad attribute values, I would
throw a BuildException during your init() method.  If you want more control
and the ability to fail gracefully, I would suggest doing damage control
during the execute() method.

My $0.02.

Glenn McAllister
TID - Software Developer - VisualAge for Java
IBM Toronto Lab, (416) 448-3805
"An approximate answer to the right question is better than the
right answer to the wrong question." - John W. Tukey

When is the appropriate time to validate the values of the attributes for a
task: when the attribute is set (I assume this happens at parse time), or
when the attribute would be used (for instance, in execute())?

Craig S. Cottingham
PGP key available from:
PGP fingerprint=6AA8 2E28 2404 8A95 B8FC 7EFC 136F 0CEF A2FF BE41

View raw message