Search in sources :

Example 1 with BuildChooserSetting

use of hudson.plugins.git.extensions.impl.BuildChooserSetting in project gitlab-branch-source-plugin by Argelbargel.

the class GitLabSCMSource method build.

@Nonnull
@Override
public SCM build(@Nonnull SCMHead head, @CheckForNull SCMRevision revision) {
    GitSCM scm;
    if (head instanceof GitLabSCMHead) {
        scm = ((GitLabSCMHead) head).createSCM(this);
        if (revision instanceof SCMRevisionImpl) {
            scm.getExtensions().add(new BuildChooserSetting(new SpecificRevisionBuildChooser((SCMRevisionImpl) revision)));
        }
    } else {
        scm = (GitSCM) super.build(head, revision);
        scm.setBrowser(getBrowser());
    }
    return scm;
}
Also used : BuildChooserSetting(hudson.plugins.git.extensions.impl.BuildChooserSetting) GitSCM(hudson.plugins.git.GitSCM) GitLabSCMHead(argelbargel.jenkins.plugins.gitlab_branch_source.heads.GitLabSCMHead) Nonnull(javax.annotation.Nonnull)

Aggregations

GitLabSCMHead (argelbargel.jenkins.plugins.gitlab_branch_source.heads.GitLabSCMHead)1 GitSCM (hudson.plugins.git.GitSCM)1 BuildChooserSetting (hudson.plugins.git.extensions.impl.BuildChooserSetting)1 Nonnull (javax.annotation.Nonnull)1