Skip to content
Permalink
Browse files

[FIXED JENKINS-27225] Support the Workflow plugin

  • Loading branch information
batmat committed Oct 8, 2015
1 parent 40e0029 commit f06d1e13f13857af4203fa1db9f0a12a245ac06d
Showing with 10 additions and 11 deletions.
  1. +10 −11 src/main/java/org/jenkinsci/plugins/buildtriggerbadge/RunListenerImpl.java
@@ -1,34 +1,33 @@
package org.jenkinsci.plugins.buildtriggerbadge;

import hudson.Extension;
import hudson.model.TaskListener;
import hudson.model.AbstractBuild;
import hudson.model.Cause;
import hudson.model.listeners.RunListener;

import java.util.List;

import jenkins.model.Jenkins;

import org.jenkinsci.plugins.buildtriggerbadge.provider.BuildTriggerBadgeDeactivator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import hudson.Extension;
import hudson.model.Cause;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.model.listeners.RunListener;
import jenkins.model.Jenkins;

/**
* Listener to all build to add the badge action.
*
* @author Michael Pailloncy
*/
@Extension
public class RunListenerImpl extends RunListener<AbstractBuild> {
public class RunListenerImpl extends RunListener<Run> {
private static final Logger LOGGER = LoggerFactory.getLogger(RunListenerImpl.class);

public RunListenerImpl() {
super(AbstractBuild.class);
super(Run.class);
}

@Override
public void onStarted(AbstractBuild build, TaskListener listener) {
public void onStarted(Run build, TaskListener listener) {
BuildTriggerBadgePlugin plugin = Jenkins.getInstance().getPlugin(BuildTriggerBadgePlugin.class);
if (plugin.isActivated()) {
List<Cause> causes = CauseFilter.filter((List<Cause>) build.getCauses());

0 comments on commit f06d1e1

Please sign in to comment.