Skip to content
Permalink
Browse files

Fix JENKINS-19830

  • Loading branch information...
gboissinot committed Aug 23, 2014
1 parent 6fd8607 commit 03fdb89ecc2dd3a0eb06aae099baf5d90f930f49
@@ -10,6 +10,7 @@

import java.io.IOException;
import java.util.Map;
import java.util.Set;

/**
* @author kyle.sweeney@valtech.com
@@ -131,12 +132,11 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
args.add(tokenizeArgs(normalizedArgs));

//Build /P:key1=value1;key2=value2 ...
Map<String, String> variables = build.getBuildVariables();

if (buildVariablesAsProperties && variables.size() != 0) {
Map<String, String> propertiesVariables = getPropertiesVariables(build);
if (buildVariablesAsProperties && propertiesVariables.size() != 0) {
StringBuffer parameters = new StringBuffer();
parameters.append("/p:");
for (Map.Entry<String, String> entry : variables.entrySet()) {
for (Map.Entry<String, String> entry : propertiesVariables.entrySet()) {
parameters.append(entry.getKey()).append("=").append(entry.getValue()).append(";");
}
parameters.delete(parameters.length() - 1, parameters.length());
@@ -188,6 +188,24 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
}
}


private Map<String, String> getPropertiesVariables(AbstractBuild build) {

Map<String, String> buildVariables = build.getBuildVariables();

final Set<String> sensitiveBuildVariables = build.getSensitiveBuildVariables();
if (sensitiveBuildVariables == null || sensitiveBuildVariables.size() == 0) {
return buildVariables;
}

for (String sensitiveBuildVariable : sensitiveBuildVariables) {
buildVariables.remove(sensitiveBuildVariable);
}

return buildVariables;
}


@Override
public Descriptor<Builder> getDescriptor() {
return (DescriptorImpl) super.getDescriptor();
@@ -2,7 +2,4 @@
<p>
If set to true, Jenkins build variables will be passed to MSBuild as /p:name=value pairs.
</p>
<p>
<strong>Beware</strong> that enabling this feature may cause sensitive information such as passwords to appear in the console log.
</p>
</div>
@@ -1,9 +1,5 @@
<div>
<p>
Si coché, les variables de la build Jenkins vont être passées au MSBuild de la forme suivante : /p:name=value
</p>
<p>
<strong>Attention :</strong> Activer cette option peut entraîner que des informations sensibles telles que des
mots de passe apparaissent dans la console de sortie.
</p>
<p>
Si coché, les variables de la build Jenkins vont être passées au MSBuild de la forme suivante : /p:name=value
</p>
</div>

0 comments on commit 03fdb89

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