ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <>
Subject Re: <available> problem
Date Tue, 20 Mar 2001 00:13:52 GMT
----- Original Message -----
From: "Vincent Massol" <>
To: <>
Sent: Monday, March 19, 2001 7:40 PM
Subject: Re: <available> problem

> Yes, you're right for the "if" attribute. I was more concerned about the
> <available> task. It shouldn't define the property if the file cannot be
> found, right ? Or am I missing something ...
That's true, it doesn't seem to work like expected.

<?xml version="1.0"?>
<project name="test" default="default" basedir=".">
  <target name="default">
   <available file="" property="yes"/>
   <echo message="${yes}"/>

results in

Buildfile: build.xml

     [echo] true


Unfortunately there does not seem to be a good solution to this problem. The
available-task simply gets handed over file from the "parser" and the parser
constructs these files using the "basedir". First solution would be to pass
a String to available and let it construct the file itself (failing if the
passed filename is the empty string); second solution would be to declare it
correct and don't change it :-)


View raw message