You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by gl...@jpmorgan.com on 2005/06/01 00:00:32 UTC

srcdir attribute and element in the javac task

My impression from reading the docs was that the srcdir attribute and the
<src> element were interchangable when using the javac task. However when I
execute the code given below I get the message that srcdir attribute must
be set.

NOTE:
The reason that I need to have the fileset set up the way I do is the fact
that this script will be building various jar files in eclipse projects
sitting in various places on the directory tree laid out by my scm system.
This is done for project management purposes. Each project will be
guaranteed to exist only once in the directory tree.

<javac destdir="${build.dir}/coreFramework/classes" >
      <src>
        <fileset dir="${scm.dir}">
          <include name="**/${jar.project}/src" />
        </fileset>
      </src>
      <classpath>
        <fileset dir="${scm.dir}/">
          <include name="**/${jar.project}/lib/*.jar" />
        </fileset>
      </classpath>
    </javac>






This communication is for informational purposes only.  It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of J.P. Morgan Chase & Co., its subsidiaries and affiliates.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: srcdir attribute and element in the javac task

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Glenn,

this is not going to work.
you need something like that
 <javac destdir="${build.dir}/coreFramework/classes" >
       <src>
         <fileset dir="${scm.dir}/abc/project1/src"/>
         <fileset dir="${scm.dir}/abc/project2/src"/>
         <fileset dir="${scm.dir}/foo/bar/project4/src"/>
         <fileset dir="${scm.dir}/foo/bar/project3/src"/>
       </src>
       <classpath>
         <fileset dir="${scm.dir}/">
           <include name="**/${jar.project}/lib/*.jar" />
         </fileset>
       </classpath>
     </javac>

In other words, the base directory of filesets nested in the src element
of the javac task must always be the java package directories, where
typically you will have a first subdirectory com, ...
If you want to compile a variable number of projects at once like that,
you might have to generate your build.xml using a shell script or a
stylesheet.
What you can do would be to have a build.xml for each subproject (even if it
is mostly standard) and call each subproject build.xml using subant for
instance.

Cheers,

Antoine
> --- Ursprüngliche Nachricht ---
> Von: glenn.h.brown@jpmorgan.com
> An: "Ant Users List" <us...@ant.apache.org>
> Betreff: srcdir attribute and <src> element in the javac task
> Datum: Tue, 31 May 2005 17:00:32 -0500
> 
> 
> My impression from reading the docs was that the srcdir attribute and the
> <src> element were interchangable when using the javac task. However when
> I
> execute the code given below I get the message that srcdir attribute must
> be set.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org