topless
topless

Reputation: 8221

How can I exclude my tests package from source folder in an ant build file?

I have the following declaration in my build.xml file, in my src folder I have my test package which I don't want to include into my process. How can I force scrdir to read everything from ${src.dir} except test package?

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

Upvotes: 3

Views: 4195

Answers (2)

stacker
stacker

Reputation: 68962

http://ant.apache.org/manual/Tasks/javac.html

<target name="compile">   
    <javac srcdir="${src.dir}" destdir="${classes.dir}"
           excludes="mypackage/p1/testpackage/**"/>

</target> 

Upvotes: 6

Inv3r53
Inv3r53

Reputation: 2959

javac has excludes attribute where you can exclude the packages.

Upvotes: 3

Related Questions