[EMAIL PROTECTED] wrote:

Please have a look at my updates to the DeleteTask that I sent earlier today.

These updates correspond with how Ant currently works, and no, I'm not saying that we should do everything exactly like Ant does, but in this case the Ant approach is correct: deleting a file or directory that doesn't exist, can never caused a BuildException, regardless of the FailOnError attribute.

By default, a message will be logged when you try to delete a file or directory that doesn't exist.  But it won't ever cause the build to fail.

I also added an attribute that allows you to specify whether you want any error messages to be logged at all when files or directories can't be deleted.  I take no credits for this, I borrowed this idea from using Ant.  This is very useful if you want to clean up temporary files in your build script, but you don't acutally care if the clean-up succeeds or not and you want to be bothered over and over again when files can't be deleted.
I assume you are talking about the quiet attribute. I'm wondering how this overlaps with previous discussions about logging level. ie if the logging level is at a certain level write the error otherwise don't. I'm not sure there is a need for the quiet attribute on individual tasks.

What some are actually asking for is a task that allows you to check if a file or directory exists.  This is not something that the Delete task is meant for.  The Delete task should just make sure that the directory or file(s) you specify does no longer exists if the task is executed successfull, that's all .. no more, no less ... I'll look into creating a task for checking if a file or directory exists in the next few days.  We should probable creating something similar to the Ant Available task .(http://ant.apache.org/manual/CoreTasks/available.html).

I'd personally like to hear more on Gerrys function support before we start adding <available> or <exists> tasks. I had a look at how those tags work in Ant and they seem a little clunky to me. By that I mean there are as many conditional tags as there are conditions which doesn't seem too extensible. Our <if> task fits into this category also. Although you only need a new attribute for a new condition.

Ants available task [1] isn't particularly well named or un-ambiguous. Its used to determine existence of either a file or a java class which seems like a fairly arbitrary combination to me. What I don't like about this approach to control flow is that you need a new tag for each boolean expression ie if you decided you wanted to check if a url was valid you'd need another tag. It all seems like one big workaround for not having proper expression evaluation. I much prefer the look of

<delete dir="foo" if="${DirectoryExists('foo')}"/>

to

<available file=foo" property="foo.exists"/>
<delete dir="foo" if="${foo.exists}"/>

which is only 1 line more but is less extensible and I think less readable. Its not really clear with out reading the doc that the <available> task is setting foo.exists based on the existence of foo.

refs:
[1] http://ant.apache.org/manual/CoreTasks/available.html


Gert



------------------------
 Gerry Shaw <[EMAIL PROTECTED]> wrote:
------------------------
	

On Wednesday, February 19, 2003, at 10:17 AM, [EMAIL PROTECTED] wrote:


Gerry:

The delete task will not raise an error and your directory foo will not
exist.
I liked the feature that Gert suggested, but I see Gerry's point. What
about this:

Add an attribute, say "ignore_failures" (name open to suggestions!) that
toggles the behavior described:
And how would this differ from setting failonerror to "false"?

For example,




I do see the point of it being a bit ugly when what you want to write a clean target and just delete a build folder but at the same time if the task by default ignored errors there would be no way to trigger a failure if that IS what the user wanted without adding a new attribute.


h
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers





-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers



-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to