forked from phoedos/pmd
Adding logging
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1653 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
BIN
pmd-eclipse/lib/commons-logging.jar
Normal file
BIN
pmd-eclipse/lib/commons-logging.jar
Normal file
Binary file not shown.
BIN
pmd-eclipse/lib/log4j-1.2.8.jar
Normal file
BIN
pmd-eclipse/lib/log4j-1.2.8.jar
Normal file
Binary file not shown.
@@ -1,5 +1,7 @@
|
||||
package net.sourceforge.pmd.eclipse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IResourceDelta;
|
||||
@@ -13,11 +15,12 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||
* @author Philippe Herlin
|
||||
* @version $Revision$
|
||||
* $Log$
|
||||
* Revision 1.2 2003/03/18 23:28:36 phherlin
|
||||
* *** keyword substitution change ***
|
||||
* Revision 1.3 2003/03/30 20:44:27 phherlin
|
||||
* Adding logging
|
||||
*
|
||||
*/
|
||||
public class PMDDeltaVisitor implements IResourceDeltaVisitor {
|
||||
private static final Log log = LogFactory.getLog("net.sourceforge.pmd.eclipse.PMDDeltaVisitor");
|
||||
private IProgressMonitor monitor;
|
||||
private boolean useTaskMarker = false;
|
||||
|
||||
@@ -42,10 +45,14 @@ public class PMDDeltaVisitor implements IResourceDeltaVisitor {
|
||||
|
||||
if ((monitor == null) || ((monitor != null) && (!monitor.isCanceled()))) {
|
||||
if (delta.getKind() == IResourceDelta.ADDED) {
|
||||
log.debug("Visiting added resource " + delta.getResource().getName());
|
||||
visitAdded(delta.getResource());
|
||||
} else if (delta.getKind() == IResourceDelta.CHANGED) {
|
||||
log.debug("Visiting changed resource " + delta.getResource().getName());
|
||||
visitChanged(delta.getResource());
|
||||
} // other kinds are not visited
|
||||
} else { // other kinds are not visited
|
||||
log.debug("Resource " + delta.getResource().getName() + " not visited.");
|
||||
}
|
||||
} else {
|
||||
fProcessChildren = false;
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package net.sourceforge.pmd.eclipse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IResourceVisitor;
|
||||
@@ -18,11 +20,15 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||
* @version $Revision$
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.11 2003/03/30 20:47:03 phherlin
|
||||
* Adding logging
|
||||
*
|
||||
* Revision 1.10 2003/03/17 23:34:53 phherlin
|
||||
* refactoring
|
||||
*
|
||||
*/
|
||||
public class PMDVisitor implements IResourceVisitor {
|
||||
private static final Log log = LogFactory.getLog("net.sourceforge.pmd.eclipse.PMDVisitor");
|
||||
private IProgressMonitor monitor;
|
||||
private boolean useTaskMarker = false;
|
||||
|
||||
@@ -38,6 +44,7 @@ public class PMDVisitor implements IResourceVisitor {
|
||||
* @see org.eclipse.core.resources.IResourceVisitor#visit(IResource)
|
||||
*/
|
||||
public boolean visit(IResource resource) {
|
||||
log.debug("Visiting resource " + resource.getName());
|
||||
boolean fVisitChildren = true;
|
||||
|
||||
if ((monitor == null) || ((monitor != null) && (!monitor.isCanceled()))) {
|
||||
|
@@ -6,6 +6,9 @@ import net.sourceforge.pmd.eclipse.PMDConstants;
|
||||
import net.sourceforge.pmd.eclipse.PMDDeltaVisitor;
|
||||
import net.sourceforge.pmd.eclipse.PMDPlugin;
|
||||
import net.sourceforge.pmd.eclipse.PMDVisitor;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResourceDelta;
|
||||
import org.eclipse.core.resources.IResourceVisitor;
|
||||
@@ -21,27 +24,35 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||
* @version $Revision$
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.3 2003/03/18 23:28:37 phherlin
|
||||
* *** keyword substitution change ***
|
||||
* Revision 1.4 2003/03/30 20:51:08 phherlin
|
||||
* Adding logging
|
||||
*
|
||||
*/
|
||||
public class PMDBuilder extends IncrementalProjectBuilder {
|
||||
public static final String PMD_BUILDER = "net.sourceforge.pmd.eclipse.pmdBuilder";
|
||||
public static final Log log = LogFactory.getLog("net.sourceforge.pmd.eclipse.builder.PMDBuilder");
|
||||
|
||||
/**
|
||||
* @see org.eclipse.core.internal.events.InternalBuilder#build(int, Map, IProgressMonitor)
|
||||
*/
|
||||
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
|
||||
log.info("Incremental builder activated");
|
||||
IProject[] result = null;
|
||||
|
||||
if (kind == AUTO_BUILD) {
|
||||
log.debug("Auto build requested.");
|
||||
result = buildAuto(args, monitor);
|
||||
} else if (kind == FULL_BUILD) {
|
||||
log.debug("Full build requested.");
|
||||
result = buildFull(args, monitor);
|
||||
} else if (kind == INCREMENTAL_BUILD) {
|
||||
log.debug("Incremental build requested.");
|
||||
result = buildIncremental(args, monitor);
|
||||
} else {
|
||||
log.warn("This kind of build is not supported : " + kind);
|
||||
}
|
||||
|
||||
log.info("Build done.");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -91,6 +102,7 @@ public class PMDBuilder extends IncrementalProjectBuilder {
|
||||
resourceDelta.accept(visitor);
|
||||
monitor.done();
|
||||
} else {
|
||||
log.info("No change reported. Performing a full build");
|
||||
result = buildFull(args, monitor);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user