ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Murdoch" <adammurdoch...@yahoo.com>
Subject RE: use of 'includes' attribute in javac
Date Sun, 30 Dec 2001 05:30:03 GMT

Hi,

The 'includes' attribute is used to select files from under srcdir.  For
example, in your case,

<javac
  srcdir="~/dev/test/servlets/src/classes"
  includes="EJB*">

would pick up ~/dev/test/servlets/src/classes/EJBClientServlet.java.  Have a
read of the "Concepts and Types" section of the manual (under "Built-in
Tasks") for more info.

Looks like you simply need to add a second srcdir to the <javac> task:

<javac destdir="..." classpath="...">
    <src location="${src.home}"/>
    <src location="~/dev/examples"/>
</javac>


Adam

> -----Original Message-----
> From: Jim Clayson [mailto:jimc@netcomuk.co.uk]
> Sent: Saturday, 29 December 2001 8:37 PM
> To: ant-user@jakarta.apache.org
> Subject: use of 'includes' attribute in javac
>
>
> Hi,
>
> Ant version 1.4
>
> I am trying to compile my test java files - one of which refers to .java
> files in a completely seperate package. The compilation fails saying,
> "package org.jboss.docs.cmp.cd.bean does not exist
>     [javac] import org.jboss.docs.cmp.cd.bean.*; ..."
>
> My hierarchy is as follows:
> (link to /usr/local/dev in home dir)
>
> ~/dev/examples/org/jboss/docs/cmp/cd/bean/*.java
> ~/dev/examples/org/jboss/docs/cmp/cd/interfaces/*.java
> ~/dev/test/servlets/src/classes/TestServlet.java
> ~/dev/test/servlets/src/classes/EJBClientServlet.java  (This one
> contains the ejb import stmts)
>
> My ant's compile target looks like this:
>
>          <target name="compile" depends="prepare">
>                 <javac  srcdir="${src.home}"
>                         destdir="/tmp/unwrap/boo"
>                         classpath="${classpath}"
>                         debug="on">
>
>                 </javac>
>         </target>
>
> The ${src.home} is /usr/local/dev/test/servlets/src/classes. This I know
> because when I rename EJBClientServlet.java to EJBClientServlet.Lava the
> compilation succeeds i.e. only with TestServlet.java.
>
> How do I tell ant where to find the package I want to tap? I have tried
> using the includes attribute but then nothing is compiled at all.
> Then I searched the archives and google groups and have so far come up
> empty-handed (so it might be something pretty simple but I can't seem to
> find it.)
> I could probably include the package in the nested 'src' tag but then
> what is 'includes' for?
>
> The explanation in the online manual says the following with regard to
> using 'includes' with javac:
>
> 'comma-separated list of patterns of files that must be included; all
> files are included when omitted.'
>
> What does 'all files are included when omitted' mean? Does it mean all
> files all over the world are included? If it does, then if I use include
> 'org.jboss.docs.cmp.cd.**' and get nothing compiled, by leaving it out I
> should have the package included by leaving it out!
>
> I would really appreciate someone's help on this as I'm running around
> in circles.
>
>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:ant-user-help@jakarta.apache.org>


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


Mime
View raw message