It sure would be nice, but since it isn't you're left doing it the long, and complicated, way. That is, creating additional targets with dependencies and conditions to get the desired conditional behavior. The property can be set as follows.
<target name="mod_classdir.check"> <condition property="mod_classdir.exists"> <available file="${mod_classdir}" type="dir"/> </condition> </target> -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, December 06, 2004 1:58 PM To: Ant Users List Subject: Re: fileset fails when base dir is missing That's a clever hack, but it won't work well in my situation, since some of the filesets may be rooted in directories that cannot be created. Wouldn't it be nice if the <fileset> tag had an attribute that allowed you do say, "It's OK if it doesn't exist"? Something like this: <fileset dir="somedir" if-base-dir-is-missing="ignore">...</fileset> Anyone else have a good idea? "Alexey N. Solofnenko" <[EMAIL PROTECTED]> wrote on 12/06/2004 12:44:29 PM: > I usually execute <mkdir> in this situation - an empty directory does > not affect anything else and makes some commands happy. > > - Alexey. > > [EMAIL PROTECTED] wrote: > > >I am constructing a classpath that includes a fileset. Sometimes, the > >base directory for that fileset does not exist. I would like Ant to > >simply accept this as an empty fileset and move on. Instead, Ant quits > >with an error, complaining that the directory is not found. How should > >I > >resolve this problem? > > > >In other words... > > > ><path id="cp"> > > <fileset dir="lib" includes="**/*.jar"/> > > <pathelement location="a.jar"/> > > <pathelement location="b.jar"/> > > <pathelement location="c.jar"/> > ></path> > ><javac > > destdir="${classes}" > > > > > > <src path="${src}"/> > > <classpath> > > <path refid="cp"/> > > </classpath> > ></javac> > > > >...fails if the "lib" folder does not exist. I would rather have Ant > >just > >keep on going. Any ideas? > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]