You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Christofer Dutz <ch...@c-ware.de> on 2014/09/05 12:32:53 UTC

Migrating Flex PMD to latest PMD version

Hi,


even if I got a lot of stuff working with FlexPMD, I was still having problems with the report-plugins for maven complaining about API incompatabilities. It seems that this is due to changes in the maven report and site plugin. I decided not to fix these problems, but so solve them by updating FlexPMD to PMD 5.1.3 as well as the latest pmd maven plugin. After migrating almost everything to the new versions I am now blocked by one issue which i hope the PMD guys will answer soon.


In PMD 5.x a rule has to specify the language it is designed for. This allows to create mixed rule-sets. Unfortunately the supported languages are hard-coded into PMD (net.sourceforge.pmd.lang.Language?) and I currently see no way in which I could make FlexPMD extend this. Extending it in PMD itself sort of sounds problematic too, because I doubt they will add a language for which the implementation is outside of their project.


So I haven't dropped the ball ... I am just expecting to have a little stall on my work here.


Chris

AW: Migrating Flex PMD to latest PMD version

Posted by Christofer Dutz <ch...@c-ware.de>.
Ok ... so I pulled the latest PMD version and had  a look.

To me it looks as if Adobe sort of used PMD code and created defived implementations of PMD classes in order to add Flex support. The way PMD has changed their codebase, I guess this is no longer possible without using some really nasty hackery. But to me it looks as if we were to add flex to PMD it would make maintaining everything a lot easier as we could directly use the PMD infrastructure and wouldn't have to provide dedicated ant tasks and maven plugins or reporting-plugins.

Currently PMD seems to be rather monolitic so all Languages are included inside the one and only pmd jar ... I'll talk to them about modularizing this ... cause I think it would be great if every language would have ist own maven module and we could simply provide one of these modules. So if someone uses flex, he would have to add a plugin-dependency to our flex language support module.

Hopefully they respond to posts on their mailinglist ;-)

Chris

-----Ursprüngliche Nachricht-----
Von: Alex Harui [mailto:aharui@adobe.com] 
Gesendet: Freitag, 5. September 2014 18:22
An: dev@flex.apache.org
Betreff: Re: Migrating Flex PMD to latest PMD version



On 9/5/14 3:32 AM, "Christofer Dutz" <ch...@c-ware.de> wrote:

>So I haven't dropped the ball ... I am just expecting to have a little 
>stall on my work here.
I'm certainly not pushing anyone to rush on this stuff.  I'm just happy you are even trying.

Thanks,
-Alex


Re: Migrating Flex PMD to latest PMD version

Posted by Alex Harui <ah...@adobe.com>.

On 9/5/14 3:32 AM, "Christofer Dutz" <ch...@c-ware.de> wrote:

>So I haven't dropped the ball ... I am just expecting to have a little
>stall on my work here.
I'm certainly not pushing anyone to rush on this stuff.  I'm just happy
you are even trying.

Thanks,
-Alex


Re: Migrating Flex PMD to latest PMD version

Posted by Erik de Bruin <er...@ixsoftware.nl>.
>
> But going though the individual fragments of FlexPMD I noticed that again
> we have a rudimentary parser for ActionScript. That parses AS code and
> creates an Abstract Syntax Tree from this an which the FlexPMD rules
> operate ... now I was thinking ... how would it be, if FlexPMD referenced
> falcon and used the parsers and AST from that? To me it sort of looks like
> all the tools are re-inventing the wheel. And this way our zoo of code
> could start growing together.
>

That seems indeed to make the most sense. Especially as Falcon is still
being developed, and we don't want to have to maintain changes in two
places.

EdB



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

AW: Migrating Flex PMD to latest PMD version

Posted by Christofer Dutz <ch...@c-ware.de>.
Well you can try to, but I think the versions newer versions automatically use will not work.
Perhaps explicitly setting the maven site plugin to an old version will help but I haven't tried that yet.

As I said, FlexPMD is working. I guess the Ant Target should be working fine also the Maven plugin, as long as you find out which version of which plugin the API changed and force the last working version.

But I would leave this to others. 

>From my side there is nothing more that I could/should do ... from my point it's done. Thats why I was talking about the next steps to take.

Chris


-----Ursprüngliche Nachricht-----
Von: Justin Mclean [mailto:justinmclean@me.com] 
Gesendet: Samstag, 6. September 2014 15:20
An: dev@flex.apache.org
Betreff: Re: Migrating Flex PMD to latest PMD version

Hi,

> The problem is that integrating pmd to generate the reports for the site plugin seems problematic as the API has changed

So why not just use the old version for now. I have an old version on PMD running and it seems to work fine.

Justin

Re: Migrating Flex PMD to latest PMD version

Posted by Justin Mclean <ju...@me.com>.
Hi,

> The problem is that integrating pmd to generate the reports for the site plugin seems problematic as the API has changed

So why not just use the old version for now. I have an old version on PMD running and it seems to work fine.

Justin

AW: Migrating Flex PMD to latest PMD version

Posted by Christofer Dutz <ch...@c-ware.de>.
Well that's the problem ... it is working.
The problem is that integrating pmd to generate the reports for the site plugin seems problematic as the API has changed and adjusting the FlexPMD plugins to the new API doesn't seem to be a straight forward thing.

