Skip to content
Permalink
Browse files
Merge pull request #35 from fcojfernandez/JENKINS-48194
[JENKINS-48194] Binary compatibility broken in MsBuildBuilder
  • Loading branch information
marshall777 committed Jan 7, 2018
2 parents a830f38 + f566e24 commit 29e860368519926069225fc25dec0603a6c57e81
@@ -54,6 +54,24 @@
private final boolean unstableIfWarnings;
private final boolean doNotUseChcpCommand;

/**
* When this builder is created in the project configuration step,
* the builder object will be created from the strings below.
*
* @param msBuildName The Visual Studio logical name
* @param msBuildFile The name/location of the MSBuild file
* @param cmdLineArgs Whitespace separated list of command line arguments
* @param buildVariablesAsProperties If true, pass build variables as properties to MSBuild
* @param continueOnBuildFailure If true, job will continue dispite of MSBuild build failure
* @param unstableIfWarnings If true, job will be unstable if there are warnings
*/
@Deprecated
@SuppressWarnings("unused")
public MsBuildBuilder(String msBuildName, String msBuildFile, String cmdLineArgs, boolean buildVariablesAsProperties, boolean continueOnBuildFailure, boolean unstableIfWarnings) {
// By default, doNotUseChcpCommand=false
this(msBuildName, msBuildFile, cmdLineArgs, buildVariablesAsProperties, continueOnBuildFailure, unstableIfWarnings, false);
}

/**
* When this builder is created in the project configuration step,
* the builder object will be created from the strings below.
@@ -1,6 +1,10 @@
package hudson.plugins.msbuild;

import hudson.model.FreeStyleProject;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.recipes.LocalData;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -10,6 +14,9 @@
*/
public class MsBuildBuilderTest {

@Rule
public JenkinsRule r = new JenkinsRule();

@Test
public void shouldStripQuotedArguments() {
final String quotedPlatform = "/p:Platform=\"Any CPU\"";
@@ -40,4 +47,15 @@ public void endEscapedCharacter() {
assertEquals(oneArgumentsWithEndBackslash, tokenizedArgs[0]);
}

@Test
@LocalData
public void configRoundtrip() {
try {
FreeStyleProject project = (FreeStyleProject)r.jenkins.getAllItems().get(0);
r.configRoundtrip(project);
} catch (Exception e) {
throw new AssertionError("Not valid configuration for MsBuild");
}
}

}
Binary file not shown.

0 comments on commit 29e8603

Please sign in to comment.