Not 10 minutes, but I could give it a go later today....
--
dIon Gillard, Multitask Consulting
Work:      http://www.multitask.com.au
Developers: http://adslgateway.multitask.com.au/developers




"Vincent Massol" <[EMAIL PROTECTED]>
05/24/02 07:30 PM
Please respond to "Turbine Maven Developers List"

 
        To:     "'Turbine Maven Developers List'" 
<[EMAIL PROTECTED]>
        cc: 
        Subject:        RE: Checkstyle problem


When I started to write this email 30 minutes ago, here is what I
thought :

"
the problem is that the checkstyle task accepts <fileset>. So if you
want to specify 2 directories you would do it this way :

            <fileset dir="${src.core.dir}"/>
            <fileset dir="${src.test.dir}"/>

And this is not dynamic ...

We need to have as many <fileset> entries as there are <sourceDirectory>
entries in the POM ...
"

So I wrote a simple MavenCheckStyleTask that extends the checkstyle one
(see file attached). I was quite pleased with myself ...

However it did not solve the problem and I suddenly realized the problem
did not come from the checkstyle task but rather from the
checsktyle.dvsl stylsheet used to create the Checkstyle report :

    <dvsl
      basedir="."
      style="${maven.home}/stylesheets/checkstyle.dvsl"
      toolboxfile="${maven.home}/stylesheets/toolbox.props"
      in="${maven.build.dir}/checkstyle-raw-report.xml"
      out="${maven.gen.docs}/checkstyle-report.xml">
      <!-- Need to add the maven jar to load the toolbox -->
      <classpath>
        <path refid="maven-classpath"/>
      </classpath>
-->      <tool name="toolbox.string.srcDir" value="${maven.src.dir}"/>
    </dvsl>


Indeed the checkstyle task outputs absolute file names and the
checkstyle.dvsl truncates them, starting from ${maven.src.dir} ... argh!

And then suddenly the problem becomes more complex ...

One solution : Give a list of prefixes to dvsl (= the value of
"maven.src.set") and then let the dvsl script compare, for each file
name against this set, find the longest prefix that matches and removes
it from the file name.

My problem: I don't know dvsl at all ... Is there who could do this in
10 minutes here ? :-)

Thanks
-Vincent

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 24 May 2002 03:22
> To: Turbine Maven Developers List
> Subject: Re: Checkstyle problem
> 
> 
> How about we just make the path -> filelist happen in the maven
classes
> that set the properties up, and add this as a new property. This bit
one
> of
> my guys yesterday, so I agree this needs to be done.
> --
> dIon Gillard, Multitask Consulting
> Work:      http://www.multitask.com.au
> Developers: http://adslgateway.multitask.com.au/developers
> 
> 
> 
>                     "Vincent
>                     Massol"              To:     <turbine-maven-
> [EMAIL PROTECTED]>
>                     <vmassol@octo.       cc:
>                     com>                 Subject:     Checkstyle
problem
> 
>                     05/23/02 08:58
>                     PM
>                     Please respond
>                     to "Turbine
>                     Maven
>                     Developers
>                     List"
> 
> 
> 
> 
> 
> 
> Hi,
> 
> The checkstyle task uses ${maven.src.dir} as its fileset. The problem
> with this are :
> 
> 1/ If you have the following directory structure :
> 
> src
>   |_ java
>   |_ test
> 
> then the checkstyle reports give file name prefixed with java/ or
test/
> 
> but more importantly
> 
> 2/ it breaks the xref link (on the line number) as xref uses the
> maven.src.set sourcepathref (which I imagine come from the POM) to
> generate its html files.
> 
> Solution:
> 
> Use maven.src.set in the checkstyle task. However, we need to
transform
> maven.src.set into a patternset to be able to use it in a fileset ...
> 
> A solution I can see is to write an Ant task that does this. Something
> like :
> 
> <path2filelist patternsetid="new pattern set id">
>   <path ...>
> </path2filelist>
> 
> where <path...> accepts a pathid attribute referring to an already
> defined path set.
> 
> I'm sure there are other ways (especially with Ant 1.5). Do you know
any
> other ?
> 
> Thanks
> -Vincent
> 
> 
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-maven-dev-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:turbine-maven-dev-
> [EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Attachment: MavenCheckStyleTask.java
Description: Binary data

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to