Skip to content
Permalink
Browse files
FIXED JENKINS-32657: (Reopened) Existing build steps will loose their
cmake-argument and working directory settings.
  • Loading branch information
15knots committed Feb 24, 2016
1 parent fa5b10a commit 7d548881b1b7b91c61b9dfd4b61ebfb5bd23ccb5
Showing with 22 additions and 4 deletions.
  1. +4 −4 src/main/java/hudson/plugins/cmake/AbstractCmakeBuilder.java
  2. +18 −0 src/main/java/hudson/plugins/cmake/CmakeBuilder.java
@@ -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;
}

@@ -45,6 +45,12 @@
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);

/**
@@ -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;
}

0 comments on commit 7d54888

Please sign in to comment.