Skip to content
This repository has been archived by the owner on Apr 6, 2022. 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 8bbd4c8 commit 2467ad3
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 80 deletions.
2 changes: 1 addition & 1 deletion go.sh
@@ -1,4 +1,4 @@
rm -rf $JENKINS_HOME/plugins/warnings*
rm -rf $JENKINS_HOME/plugins/tasks*

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

Expand Down
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/tasks/TasksProjectAction.java
@@ -1,8 +1,8 @@
package hudson.plugins.tasks;

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 task scanner trend graph. Drawing of the graph is
Expand All @@ -14,24 +14,24 @@ public class TasksProjectAction extends AbstractProjectAction<ResultAction<Tasks
/**
* Instantiates a new {@link TasksProjectAction}.
*
* @param project
* the project that owns this action
* @param job
* the job that owns this action
*/
public TasksProjectAction(final AbstractProject<?, ?> project) {
this(project, TasksResultAction.class);
public TasksProjectAction(final Job<?, ?> job) {
this(job, TasksResultAction.class);
}

/**
* Instantiates a new {@link TasksProjectAction}.
*
* @param project
* the project that owns this action
* @param job
* the job that owns this action
* @param type
* the result action type
*/
public TasksProjectAction(final AbstractProject<?, ?> project,
public TasksProjectAction(final Job<?, ?> job,
final Class<? extends ResultAction<TasksResult>> type) {
super(project, type, Messages._Tasks_ProjectAction_Name(), Messages._Tasks_Trend_Name(),
super(job, type, Messages._Tasks_ProjectAction_Name(), Messages._Tasks_Trend_Name(),
TasksDescriptor.PLUGIN_ID, TasksDescriptor.ICON_URL, TasksDescriptor.RESULT_URL);
}
}
Expand Down
11 changes: 1 addition & 10 deletions src/main/java/hudson/plugins/tasks/TasksPublisher.java
Expand Up @@ -10,12 +10,8 @@
import hudson.Launcher;
import hudson.matrix.MatrixAggregator;
import hudson.matrix.MatrixBuild;

import hudson.model.AbstractProject;
import hudson.model.Run;
import hudson.model.Action;
import hudson.model.BuildListener;

import hudson.model.Run;
import hudson.plugins.analysis.core.BuildResult;
import hudson.plugins.analysis.core.HealthAwarePublisher;
import hudson.plugins.analysis.util.PluginLogger;
Expand Down Expand Up @@ -178,11 +174,6 @@ public void setAsRegexp(boolean asRegexp) {
this.asRegexp = asRegexp;
}

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

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

import java.util.Collection;

import hudson.model.Action;
import hudson.model.Run;

import hudson.plugins.analysis.core.HealthDescriptor;
Expand Down Expand Up @@ -53,4 +56,8 @@ public String getSingleItemTooltip() {
return Messages.Tasks_ResultAction_OneWarning();
}

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

0 comments on commit 2467ad3

Please sign in to comment.