You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Scott Ellsworth <sc...@alodar.com> on 2002/08/15 04:03:27 UTC

Should depend be able to take a dirset?

Hi, all.

I am using ant 1.5 with a system where a given build may have source in 
${project.work.dir}/source, ${project.work.dir}/generated-source, or 
both.

I have defined
   <dirset id="compile.source.dirs" dir="${project.work.dir}">
     <include name="source"/>
     <include name="source-generated"/>
   </dirset>

javac is copacetic:

   <target name="compile" depends="depend" description="Compile java 
files into class files" if="compile.source.exists">
     <javac
       destdir="${compile.classes}"
       includes="${compile.includedFiles}"
       excludes="${compile.excludedFiles}"
       <src>
         <dirset refid="compile.source.dirs">
       </src>
     </javac>
   </target>

but if I try to do the corresponding depend:

   <target name="depend" depends="test-source-exists" 
if="compile.source.exists">
     <depend
       destdir="${compile.classes}"
       cache="${compile.depcache}"
       closure="yes"
       excludes="${compile.excludedFiles}"
       includes="${compile.includedFiles}">
       <src>
         <dirset refid="compile.source.dirs">
       </src>
     </depend>
   </target>

I get the error

file:/Users/work/Documents/coding/isis/source/build/standard-
build.xml:134: The <depend> task doesn't support the nested "src" 
element.


Is there any way to do this?

Scott


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Should depend be able to take a dirset?

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 14 Aug 2002, Scott Ellsworth <sc...@alodar.com> wrote:

> file:/Users/work/Documents/coding/isis/source/build/standard-
> build.xml:134: The <depend> task doesn't support the nested "src"
> element.
> 
> Is there any way to do this?

Convert your <path> to a property (via <property refid=.../>) and pass
that to the srcDir attribute of <depend>.  srcdir is a path, not a
directory.

Adding nested <src> to <depend> would be better, but wouldn't be there
before Ant 1.6.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>