Hi, Thanks for this input. I changed my directive per your suggestion ...
<fileset dir="${srcDir}/com" includes="**/*.java">
<exclude name="${srcDir}/com/myco/ssml/**/*.java" />
<exclude
name="${srcDir}/com/myco/regui/provisioning/**/*.java" />
</fileset>
but checkstyle is still examining files I don't want it to. The "**" means a
max of two levels deep? I got the same number of messages as before (some
included below). Anyway to get the build to crash if something I entered
doesn't exist or is invalid? - Dave
[checkstyle]
C:\Temp\Routing_Engine\ui\src\com\myco\ssml\account\types\Account.java:64:42:
warning: 'status' hides a field.
[checkstyle]
C:\Temp\Routing_Engine\ui\src\com\myco\ssml\account\types\Account.java:74:42:
warning: 'source' hides a field.
[checkstyle]
C:\Temp\Routing_Engine\ui\src\com\myco\ssml\account\types\Account.java:84:46:
warning: 'reasonCode' hides a field.
[checkstyle]
C:\Temp\Routing_Engine\ui\src\com\myco\ssml\account\types\Device.java:14:46:
warning: 'autoDiscSN' hides a field.
> -------Original Message-------
> From: Brian Stephenson <[email protected]>
> Subject: Re: Excluding some directories
> Sent: Feb 24 '09 18:14
>
> I think the problem is you only told your fileset to exclude java
> files in the /com/myco/ssml directory itself, not in directories below
> it in the tree. You need to do that. I haven't actually run this in a
> test setting, so it may need a little syntax goosing, but here goes:
>
> Since you only have one "include" setting in your fileset, you can
> move it up to be a direct attribute of the fileset element, then you
> can enter a sub-element of the fileset element called "depth", which
> tells fileset how many directories deep to go from your base directory
> (here it is "${srcDir}/com") to match your fileset includes and
> excludes. The fileset code SHOULD (I believe) look like this:
>
> <fileset dir="${srcDir}/com" includes="**/*.java">
> <exclude name="${srcDir}/com/myco/ssml/**/*.java" />
> <exclude name="${srcDir}/com/myco/regui/provisioning/**/*.java" />
> <depth max=2 />
> </fileset>
>
> I put two as the max depth, as the files still being examined by
> checkstyle were two deep from the base directory of the fileset, as
> described in your error messages. If you have deeper directories,
> adjust that number as needed.
>
> Brian
>
> On Feb 24, 2009, at 12:00 PM, <[email protected]> wrote:
>
> > Hi Brian,
> >
> > I put in the directive much as you have it ...
> >
> > <target name="check" description="compile source">
> > <taskdef resource="checkstyletask.properties" >
> > <classpath refid="checkstyle.class.path"/>
> > </taskdef>
> > <checkstyle config="${checkstyleCetFile}">
> > <fileset dir="${srcDir}/com">
> > <include name="**/*.java" />
> > <exclude name="${srcDir}/com/myco/ssml/*.java"
> />
> > <exclude
> name="${srcDir}/com/myco/regui/provisioning/
> > *.java" />
> > </fileset>
> > <formatter type="plain"/>
> > <formatter type="xml" toFile="${checkstyleErrorsXmlFile}"/
> > >
> > </checkstyle>
> > <style in="${checkstyleErrorsXmlFile}" out="$
> > {checkstyleErrorsHtmlFile}" style="${docsDir}/checkstyle-simple.xsl"/>
> > </target>
> >
> > But the task is still examining files in the directories I want to
> > exclude . Is this a checkstyle task problem? Below are some of the
> > warnings I get. Thanks, - Dave
> >
> >
> > [checkstyle] C:\Temp\Routing_Engine\ui\src\com\myco\ssml\account
> > \types\Account.java:24:49: warning: 'billingRegion' hides a field.
> > [checkstyle] C:\Temp\Routing_Engine\ui\src\com\myco\ssml\account
> > \types\Account.java:34:52: warning: 'cdvPhoneNumber' hides a field.
> > [checkstyle] C:\Temp\Routing_Engine\ui\src\com\myco\ssml\account
> > \types\Account.java:44:61: warning: 'house' hides a field.
> > [checkstyle] C:\Temp\Routing_Engine\ui\src\com\myco\ssml\account
> > \types\Account.java:54:40: warning: 'name' hides a field.
> > [checkstyle] C:\Temp\Routing_Engine\ui\src\com\myco\ssml\account
> > \types\Account.java:64:42: warning: 'status' hides a field.
> >
> >
> >
> >
> >
> >
> >> -------Original Message-------
> >> From: Brian Stephenson <[email protected]>
> >> Subject: Re: Excluding some directories
> >> Sent: Feb 24 '09 16:26
> >>
> >> 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, <[email protected]>
> >> 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: [email protected]
> >>> For additional commands, e-mail: [email protected]
> >>>
> >>
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]