Skip to content
Permalink
Browse files

Merge pull request #182 from abayer/jenkins-26100

[JENKINS-26100] Change buildEnvVars to Run.
  • Loading branch information
abayer committed Jun 16, 2017
2 parents 1ba2176 + e2b8bb4 commit 0613ef35111ca2fb2e9ed5021524c6c23282e748
@@ -665,13 +665,17 @@ public boolean isFilterChangelog() {
return filterChangelog;
}

// TODO: 2.60+ Delete this override.
@Override
public void buildEnvVars(AbstractBuild<?,?> build, Map<String,String> env) {
buildEnvironment(build, env);
}

/**
* TODO: 2.60+ - add @Override.
* Sets the <tt>SVN_REVISION_n</tt> and <tt>SVN_URL_n</tt> environment variables during the build.
*/
@Override
public void buildEnvVars(AbstractBuild<?, ?> build, Map<String, String> env) {
super.buildEnvVars(build, env);

public void buildEnvironment(Run<?, ?> build, Map<String, String> env) {
ModuleLocation[] svnLocations = getLocations(new EnvVars(env), build);

try {
@@ -10,6 +10,7 @@
import hudson.EnvVars;
import hudson.FilePath;
import hudson.model.AbstractBuild;
import hudson.model.Run;
import hudson.remoting.VirtualChannel;
import hudson.scm.SubversionSCM.ModuleLocation;

@@ -108,6 +109,7 @@ public void shouldSetEnvironmentVariablesWithMultipleSvnModules() throws IOExcep
private SubversionSCM mockSCMForBuildEnvVars() {
SubversionSCM scm = mock(SubversionSCM.class);
doCallRealMethod().when(scm).buildEnvVars(any(AbstractBuild.class), anyMapOf(String.class, String.class));
doCallRealMethod().when(scm).buildEnvironment(any(Run.class), anyMapOf(String.class, String.class));
return scm;
}
}

0 comments on commit 0613ef3

Please sign in to comment.
You can’t perform that action at this time.