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: [email protected]
For additional commands, e-mail: [email protected]