Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Commit

Permalink
[JENKINS-31202] Make remaining plugins compatible to SimpleBuildStep.
Browse files Browse the repository at this point in the history
checkstyle, dry, findbugs, pmd, tasks, analysis-collector.
  • Loading branch information
uhafner committed Nov 13, 2016
1 parent a73b997 commit 3fda8ed
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 74 deletions.
8 changes: 8 additions & 0 deletions go.sh
@@ -0,0 +1,8 @@
rm -rf $JENKINS_HOME/plugins/pmd*

mvn install || { echo "Build failed"; exit 1; }

cp -f target/*.hpi $JENKINS_HOME/plugins/

cd $JENKINS_HOME
./go.sh
112 changes: 56 additions & 56 deletions pmd.iml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-core</artifactId>
<version>1.77</version>
<version>1.80-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/hudson/plugins/pmd/PmdProjectAction.java
@@ -1,8 +1,8 @@
package hudson.plugins.pmd;

import hudson.model.AbstractProject;
import hudson.plugins.analysis.core.ResultAction;
import hudson.model.Job;
import hudson.plugins.analysis.core.AbstractProjectAction;
import hudson.plugins.analysis.core.ResultAction;

/**
* Entry point to visualize the PMD trend graph in the project screen. Drawing
Expand All @@ -14,24 +14,24 @@ public class PmdProjectAction extends AbstractProjectAction<ResultAction<PmdResu
/**
* Instantiates a new {@link PmdProjectAction}.
*
* @param project
* the project that owns this action
* @param job
* the job that owns this action
*/
public PmdProjectAction(final AbstractProject<?, ?> project) {
this(project, PmdResultAction.class);
public PmdProjectAction(final Job<?, ?> job) {
this(job, PmdResultAction.class);
}

/**
* Instantiates a new {@link PmdProjectAction}.
*
* @param project
* the project that owns this action
* @param job
* the job that owns this action
* @param type
* the result action type
*/
public PmdProjectAction(final AbstractProject<?, ?> project,
public PmdProjectAction(final Job<?, ?> job,
final Class<? extends ResultAction<PmdResult>> type) {
super(project, type, Messages._PMD_ProjectAction_Name(), Messages._PMD_Trend_Name(),
super(job, type, Messages._PMD_ProjectAction_Name(), Messages._PMD_Trend_Name(),
PmdDescriptor.PLUGIN_ID, PmdDescriptor.ICON_URL, PmdDescriptor.RESULT_URL);
}
}
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/hudson/plugins/pmd/PmdPublisher.java
Expand Up @@ -13,8 +13,6 @@
import hudson.Launcher;
import hudson.matrix.MatrixAggregator;
import hudson.matrix.MatrixBuild;
import hudson.model.AbstractProject;
import hudson.model.Action;
import hudson.model.BuildListener;
import hudson.model.Run;
import hudson.model.TaskListener;
Expand Down Expand Up @@ -68,11 +66,6 @@ public void setPattern(final String pattern) {
this.pattern = pattern;
}

@Override
public Action getProjectAction(final AbstractProject<?, ?> project) {
return new PmdProjectAction(project);
}

@Override
public BuildResult perform(final Run<?, ?> build, final FilePath workspace, final PluginLogger logger) throws
InterruptedException, IOException {
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/hudson/plugins/pmd/PmdResultAction.java
@@ -1,5 +1,8 @@
package hudson.plugins.pmd;

import java.util.Collection;

import hudson.model.Action;
import hudson.model.Run;
import hudson.plugins.analysis.core.AbstractResultAction;
import hudson.plugins.analysis.core.HealthDescriptor;
Expand Down Expand Up @@ -31,6 +34,11 @@ public PmdResultAction(final Run<?, ?> owner, final HealthDescriptor healthDescr
super(owner, new PmdHealthDescriptor(healthDescriptor), result);
}

@Override
public Collection<? extends Action> getProjectActions() {
return asSet(new PmdProjectAction(getJob()));
}

@Override
public String getDisplayName() {
return Messages.PMD_ProjectAction_Name();
Expand Down

0 comments on commit 3fda8ed

Please sign in to comment.