You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Alain ROY <ar...@free.com> on 2007/10/24 12:39:43 UTC
Fileset group
Hi all,
I use ant 1.7.0 and Checkstyle 4.3 Ant task.
I want to use a <checkstyle ...> task which accepts <fileset> nested elements.
I have up to 20 Java projects I want to process with checkstyle in one time. I'd like to define a fileset which is the composition of filesets with *.java source files of several source directories of my 20 projects (a sort of group of filesets), so I could reference only one fileset in the checkstyle task.
<fileset id="fileset.prj1.src1" dir="${prj1.src1}">
<include name="**/*.java"/>
</fileset>
<fileset id="fileset.prj1.src2" dir="${prj1.src2}">
<include name="**/*.java"/>
</fileset>
<fileset id="fileset.prj2.src1" dir="${prj2.src1}">
<include name="**/*.java"/>
</fileset>
.....
Is there a way to do that ?
Regards
AR
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Fileset group
Posted by Peter Reilly <pe...@gmail.com>.
You could try the pathtofileset task in ant-contrib:
http://ant-contrib.sourceforge.net/tasks/tasks/pathtofileset.html
Peter
On 10/25/07, Alain ROY <ar...@sylob.com> wrote:
>
> Usage of <for> is not possible in my case because if I do so, I can't get a single checkstyle report for all my java sources. The report file is overwritten every time I invoke checkstyle.
>
> Regards
>
> On Thu, 25 Oct 2007 10:05:37 +0200
> "Rebhan, Gilbert" <Gi...@huk-coburg.de> wrote:
>
> >
> >
> > -----Original Message-----
> > From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
> > Sent: Thursday, October 25, 2007 7:49 AM
> > To: Ant Users List
> > Subject: RE: Fileset group
> >
> > /*
> > i didn't use the checkstyle task but if it works
> > like other tasks, you may use =
> >
> > <path id="checkstyle_all">
> > <fileset id="fileset.prj1.src1" dir="${prj1.src1}">
> > <include name="**/*.java"/>
> > </fileset>
> > <fileset id="fileset.prj1.src2" dir="${prj1.src2}">
> > ...
> > </path>
> >
> > and later in <checkstyle> task just use the refid, something like =
> > ..
> > */
> >
> > of course it has to be
> >
> > <checkstyle ...>
> > <path refid="checkstyle_all"/>
> > ...
> > </checkstyle>
> >
> > if <checkstyle> task doesn't support path (as for example the copy task)
> > then use antcontrib <for> like that =
> >
> > <for param="fileset" list="fileset.prj1.src1,fileset.prj1.src2, ...">
> > <sequential>
> > <checkstyle ...>
> > <fileset refid="@{fileset}"/>
> > </checkstyle>
> > </sequential>
> > </for>
> >
> >
> > Regards, Gilbert
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
>
> --
> Alain ROY <ar...@sylob.com>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Fileset group
Posted by Alain ROY <ar...@sylob.com>.
Usage of <for> is not possible in my case because if I do so, I can't get a single checkstyle report for all my java sources. The report file is overwritten every time I invoke checkstyle.
Regards
On Thu, 25 Oct 2007 10:05:37 +0200
"Rebhan, Gilbert" <Gi...@huk-coburg.de> wrote:
>
>
> -----Original Message-----
> From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
> Sent: Thursday, October 25, 2007 7:49 AM
> To: Ant Users List
> Subject: RE: Fileset group
>
> /*
> i didn't use the checkstyle task but if it works
> like other tasks, you may use =
>
> <path id="checkstyle_all">
> <fileset id="fileset.prj1.src1" dir="${prj1.src1}">
> <include name="**/*.java"/>
> </fileset>
> <fileset id="fileset.prj1.src2" dir="${prj1.src2}">
> ...
> </path>
>
> and later in <checkstyle> task just use the refid, something like =
> ..
> */
>
> of course it has to be
>
> <checkstyle ...>
> <path refid="checkstyle_all"/>
> ...
> </checkstyle>
>
> if <checkstyle> task doesn't support path (as for example the copy task)
> then use antcontrib <for> like that =
>
> <for param="fileset" list="fileset.prj1.src1,fileset.prj1.src2, ...">
> <sequential>
> <checkstyle ...>
> <fileset refid="@{fileset}"/>
> </checkstyle>
> </sequential>
> </for>
>
>
> Regards, Gilbert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
--
Alain ROY <ar...@sylob.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Fileset group
Posted by Alain ROY <ar...@sylob.com>.
Hi,
Thanks for your answer.
Problem : <checkstyle> type doesn't support the nested "path" element.
Regards
On Thu, 25 Oct 2007 10:05:37 +0200
"Rebhan, Gilbert" <Gi...@huk-coburg.de> wrote:
>
>
> -----Original Message-----
> From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
> Sent: Thursday, October 25, 2007 7:49 AM
> To: Ant Users List
> Subject: RE: Fileset group
>
> /*
> i didn't use the checkstyle task but if it works
> like other tasks, you may use =
>
> <path id="checkstyle_all">
> <fileset id="fileset.prj1.src1" dir="${prj1.src1}">
> <include name="**/*.java"/>
> </fileset>
> <fileset id="fileset.prj1.src2" dir="${prj1.src2}">
> ...
> </path>
>
> and later in <checkstyle> task just use the refid, something like =
> ..
> */
>
> of course it has to be
>
> <checkstyle ...>
> <path refid="checkstyle_all"/>
> ...
> </checkstyle>
>
> if <checkstyle> task doesn't support path (as for example the copy task)
> then use antcontrib <for> like that =
>
> <for param="fileset" list="fileset.prj1.src1,fileset.prj1.src2, ...">
> <sequential>
> <checkstyle ...>
> <fileset refid="@{fileset}"/>
> </checkstyle>
> </sequential>
> </for>
>
>
> Regards, Gilbert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
--
Alain ROY <ar...@sylob.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: Fileset group
Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
-----Original Message-----
From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
Sent: Thursday, October 25, 2007 7:49 AM
To: Ant Users List
Subject: RE: Fileset group
/*
i didn't use the checkstyle task but if it works
like other tasks, you may use =
<path id="checkstyle_all">
<fileset id="fileset.prj1.src1" dir="${prj1.src1}">
<include name="**/*.java"/>
</fileset>
<fileset id="fileset.prj1.src2" dir="${prj1.src2}">
...
</path>
and later in <checkstyle> task just use the refid, something like =
..
*/
of course it has to be
<checkstyle ...>
<path refid="checkstyle_all"/>
...
</checkstyle>
if <checkstyle> task doesn't support path (as for example the copy task)
then use antcontrib <for> like that =
<for param="fileset" list="fileset.prj1.src1,fileset.prj1.src2, ...">
<sequential>
<checkstyle ...>
<fileset refid="@{fileset}"/>
</checkstyle>
</sequential>
</for>
Regards, Gilbert
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: Fileset group
Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
Hi,
-----Original Message-----
From: Alain ROY [mailto:armaillist@free.com]
Sent: Wednesday, October 24, 2007 12:40 PM
To: user@ant.apache.org
Subject: Fileset group
/*
I want to use a <checkstyle ...> task which accepts <fileset> nested
elements.
I have up to 20 Java projects I want to process with checkstyle in one
time. I'd like to define a fileset which is the composition of filesets
with *.java source files of several source directories of my 20 projects
(a sort of group of filesets), so I could reference only one fileset in
the checkstyle task.
<fileset id="fileset.prj1.src1" dir="${prj1.src1}">
<include name="**/*.java"/>
</fileset>
<fileset id="fileset.prj1.src2" dir="${prj1.src2}">
<include name="**/*.java"/>
</fileset>
<fileset id="fileset.prj2.src1" dir="${prj2.src1}">
<include name="**/*.java"/>
</fileset>
.....
Is there a way to do that ?
*/
i didn't use the checkstyle task but if it works
like other tasks, you may use =
<path id="checkstyle_all">
<fileset id="fileset.prj1.src1" dir="${prj1.src1}">
<include name="**/*.java"/>
</fileset>
<fileset id="fileset.prj1.src2" dir="${prj1.src2}">
<include name="**/*.java"/>
</fileset>
<fileset id="fileset.prj2.src1" dir="${prj2.src1}">
<include name="**/*.java"/>
</fileset></path>
and later in <checkstyle> task just use the refid, something like =
<checkstyle ...>
<fileset refid="checkstyle_all"/>
...
</checkstyle>
Regards, Gilbert
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org