Re: Simple ant question.
Re: Simple ant question.
- Subject: Re: Simple ant question.
- From: Q <email@hidden>
- Date: Sun, 17 Jun 2007 17:26:49 +1000
On 17/06/2007, at 3:10 PM, Ray Kiddy wrote:
On Jun 16, 2007, at 9:26 PM, Q wrote: I am reworking the WAR and SSDD targets in a build.xml file and am trying to add some error checking. I can verify that individual files like web.xml and LICENSE exist, but I also want to check if all the required frameworks in my ant.frameworks.wo.wolocalroot file exist as jars in /Library/WebObjects/lib while building the war file (like xcode does).
I can create the file list I need to check easily enough, but I am not sure how to get ant to verify that a list of files exist, or even iterate over a list checking them individually. I would prefer to do this without having to add additional taskdef dependencies other than woproject.
Any suggestions?
It is possible to do "if-then-else" style logic in ant. It is just extremely awkward. To tell the truth, every time I need to do it, I need to re-learn it. It is just very non-intuitive. You want to look very carefully at the documentation for the <condition> task, the <available> task and a few others. Maybe a third-party task handles it more nicely.
Yes, functionality exists in the ant-contrib library I believe, but I am trying to avoid additional dependancies if I can. Ant is much happier trying to find a resource for you. If you want to check whether the /System/Library/Frameworks/JavaFoundation.framework directory exists and fail if it does not, that is a bit awkward. If you want to say find the framework in one place, or else in another, or finally in a third, ant is much happier about doing that.
For example: ... ... The words in the "unless" are the names of properties. One can, of course, set a property to equal the property name. One ends up expressing the "if-then-else" logic by setting properties and keying actions off of them.
Not exactly crystal clear, no? But it is possible. It just ends up looking weird.
That's not quite the problem I am trying to solve. I have a list of files (not just one) that isn't known until runtime that gets imported into a property with <loadfile> that I later use as a <fileset> include list, but I want to verify they exist first. If one doesn't exist then I want to print an error with its name and abort. I need some way to iterate over a <filelist> if I am to use something like <available> which only accepts a single file for evaluation.
-- Seeya...Q
Quinton Dolan - email@hidden Gold Coast, QLD, Australia Ph: +61 419 729 806
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden