tag:support.gradlefx.org,2011-05-23:/discussions/questions/60-flexpmd-and-pmd-pluginGradleFx: Discussion 2016-08-11T02:32:05Ztag:support.gradlefx.org,2011-05-23:Comment/270276262013-05-27T18:00:17Z2013-05-27T18:00:20ZFlexPMD and 'pmd' plugin<div><p>Hello,</p>
<p>I was wondering if anyone was able to get FlexPMD to work with
the gradle pmd plugin? Just wanted to know before I simply use the
flex pmd ant task.</p>
<p>Thanks</p>
<p>Nicolas</p></div>Nicolas Estradatag:support.gradlefx.org,2011-05-23:Comment/270276262013-05-28T11:15:39Z2013-05-28T11:15:40ZFlexPMD and 'pmd' plugin<div><p>I was unable to get the built it gradle 'pmd' plugin to work
with the flexPMD libraries so I simply created my own task. If
anyone has any suggestions on how I make it better I would love you
hear your thoughts<br></p>
<pre>
<code>configurations { pmd { description = 'Dependencies for running ant FlexPMD' } }
dependencies {
flexSDK group: 'com.adobe', name: 'flex-sdk', version: '4.6', ext: 'zip'
test group: 'org.flexunit', name: 'flexunit', version: '4.1.0-8', ext: 'swc'
test group: 'org.flexunit', name: 'flexunit-tasks', version: '4.1.0-8'
test group: 'org.flexunit', name: 'flexunit-cilistener', version: '4.1.0-8', ext: 'swc'
test group: 'org.flexunit', name: 'flexunit-aircilistener', version: '4.1.0-8', ext: 'swc'
pmd group: 'com.adobe.ac', name: 'flex-pmd-ant-task', version: '1.2'
}
task check(description: 'Run PMD analysis for main Actionscript classes') {
def srcDir = file('src')
def reportsDir = file("${project.buildDir}/reports/pmd")
doFirst {
reportsDir.mkdirs()
copy {
from (zipTree(configurations.pmd.filter {
it.name.startsWith("pmd")
}.singleFile)) { include '**/pmd-nicerhtml.xsl' }
into reportsDir
includeEmptyDirs = false
}
}
inputs.dir srcDir
outputs.dir reportsDir
doLast {
ant {
taskdef(
name: 'flexPmd',
classname: 'com.adobe.ac.pmd.ant.FlexPmdAntTask',
classpath: configurations.pmd.asPath)
flexPmd(
sourceDirectory: srcDir,
outputDirectory: reportsDir)
xslt(
in: "$reportsDir/pmd.xml",
style: "$reportsDir/etc/pmd-nicerhtml.xsl",
out: "$reportsDir/pmd.html")
}
}
}</code>
</pre></div>Nicolas Estradatag:support.gradlefx.org,2011-05-23:Comment/270276262013-05-28T21:54:49Z2013-05-28T21:54:49ZFlexPMD and 'pmd' plugin<div><p>Looks great! You could make it better by making it a "pull
request" though ;)</p>
<p>May I ask where you're downloading that library from? I guess
it's on your own Nexus or something similar because I just went to
Adobe's opensource site and I couldn't even find a simple download.
The "download" link points to the subversion repo...</p></div>Maxime Coweztag:support.gradlefx.org,2011-05-23:Comment/270276262013-05-29T13:46:53Z2013-05-29T13:46:54ZFlexPMD and 'pmd' plugin<div><p>I'm not a big open source contributor, I would like to be but I
don't know exactly how a 'pull request' is made (link for
beginners?)</p>
<p>As for the FlexPMD dependencies, I'm using an OSS artifactory
here and I added this repository to it (checking only the 'Handle
Releases' checkbox)</p>
<p><a href=
"http://opensource.adobe.com/svn/opensource/flexpmd/maven-repository/release">
http://opensource.adobe.com/svn/opensource/flexpmd/maven-repository...</a></p>
<p>I will need to clean things up a bit in order to pmd both the
source and the test sourceSets however. When I get a cleaned up
version with Flex CPD I'll let you know ;)</p>
<p>Cheers :)</p></div>Nicolas Estradatag:support.gradlefx.org,2011-05-23:Comment/270276262013-05-29T21:06:47Z2013-05-29T21:06:47ZFlexPMD and 'pmd' plugin<div><p>Right, so the download was in the subversion repo after all :-/
Very intuitive, Adobe.</p>
<p>I wasn't contributing much myself before I started helping out
with GradleFx. Yennick was kind enough to help me take the first
"pull request" hurdle. If you're interested I'll gladly walk you
through it too.<br>
Bear in mind that integrating with GradleFx will require a little
more work. For instance I think the PMD support should be in a
separate subplugin for those interested. But we can talk about the
implementation details later.</p>
<p>I don't think this project would be very high on Yennick's
priority list though, so it'll be up to you if you want to make it
part of GradleFx ;)</p></div>Maxime Cowez