package javaposse.jobdsl.plugin;

import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import hudson.Extension;
import hudson.model.Descriptor;
import hudson.tasks.Builder;
import hudson.util.ListBoxModel;
import jenkins.YesNoMaybe;

@Extension(dynamicLoadable = YesNoMaybe.YES)
public class DescriptorImpl extends Descriptor<Builder> {

    private Multimap<String, SeedReference> templateJobMap; // K=templateName, V=Seed

    public DescriptorImpl() {
        super(ExecuteDslScripts.class);
        load();
    }

    public String getDisplayName() {
        return "Process Job DSLs";
    }

    public Multimap<String, SeedReference> getTemplateJobMap() {
        if (templateJobMap == null) {
            templateJobMap = HashMultimap.create();
        }

        return templateJobMap;
    }

    public void setTemplateJobMap(Multimap<String, SeedReference> templateJobMap) {
        this.templateJobMap = templateJobMap;
    }

    public ListBoxModel doFillRemovedJobActionItems() {
        ListBoxModel items = new ListBoxModel();
        for (RemovedJobAction action : RemovedJobAction.values()) {
            items.add(action.getDisplayName(), action.name());
        }
        return items;
    }

    public ListBoxModel doFillLookupStrategyItems() {
        ListBoxModel items = new ListBoxModel();
        for (LookupStrategy item : LookupStrategy.values()) {
            items.add(item.getDisplayName(), item.name());
        }
        return items;
    }
}
@@ -142,16 +142,53 @@
 ension;%0A
+import hudson.model.AbstractProject;%0A
 import h
@@ -240,16 +240,57 @@
 uilder;%0A
+import hudson.tasks.BuildStepDescriptor;%0A
 import h
@@ -423,16 +423,25 @@
 extends 
+BuildStep
 Descript
@@ -1592,9 +1592,123 @@
 ;%0A    %7D%0A
-%7D
+    %0A    @Override%0A    public boolean isApplicable(Class%3C? extends AbstractProject%3E jobType) %7B%0A%09%09return true;%0A%09%7D%0A%7D%0A

Make it possible for the job-dsl-plugin to appears as a valid builder in the Conditional BuildStep plugin. See https://issues.jenkins-ci.org/browse/JENKINS-25961