Skip to content

Commit

Permalink
Merge pull request #82 from jenkinsci/feature/77-make-plugin-compatib…
Browse files Browse the repository at this point in the history
…le-with-declarative-pipelines

Remove explicitly required context to allow to use it through declarative options
  • Loading branch information
repolevedavaj authored Jan 10, 2023
2 parents 7e8b756 + 5701781 commit dbe24f9
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package io.jenkins.plugins.projectenv;

import hudson.EnvVars;
import hudson.Extension;
import hudson.Launcher;
import hudson.model.Computer;
import org.jenkinsci.plugins.workflow.steps.Step;
import org.jenkinsci.plugins.workflow.steps.StepContext;
import org.jenkinsci.plugins.workflow.steps.StepDescriptor;
import org.jenkinsci.plugins.workflow.steps.StepExecution;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Collections;
import java.util.Set;

public class WithProjectEnvStep extends Step {
Expand Down Expand Up @@ -46,7 +42,7 @@ public StepExecution start(StepContext stepContext) throws Exception {
if (cliVersion != null) {
return new WithProjectEnvStepExecution(stepContext, cliDebug, configFile, cliVersion);
}

return new WithProjectEnvStepExecution(stepContext, cliDebug, configFile);
}

Expand All @@ -55,7 +51,7 @@ public static class DescriptorImpl extends StepDescriptor {

@Override
public Set<? extends Class<?>> getRequiredContext() {
return new HashSet<>(Arrays.asList(EnvVars.class, Computer.class, Launcher.class));
return Collections.emptySet();
}

@Override
Expand Down

0 comments on commit dbe24f9

Please sign in to comment.