Skip to content

Commit

Permalink
[JENKINS-43535] - Restore Binary compatibility of EnvInjectAction
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-nenashev committed Apr 26, 2017
1 parent 1663a4b commit 1fb4007
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/main/java/org/jenkinsci/lib/envinject/EnvInjectAction.java
@@ -1,6 +1,7 @@
package org.jenkinsci.lib.envinject;

import com.google.common.collect.Maps;
import hudson.model.AbstractBuild;
import hudson.model.Job;
import hudson.model.Run;
import org.apache.commons.collections.map.UnmodifiableMap;
Expand Down Expand Up @@ -44,11 +45,28 @@ public void onLoad(Run<?, ?> run) {
private transient File rootDir;
private transient @CheckForNull Set<String> sensibleVariables;

public EnvInjectAction(@Nonnull Run<?,?> build,
/**
* Constructs action for the specified environment variables.
* @param build Build
* @param envMap Environment Map
* @deprecated The action implements {@link RunAction2} now, hence passing build is not required anymore.
* Use {@link #EnvInjectAction(java.util.Map)}.
*/
@Deprecated
public EnvInjectAction(@Nonnull AbstractBuild build,
@CheckForNull Map<String, String> envMap) {
this.build = build;
this.envMap = envMap;
}

/**
* Constructs action for the specified environment variables.
* @param envMap Environment Map
* @since 0.25
*/
public EnvInjectAction(@CheckForNull Map<String, String> envMap) {
this.envMap = envMap;
}

public void overrideAll(Map<String, String> all) {
overrideAll(Collections.<String>emptySet(), all);
Expand Down
Expand Up @@ -9,6 +9,7 @@

/**
* @author Gregory Boissinot
* @deprecated The actual version of this API class is located in EnvInject API Plugin
*/
@Deprecated
@Restricted(NoExternalUse.class)
Expand Down

0 comments on commit 1fb4007

Please sign in to comment.