You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by da...@remanresource.com on 2009/02/24 16:29:33 UTC

Excluding some directories

Hi,

I'm using Ant 1.6.  I have this task ...

    <target name="check" description="compile source">
       	<taskdef resource="checkstyletask.properties" >
    		<classpath refid="checkstyle.class.path"/>
       	</taskdef>
       	<checkstyle config="${checkstyleCetFile}">   
       		<fileset dir="${srcDir}/com" includes="**/*.java"/> 
        	<formatter type="plain"/>
        	<formatter type="xml" toFile="${checkstyleErrorsXmlFile}"/>       		 
       	</checkstyle>
    	<style in="${checkstyleErrorsXmlFile}" out="${checkstyleErrorsHtmlFile}" style="${docsDir}/checkstyle-simple.xsl"/>
    </target>

I want to modify my <fileset> clause such that it includes all .java files in that directory except for java files within com/myco/ssml and com/myco/provisioning .  How would I change the clause to exclude these two directories?

Thanks, - Dave

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


Re: Excluding some directories

Posted by Brian Stephenson <bs...@thortech-solutions.com>.
Try re-formatting your checkstyle fileset attribute to look something  
like this:


<fileset dir="${srcDir}/com" >
       <include name="**/*.java"/>
       <exclude name="${srcDir}/com/myco/ssml/*.java"/>
       <exclude name="${srcDir}/com/myco/provisioning/*.java"/>
</fileset>

Brian

On Feb 24, 2009, at 10:29 AM, <da...@remanresource.com> wrote:

> Hi,
>
> I'm using Ant 1.6.  I have this task ...
>
>    <target name="check" description="compile source">
>       	<taskdef resource="checkstyletask.properties" >
>    		<classpath refid="checkstyle.class.path"/>
>       	</taskdef>
>       	<checkstyle config="${checkstyleCetFile}">
>       		<fileset dir="${srcDir}/com" includes="**/*.java"/>
>        	<formatter type="plain"/>
>        	<formatter type="xml" toFile="${checkstyleErrorsXmlFile}"/ 
> >       		
>       	</checkstyle>
>    	<style in="${checkstyleErrorsXmlFile}" out="$ 
> {checkstyleErrorsHtmlFile}" style="${docsDir}/checkstyle-simple.xsl"/>
>    </target>
>
> I want to modify my <fileset> clause such that it includes all .java  
> files in that directory except for java files within com/myco/ssml  
> and com/myco/provisioning .  How would I change the clause to  
> exclude these two directories?
>
> Thanks, - Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>