How can I exclude the test package from the source folder in the ant build file?

I have the following declaration in my build.xml file, in my src folder I have my own test package, which I do not want to include in my process. How can I get scrdir to read everything from $ {src.dir} except the test suite?

<target name="compile">  
    <javac srcdir="${src.dir}" destdir="${classes.dir}"/>
</target>
+3
source share
2 answers

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

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

</target> 
+6
source

javac has an attribute excludeswhere you can exclude packages.

+3
source

Source: https://habr.com/ru/post/1746954/


All Articles