updated to PMD3.6, fixed some deprecations, ready to build new release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4320 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -2,9 +2,9 @@
|
||||
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
|
||||
<property name="pmd.jar" value="pmd-3.5.jar"/>
|
||||
<property name="pmd.jar" value="pmd-3.6.jar"/>
|
||||
<property name="nb.version" value="netbeans50"/>
|
||||
<property name="VERSION" value="1.5.1"/>
|
||||
<property name="VERSION" value="1.6"/>
|
||||
|
||||
<property file="build.ant.properties"/>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---++ BUILDING
|
||||
|
||||
The trunk version of NetBeans IDE is used to develop the PMD plugin
|
||||
The NetBeans IDE version 5.0 or newer can be used to develop the PMD plugin
|
||||
using the new plugin development support.
|
||||
|
||||
Read the documentation of this support to get details about the
|
||||
@ -8,4 +8,4 @@ configuration. For a quick setup it should be enough to copy
|
||||
the 'pmdsuite.properties.template' file into pmdsuite.properties' edit its
|
||||
content according to comments.
|
||||
|
||||
|
||||
Released plugin versions are built with JDK 1.4.2 and against NetBeans5.0.
|
||||
|
Binary file not shown.
BIN
pmd-netbeans/lib/pmd-3.6.jar
Normal file
BIN
pmd-netbeans/lib/pmd-3.6.jar
Normal file
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
Manifest-Version: 1.0
|
||||
OpenIDE-Module-Specification-Version: 1.5.1
|
||||
OpenIDE-Module-Specification-Version: 1.6
|
||||
Created-By: Ole-Martin Mørk and Gunnlaugur Þór Briem and Radim Kubacki
|
||||
OpenIDE-Module: pmd
|
||||
OpenIDE-Module-Layer: pmd/mf-layer.xml
|
||||
|
@ -1,6 +1,6 @@
|
||||
extra.module.files=\
|
||||
modules/ext/jaxen-1.1-beta-7.jar \
|
||||
modules/ext/pmd-3.5.jar \
|
||||
modules/ext/pmd-3.6.jar \
|
||||
modules/ext/jakarta-oro-2.0.8.jar \
|
||||
modules/ext/nbpmdrules.jar
|
||||
nbm.distribution=http://pmd.sourceforge.net/
|
||||
|
@ -17,8 +17,8 @@
|
||||
<binary-origin>lib/jaxen-1.1-beta-7.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/pmd-3.5.jar</runtime-relative-path>
|
||||
<binary-origin>lib/pmd-3.5.jar</binary-origin>
|
||||
<runtime-relative-path>ext/pmd-3.6.jar</runtime-relative-path>
|
||||
<binary-origin>lib/pmd-3.6.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<!-- Deployed path, relative to dir containing module: -->
|
||||
@ -181,7 +181,7 @@
|
||||
<public-packages/>
|
||||
<extra-compilation-unit>
|
||||
<package-root>libsrc</package-root>
|
||||
<classpath>lib/pmd-3.5.jar</classpath>
|
||||
<classpath>lib/pmd-3.6.jar</classpath>
|
||||
<built-to>build/libclasses</built-to>
|
||||
<built-to>${cluster}/modules/ext/nbpmdrules.jar</built-to>
|
||||
</extra-compilation-unit>
|
||||
|
@ -46,9 +46,7 @@ import net.sourceforge.pmd.Rule;
|
||||
import net.sourceforge.pmd.RuleContext;
|
||||
import net.sourceforge.pmd.RuleSet;
|
||||
import net.sourceforge.pmd.RuleViolation;
|
||||
import net.sourceforge.pmd.TargetJDK1_3;
|
||||
import net.sourceforge.pmd.TargetJDK1_4;
|
||||
import net.sourceforge.pmd.TargetJDK1_5;
|
||||
import net.sourceforge.pmd.SourceType;
|
||||
|
||||
import org.netbeans.api.java.classpath.ClassPath;
|
||||
import org.netbeans.api.java.queries.SourceLevelQuery;
|
||||
@ -163,9 +161,6 @@ public class RunPMDAction extends CookieAction {
|
||||
SourceLevelQuery sourceLevelQuery =
|
||||
(SourceLevelQuery) Lookup.getDefault().lookup(SourceLevelQuery.class);
|
||||
RuleSet set = constructRuleSets();
|
||||
PMD pmd_1_3 = null;
|
||||
PMD pmd_1_4 = null;
|
||||
PMD pmd_1_5 = null;
|
||||
ArrayList/*<Fault>*/ list = new ArrayList( 100 );
|
||||
|
||||
CancelCallback cancel = new CancelCallback();
|
||||
@ -193,25 +188,15 @@ public class RunPMDAction extends CookieAction {
|
||||
String sourceLevel = sourceLevelQuery.getSourceLevel(fobj);
|
||||
|
||||
// choose the correct PMD to use according to the source level
|
||||
PMD pmd = null;
|
||||
if (sourceLevel != null) {
|
||||
if (sourceLevel.equals("1.5")) {
|
||||
if (pmd_1_5 == null)
|
||||
pmd_1_5 = new PMD(new TargetJDK1_5());
|
||||
pmd = pmd_1_5;
|
||||
} else if (sourceLevel.equals("1.3")) {
|
||||
if (pmd_1_3 == null)
|
||||
pmd_1_3 = new PMD(new TargetJDK1_3());
|
||||
pmd = pmd_1_3;
|
||||
}
|
||||
PMD pmd = new PMD();
|
||||
if ("1.5".equals(sourceLevel)) {
|
||||
pmd.setJavaVersion(SourceType.JAVA_15);
|
||||
} else if ("1.3".equals(sourceLevel)) {
|
||||
pmd.setJavaVersion(SourceType.JAVA_13);
|
||||
} else {
|
||||
// default to JDK 1.4 if we don't know any better...
|
||||
pmd.setJavaVersion(SourceType.JAVA_14);
|
||||
}
|
||||
// default to JDK 1.4 if we don't know any better...
|
||||
if (pmd == null) {
|
||||
if (pmd_1_4 == null)
|
||||
pmd_1_4 = new PMD(new TargetJDK1_4());
|
||||
pmd = pmd_1_4;
|
||||
}
|
||||
|
||||
|
||||
Reader reader;
|
||||
try {
|
||||
@ -245,7 +230,7 @@ public class RunPMDAction extends CookieAction {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append( violation.getRule().getName() ).append( ", " );
|
||||
buffer.append( violation.getDescription() );
|
||||
Fault fault = new Fault( violation.getNode().getBeginLine(),
|
||||
Fault fault = new Fault( violation.getBeginLine(),
|
||||
violation.getFilename(),
|
||||
buffer.toString() );
|
||||
list.add( fault );
|
||||
|
Reference in New Issue
Block a user