PMD Task For Android

Posted: June 18, 2009 in Android, Java, Mobile
Tags: , , ,

I do not  think any of us are Apache ANT experts, but here is the PMD task that I am using with an Android setup:

<pmd  >


				          <formatter type="xml" toFile="${inreports-folder}/${}.${DSTAMP}.${TSTAMP}.pmd.xml"/>
<pathelement location="${android-jar}"/>

		        	                <fileset dir="${project.home}/libs">
		        	                    <include name="*.jar" />
			<classpath refid="reporttools.classpath" />
		        	<fileset dir="${source-location}" includes="**/*.java" />

		    	<xslt basedir="${inreports-folder}" destdir="${outreports-folder}"
<param name="rulesets" expression="${rulesets}"/>
<param name="project" expression="${project}"/>
<param name="today" expression="${today}"/>

Of course you will have to define your own ANT properties. It is assumed that the PMD ruleset is in the PMD.jar and thus you will include again with classpath refid
so that the PMD task can find the ruleset. Also notice to use the PMD xslt provided stylesheet you should provide two xslt parameters to the xslt task

Reblog this post [with Zemanta]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s