Thanks Diane/Dominique to make some things clear to me. Unless, a person gets such clarification from the user group one does not know many things with just the ant user manual. Like, the manual does not say that <fileset> inside <path> tag can be used only for jar files and not source files. Or that path-like elements are to be used only for directories. I want to address this problem to the dev group as well. Sorry for the bandwidth.
Secondly, I want to know why the ant developers thought that <src> should be a path like element where we can specify only directories and <classpath> can be a path like element which can take jar files too. Why can't <src> be a path like structure which can take source files too? What do I do when I want to define all the source file patterns at one place and just use the refid in the javac task? Thanks, Gurdev ----- Original Message ----- From: "Diane Holt" <[EMAIL PROTECTED]> To: "Ant Users List" <[EMAIL PROTECTED]> Sent: Friday, April 26, 2002 12:13 PM Subject: Re: Path, refid, <src> > --- Gurdev Parmar <[EMAIL PROTECTED]> wrote: > > But did you notice that I had used a <fileset> tag inside > > path to describe a set of files? > > Yes, I did -- but I also noticed that the files pointed to by that > <fileset> wouldn't make much sense inside a <path>, and certainly not one > destined to be referenced in a nested <src> element for the <javac> task, > since that's used to point to source directories and can't contain any > files at all (not even ones that could conceivably be in a <path>, such as > .jar and .zip files), which is why it barked at you about the .java file > not being a directory. > > > This is the example that ant documentation gives, on the basis > > of which I was working on: > > But note that the documentation example shows jar files being included in > the path, not .java source files. > > If the only place you intend to reference the set of files you're trying > to group together is in your <javac> task, you can skip the whole thing > and just specify them in your <javac> task directly -- but not within a > nested <src> element. Assuming all the files you want to compile live in > subdirs down from a single common directory, just point the 'srcdir' > attribute to the top of your package hierarchy and use nested <include> > elements to specify the files you want. If you need to specify more than > one directory under which the source files are to be found, then you can > either do that by listing them in 'srcdir' as a path-type list (eg., > srcdir="dir1:dir2") or by using nested <src> elements -- eg: > <src path="dir1"/> > <src path="dir2"/> > or as a 'refid' to a (valid) <path>. > > Diane > > ===== > ([EMAIL PROTECTED]) > > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Games - play chess, backgammon, pool and more > http://games.yahoo.com/ > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>