/** * Gets the subset of {@link #LIST} that has configuration screen. */ public static List<MavenReporterDescriptor> getConfigurableList() { List<MavenReporterDescriptor> r = new ArrayList<MavenReporterDescriptor>(); for (MavenReporterDescriptor d : MavenReporterDescriptor.all()) { if(d.hasConfigScreen()) r.add(d); } return r; } }
@Override public MavenReporter newInstance(final StaplerRequest req, final JSONObject formData) throws hudson.model.Descriptor.FormException { return super.newInstance(req, PluginDescriptor.convertHierarchicalFormData(formData)); } }
/** * Creates a list of {@link MavenReporter}s to be used for a build of this project. */ protected List<MavenReporter> createReporters() { Set<MavenReporter> reporterSet = new TreeSet<>(COMPARATOR); getReporters().addAllTo( reporterSet ); getParent().getReporters().addAllTo(reporterSet); for (MavenReporterDescriptor d : MavenReporterDescriptor.all()) { if(getReporters().contains(d)) continue; // already configured MavenReporter auto = d.newAutoInstance(this); if(auto!=null) reporterSet.add(auto); } return new ArrayList<MavenReporter>(reporterSet); }
/** * Returns true if this descriptor has <tt>config.jelly</tt>. */ public final boolean hasConfigScreen() { MetaClass c = WebApp.getCurrent().getMetaClass(getClass()); try { JellyClassTearOff tearOff = c.loadTearOff(JellyClassTearOff.class); return tearOff.findScript(getConfigPage())!=null; } catch(JellyException e) { return false; } }
Boolean isOkToContinue(MavenReporter reporter, MavenBuildProxy build, BuildListener listener, Throwable error) { if (error != null) { listener.getLogger().println("[HUDSON] " + reporter.getDescriptor().getDisplayName() + " setting build to UNSTABLE"); build.setResult(Result.UNSTABLE); } return null; } };
/** * Creates a list of {@link MavenReporter}s to be used for a build of this project. */ protected List<MavenReporter> createReporters() { List<MavenReporter> reporterList = new ArrayList<MavenReporter>(); getReporters().addAllTo(reporterList); getParent().getReporters().addAllTo(reporterList); for (MavenReporterDescriptor d : MavenReporterDescriptor.all()) { if(getReporters().contains(d)) continue; // already configured MavenReporter auto = d.newAutoInstance(this); if(auto!=null) reporterList.add(auto); } return reporterList; }
/** * Returns true if this descriptor has <tt>config.jelly</tt>. */ public final boolean hasConfigScreen() { MetaClass c = WebApp.getCurrent().getMetaClass(getClass()); try { JellyClassTearOff tearOff = c.loadTearOff(JellyClassTearOff.class); return tearOff.findScript(getConfigPage())!=null; } catch(JellyException e) { return false; } }
/** * Gets the subset of {@link #LIST} that has configuration screen. */ public static List<MavenReporterDescriptor> getConfigurableList() { List<MavenReporterDescriptor> r = new ArrayList<>(); for (MavenReporterDescriptor d : MavenReporterDescriptor.all()) { if(d.hasConfigScreen()) r.add(d); } return r; } }