ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: <exclude> not working for <javac> having multiple <src> tags
Date Wed, 07 Mar 2012 04:50:16 GMT
On 2012-03-07, Surya Kiran wrote:

> I have a <javac> task as below

> <javac destdir="${build}"
>          classpath="xyz.jar"
>          debug="on">

>     <src path="${src}"/>
>     <src path="${src2}"/>

>     <include name="mypackage/p1/**"/>
>     <include name="mypackage/p2/**"/>

>     <exclude name="mypackage/p1/testpackage/**"/>
> </javac>

> But <exclude> is not working.

By "exclude is not working" I assume javac compiles classes in
mypackage/p1/testpackage/** - right?  Why do you think the presence of
more than one <src> element is the problem?

The include/exclude elements only control which source files Ant
considers when putting together the command line.  It will not pass any
source files under mypackage/p1/testpackage/ as files to compile to
javac.  You can run "ant -verbose" to verify that.

There may be other reasons why javac decides to still compile those
classes.  In particular if one of the other classes references a class
in mypackage.p1.testpackage - after all javac knows where to look for
them.

Stefan

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


Mime
View raw message