import com.cloudbees.hudson.plugins.folder.Folder
import com.cloudbees.hudson.plugins.folder.FolderIconDescriptor
import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject
import jenkins.branch.OrganizationFolder
println FolderIconDescriptor.all()
println Jenkins.instance.getDescriptor(Folder).getIconDescriptors()
println Jenkins.instance.getDescriptor(WorkflowMultiBranchProject).getIconDescriptors()
println Jenkins.instance.getDescriptor(OrganizationFolder).getIconDescriptors()
Running script above in Jenkins script console gives the following result:
[com.cloudbees.hudson.plugins.folder.icons.StockFolderIcon$DescriptorImpl@7ea8a389, jenkins.branch.MetadataActionFolderIcon$DescriptorImpl@78f62ff4]
[com.cloudbees.hudson.plugins.folder.icons.StockFolderIcon$DescriptorImpl@7ea8a389]
[jenkins.branch.MetadataActionFolderIcon$DescriptorImpl@78f62ff4]
[jenkins.branch.MetadataActionFolderIcon$DescriptorImpl@78f62ff4]
There are two known folder icons, but only one applies for each kind of folder. Multi branch projects allow only MetadataActionFolderIcon, see https://github.com/jenkinsci/branch-api-plugin/blob/branch-api-2.5.2.1/src/main/java/jenkins/branch/MultiBranchProjectDescriptor.java#L202-L206 MetadataActionFolderIcon can only be used with multi branch projects and organization folders, but not with "normal" folders, see https://github.com/jenkinsci/branch-api-plugin/blob/branch-api-2.5.2.1/src/main/java/jenkins/branch/MetadataActionFolderIcon.java#L171-L174 So, again, there is currently no point for adding DSL support. We can revise this when there are icons to choose from. |