You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Alexis Votta <al...@gmail.com> on 2007/10/08 12:50:48 UTC

How to include a single Java file in javac task?

Currently, my compile target is as follows.

  <target name="compile">
    <mkdir dir="${build.classes.dir}"/>
    <javac srcdir="${src.dir}" destdir="${build.classes.dir}"/>
  </target>

So, it compiles everything in ${src.dir}.

Apart from this I want to add one single Java file to be compiled.
Therefore, I want:

1. All Java files in ${src.dir} to be compiled.
2. rt/src/Crypto.java to be compiled.

How can I do this?

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


Re: How to include a single Java file in javac task?

Posted by Prashant Reddy <pr...@pramati.com>.
Try :
<javac srcdir="rt/src" destdir="${build.classes.dir}">
  <includes name="Crypto.java"/>
</javac>


On Mon, 2007-10-08 at 16:20 +0530, Alexis Votta wrote:
> Currently, my compile target is as follows.
> 
>   <target name="compile">
>     <mkdir dir="${build.classes.dir}"/>
>     <javac srcdir="${src.dir}" destdir="${build.classes.dir}"/>
>   </target>
> 
> So, it compiles everything in ${src.dir}.
> 
> Apart from this I want to add one single Java file to be compiled.
> Therefore, I want:
> 
> 1. All Java files in ${src.dir} to be compiled.
> 2. rt/src/Crypto.java to be compiled.
> 
> How can I do this?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


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