Currently I have come to believe that it would be better to add official flex support to PMD than to maintain highjacked plugin versions to patch that in.

Chris


-----Ursprüngliche Nachricht-----
Von: Justin Mclean [mailto:justinmclean@me.com] 
Gesendet: Samstag, 6. September 2014 14:14
An: dev@flex.apache.org
Betreff: Re: Migrating Flex PMD to latest PMD version

Hi,

> But going though the individual fragments of FlexPMD I noticed that again we have a rudimentary parser for ActionScript. That parses AS code and creates an Abstract Syntax Tree from this an which the FlexPMD rules operate ... now I was thinking ... how would it be, if FlexPMD referenced falcon and used the parsers and AST from that? To me it sort of looks like all the tools are re-inventing the wheel. And this way our zoo of code could start growing together.

Why not trying to just get it to work first and improve later :-)

Justin

Re: Migrating Flex PMD to latest PMD version

Posted by Justin Mclean <ju...@me.com>.
Hi,

> But going though the individual fragments of FlexPMD I noticed that again we have a rudimentary parser for ActionScript. That parses AS code and creates an Abstract Syntax Tree from this an which the FlexPMD rules operate ... now I was thinking ... how would it be, if FlexPMD referenced falcon and used the parsers and AST from that? To me it sort of looks like all the tools are re-inventing the wheel. And this way our zoo of code could start growing together.

Why not trying to just get it to work first and improve later :-)

Justin

AW: Migrating Flex PMD to latest PMD version

Posted by Christofer Dutz <ch...@c-ware.de>.
Was just reading this article (I had read it before and still think there is currently no option to add support for flex to PMD without adding this to the PMD project). http://pmd.sourceforge.net/pmd-5.1.3/new-language.html

In our FlexPMD project we generally have two parts ... a GUI editor/viewer written in Flex and the FlexPMD written in Java (Ignore the hybrid thing ... don't really know what that's for ;-) ). 

I guess we could leave all as is with the GUI part. 

But going though the individual fragments of FlexPMD I noticed that again we have a rudimentary parser for ActionScript. That parses AS code and creates an Abstract Syntax Tree from this an which the FlexPMD rules operate ... now I was thinking ... how would it be, if FlexPMD referenced falcon and used the parsers and AST from that? To me it sort of looks like all the tools are re-inventing the wheel. And this way our zoo of code could start growing together.

Chris



________________________________________
Von: Christofer Dutz <ch...@c-ware.de>
Gesendet: Freitag, 5. September 2014 12:45
An: dev@flex.apache.org
Betreff: AW: Migrating Flex PMD to latest PMD version

Just for the reference ... I pushed my changes to the feature branch "feature/flexpmd-pmd-update"
...

Chris
________________________________________
Von: Christofer Dutz <ch...@c-ware.de>
Gesendet: Freitag, 5. September 2014 12:32
An: dev@flex.apache.org
Betreff: Migrating Flex PMD to latest PMD version

Hi,


even if I got a lot of stuff working with FlexPMD, I was still having problems with the report-plugins for maven complaining about API incompatabilities. It seems that this is due to changes in the maven report and site plugin. I decided not to fix these problems, but so solve them by updating FlexPMD to PMD 5.1.3 as well as the latest pmd maven plugin. After migrating almost everything to the new versions I am now blocked by one issue which i hope the PMD guys will answer soon.


In PMD 5.x a rule has to specify the language it is designed for. This allows to create mixed rule-sets. Unfortunately the supported languages are hard-coded into PMD (net.sourceforge.pmd.lang.Language?) and I currently see no way in which I could make FlexPMD extend this. Extending it in PMD itself sort of sounds problematic too, because I doubt they will add a language for which the implementation is outside of their project.


So I haven't dropped the ball ... I am just expecting to have a little stall on my work here.


Chris

AW: Migrating Flex PMD to latest PMD version

Posted by Christofer Dutz <ch...@c-ware.de>.
Just for the reference ... I pushed my changes to the feature branch "feature/flexpmd-pmd-update"
...

Chris
________________________________________
Von: Christofer Dutz <ch...@c-ware.de>
Gesendet: Freitag, 5. September 2014 12:32
An: dev@flex.apache.org
Betreff: Migrating Flex PMD to latest PMD version

Hi,


even if I got a lot of stuff working with FlexPMD, I was still having problems with the report-plugins for maven complaining about API incompatabilities. It seems that this is due to changes in the maven report and site plugin. I decided not to fix these problems, but so solve them by updating FlexPMD to PMD 5.1.3 as well as the latest pmd maven plugin. After migrating almost everything to the new versions I am now blocked by one issue which i hope the PMD guys will answer soon.


In PMD 5.x a rule has to specify the language it is designed for. This allows to create mixed rule-sets. Unfortunately the supported languages are hard-coded into PMD (net.sourceforge.pmd.lang.Language?) and I currently see no way in which I could make FlexPMD extend this. Extending it in PMD itself sort of sounds problematic too, because I doubt they will add a language for which the implementation is outside of their project.


So I haven't dropped the ball ... I am just expecting to have a little stall on my work here.


Chris