package com.github.myzhan.gitlab;

import hudson.Extension;
import hudson.model.AbstractProject;
import hudson.tasks.BuildWrapper;
import hudson.tasks.BuildWrapperDescriptor;
import org.kohsuke.stapler.DataBoundConstructor;

/**
 * Created by myzhan on 16/8/5.
 */
public class SkippingBuildExpressionSetter extends BuildWrapper {

    public String skippingBuildExpression;


    @DataBoundConstructor
    public SkippingBuildExpressionSetter(String skippingBuildExpression) {
        this.skippingBuildExpression = skippingBuildExpression;
    }


    @Extension
    public static class DescriptorImpl extends BuildWrapperDescriptor {
        @Override
        public boolean isApplicable(AbstractProject<?, ?> item) {
            return true;
        }

        @Override
        public String getDisplayName() {
            return "Set skipping build expression, when receiving webhook from gitlab.";
        }
    }
}

@@ -71,29 +71,123 @@
 son.
-model.AbstractProject
+Launcher;%0Aimport hudson.model.AbstractBuild;%0Aimport hudson.model.AbstractProject;%0Aimport hudson.model.BuildListener
 ;%0Aim
@@ -312,16 +312,45 @@
 uctor;%0A%0A
+import java.io.IOException;%0A%0A
 /**%0A * C
@@ -448,16 +448,16 @@
 pper %7B%0A%0A
-
     publ
@@ -493,16 +493,436 @@
 sion;%0A%0A%0A
+    @Override%0A    public Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException %7B%0A        return new Environment() %7B%0A            @Override%0A            public boolean tearDown(AbstractBuild build, BuildListener listener) throws IOException, InterruptedException %7B%0A                return super.tearDown(build, listener);%0A            %7D%0A        %7D;%0A    %7D%0A%0A%0A
     @Dat

implement the setUp method