Skip to content

Commit

Permalink
FIXED JENKINS-32657: (Reopened) Existing build steps will loose their
Browse files Browse the repository at this point in the history
cmake-argument and working directory settings.
  • Loading branch information
15knots committed Feb 24, 2016
1 parent fa5b10a commit 7d54888
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/hudson/plugins/cmake/AbstractCmakeBuilder.java
Expand Up @@ -40,19 +40,19 @@ public String getInstallationName() {
return this.installationName;
}

public void setWorkingDir(String workingDir) {
protected void setWorkingDir(String workingDir) {
this.workingDir = Util.fixEmptyAndTrim(workingDir);
}

public String getWorkingDir() {
protected String getWorkingDir() {
return this.workingDir;
}

public void setArguments(String toolArgs) {
protected void setArguments(String toolArgs) {
this.toolArgs = Util.fixEmptyAndTrim(toolArgs);
}

public String getArguments() {
protected String getArguments() {
return this.toolArgs;
}

Expand Down
18 changes: 18 additions & 0 deletions src/main/java/hudson/plugins/cmake/CmakeBuilder.java
Expand Up @@ -45,6 +45,12 @@ public class CmakeBuilder extends AbstractCmakeBuilder {
private String preloadScript;
private boolean cleanBuild;

// for backward compatibility with < 2.4.9
// see
// https://wiki.jenkins-ci.org/display/JENKINS/Hint+on+retaining+backward+compatibility
private transient String buildDir;
private transient String cmakeArgs;

private List<BuildToolStep> toolSteps = new ArrayList<BuildToolStep>(0);

/**
Expand All @@ -63,6 +69,18 @@ public CmakeBuilder(String installationName, String generator) {
this.generator = Util.fixNull(generator);
}

// for backward compatibility with < 2.4.
protected Object readResolve() {
// convert to new format
if (buildDir != null) {
super.setWorkingDir(buildDir);
}
if (cmakeArgs != null) {
super.setArguments(cmakeArgs);
}
return this;
}

public String getGenerator() {
return this.generator;
}
Expand Down

0 comments on commit 7d54888

Please sign in to comment.