Hi there. My 1st attempt at answering a question on this list ... so apologies if I make mistakes. I believe patternsets do have conditional attributes. See this link: http://ant.apache.org/manual/Types/patternset.html Quoting from that page: >>>>> Patterns can be grouped to sets and later be referenced by their id attribute. They are defined via a patternset element, which can appear nested into a FileSet or a directory-based task that constitutes an implicit FileSet. In addition, patternsets can be defined as a stand alone element at the same level as target — i.e., as children of project as well as as children of target. <<<<< The nested include element supports attributes "if" and "unless".
Hope this helps. Thanks, Parag Doke Save paper, save trees. Do not print emails/documents unless absolutely necessary. On Mon, Jul 4, 2011 at 8:29 AM, Gao Lin <aoi...@gmail.com> wrote: > Hi: > > I have a requirement to define a path according to a property. > > the command line: ant compile > will use the path : > <path id="test.lib.path.id"> > <fileset dir="${lib.dir}/test1"> > <include name="**/*.jar"/> > </fileset> > <fileset dir="${lib.dir}/test2"> > <include name="**/*.jar"/> > </fileset> > </path> > > and the command line: ant -Dtest=true compile > will use the following path: > <path id="test.lib.path.id"> > <fileset dir="${lib.dir}/test3"> > <include name="**/*.jar"/> > </fileset> > <fileset dir="${lib.dir}/test4"> > <include name="**/*.jar"/> > </fileset> > </path> > > There are many compile targets will use the path: test.lib.path.id, so > it would be better to define the path a little dynamically, like: > > <path id="test.lib.path.id" if="test"> > ... > </path> > > <path id="test.lib.path.id" unless="test"> > ... > </path> > > but I think path does not support this attribute, right? > > -- > Thanks and Best Regards > > aoi...@gmail.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@ant.apache.org > For additional commands, e-mail: user-h...@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org