/** * Gets the SCM descriptor by name. Primarily used for making them web-visible. */ public Descriptor<SCM> getScm(String shortClassName) { return findDescriptor(shortClassName, SCM.all()); }
/** * Determines which kinds of SCMs are applicable to a given project. * @param project a project on which we might be configuring SCM, or null if unknown * @return all descriptors which {@link SCMDescriptor#isApplicable(Job)} to it, also filtered by {@link TopLevelItemDescriptor#isApplicable}; * or simply {@link #all} if there is no project * @since 1.568 */ public static List<SCMDescriptor<?>> _for(@CheckForNull final Job project) { if(project==null) return all(); final Descriptor pd = Jenkins.getInstance().getDescriptor((Class) project.getClass()); List<SCMDescriptor<?>> r = new ArrayList<SCMDescriptor<?>>(); for (SCMDescriptor<?> scmDescriptor : all()) { if(!scmDescriptor.isApplicable(project)) continue; if (pd instanceof TopLevelItemDescriptor) { TopLevelItemDescriptor apd = (TopLevelItemDescriptor) pd; if(!apd.isApplicable(scmDescriptor)) continue; } r.add(scmDescriptor); } return r; }
/** * Parses {@link SCM} configuration from the submitted form. * * @param target * The project for which this SCM is configured to. */ @SuppressWarnings("deprecation") public static SCM parseSCM(StaplerRequest req, AbstractProject target) throws FormException, ServletException { SCM scm = SCM.all().newInstanceFromRadioList(req.getSubmittedForm().getJSONObject("scm")); if (scm == null) { scm = new NullSCM(); // JENKINS-36043 workaround for AbstractMultiBranchProject.submit } scm.getDescriptor().generation++; return scm; }
/** * Gets the SCM descriptor by name. Primarily used for making them web-visible. */ public Descriptor<SCM> getScm(String shortClassName) { return findDescriptor(shortClassName, SCM.all()); }
/** * Gets the SCM descriptor by name. Primarily used for making them web-visible. */ public Descriptor<SCM> getScm(String shortClassName) { return findDescriptor(shortClassName, SCM.all()); }
/** * Gets the SCM descriptor by name. Primarily used for making them web-visible. */ public Descriptor<SCM> getScm(String shortClassName) { return findDescriptor(shortClassName, SCM.all()); }
/** * Gets the SCM descriptor by name. Primarily used for making them web-visible. */ public Descriptor<SCM> getScm(String shortClassName) { return findDescriptor(shortClassName, SCM.all()); }
/** * Gets the SCM descriptor by name. Primarily used for making them * web-visible. */ public Descriptor<SCM> getScm(String shortClassName) { return findDescriptor(shortClassName, SCM.all()); }
@Restricted(NoExternalUse.class) // Jelly, Hider public List<SCMDescriptor<?>> getSCMDescriptors() { List<SCMDescriptor<?>> descriptors = new ArrayList<>(); for (SCMDescriptor<?> d : SCM.all()) { // TODO SCM._for cannot be used here since it requires an actual Job, where we want to check for applicability to Job.class // (the best we could do is to check whether SCM.checkout(Run, …) is overridden) if (d.clazz != NullSCM.class) { descriptors.add(d); } } return descriptors; } }
/** * Returns the list of {@link SCMDescriptor}s that are applicable to the given project. */ public static List<SCMDescriptor<?>> _for(final AbstractProject project) { if(project==null) return all(); final Descriptor pd = Hudson.getInstance().getDescriptor((Class) project.getClass()); List<SCMDescriptor<?>> r = new ArrayList<SCMDescriptor<?>>(); for (SCMDescriptor<?> scmDescriptor : all()) { if(!scmDescriptor.isApplicable(project)) continue; if (pd instanceof AbstractProjectDescriptor) { AbstractProjectDescriptor apd = (AbstractProjectDescriptor) pd; if(!apd.isApplicable(scmDescriptor)) continue; } r.add(scmDescriptor); } return r; } }
/** * Returns the list of {@link SCMDescriptor}s that are applicable to the given project. */ public static List<SCMDescriptor<?>> _for(final AbstractProject project) { if(project==null) return all(); final Descriptor pd = Hudson.getInstance().getDescriptor((Class) project.getClass()); List<SCMDescriptor<?>> r = new ArrayList<SCMDescriptor<?>>(); for (SCMDescriptor<?> scmDescriptor : all()) { if(!scmDescriptor.isApplicable(project)) continue; if (pd instanceof AbstractProjectDescriptor) { AbstractProjectDescriptor apd = (AbstractProjectDescriptor) pd; if(!apd.isApplicable(scmDescriptor)) continue; } r.add(scmDescriptor); } return r; } }
/** * Returns the list of {@link SCMDescriptor}s that are applicable to the given project. */ public static List<SCMDescriptor<?>> _for(final AbstractProject project) { if(project==null) return all(); final Descriptor pd = Hudson.getInstance().getDescriptor((Class) project.getClass()); List<SCMDescriptor<?>> r = new ArrayList<SCMDescriptor<?>>(); for (SCMDescriptor<?> scmDescriptor : all()) { if(!scmDescriptor.isApplicable(project)) continue; if (pd instanceof AbstractProjectDescriptor) { AbstractProjectDescriptor apd = (AbstractProjectDescriptor) pd; if(!apd.isApplicable(scmDescriptor)) continue; } r.add(scmDescriptor); } return r; } }
/** * Determines which kinds of SCMs are applicable to a given project. * @param project a project on which we might be configuring SCM, or null if unknown * @return all descriptors which {@link SCMDescriptor#isApplicable(Job)} to it, also filtered by {@link TopLevelItemDescriptor#isApplicable}; * or simply {@link #all} if there is no project * @since 1.568 */ public static List<SCMDescriptor<?>> _for(@CheckForNull final Job project) { if(project==null) return all(); final Descriptor pd = Jenkins.getInstance().getDescriptor((Class) project.getClass()); List<SCMDescriptor<?>> r = new ArrayList<SCMDescriptor<?>>(); for (SCMDescriptor<?> scmDescriptor : all()) { if(!scmDescriptor.isApplicable(project)) continue; if (pd instanceof TopLevelItemDescriptor) { TopLevelItemDescriptor apd = (TopLevelItemDescriptor) pd; if(!apd.isApplicable(scmDescriptor)) continue; } r.add(scmDescriptor); } return r; }
/** * Returns the list of {@link SCMDescriptor}s that are applicable to the * given project. */ public static List<SCMDescriptor<?>> _for(final AbstractProject project) { if (project == null) { return all(); } final Descriptor pd = Hudson.getInstance().getDescriptor((Class) project.getClass()); List<SCMDescriptor<?>> r = new ArrayList<SCMDescriptor<?>>(); for (SCMDescriptor<?> scmDescriptor : all()) { if (!scmDescriptor.isApplicable(project)) { continue; } if (pd instanceof AbstractProjectDescriptor) { AbstractProjectDescriptor apd = (AbstractProjectDescriptor) pd; if (!apd.isApplicable(scmDescriptor)) { continue; } } r.add(scmDescriptor); } return r; } }
/** * Parses {@link SCM} configuration from the submitted form. * * @param target * The project for which this SCM is configured to. */ @SuppressWarnings("deprecation") public static SCM parseSCM(StaplerRequest req, AbstractProject target) throws FormException, ServletException { SCM scm = SCM.all().newInstanceFromRadioList(req.getSubmittedForm().getJSONObject("scm")); if (scm == null) { scm = new NullSCM(); // JENKINS-36043 workaround for AbstractMultiBranchProject.submit } scm.getDescriptor().generation++; return scm; }