Skip to content

Commit

Permalink
Allow baseline purpose and release to be based on project
Browse files Browse the repository at this point in the history
When "Release" and "Project Purpose" are blank the -release and -purpose switches are left out. The baseline created will base its purpose and release on the project that was provided (fixes JENKINS-8613)

Closes #6
  • Loading branch information
Keith Mendoza committed Aug 3, 2011
1 parent f6322bf commit f197b42
Showing 1 changed file with 15 additions and 2 deletions.
@@ -1,5 +1,8 @@
package hudson.plugins.synergy.impl;

import java.util.Arrays;
import java.util.Vector;

public class CreateProjectBaselineCommand extends Command {
private String name;
private String project;
Expand All @@ -14,8 +17,18 @@ public CreateProjectBaselineCommand(String name, String project, String release,
}
@Override
public String[] buildCommand(String ccmExe) {
String[] commands = new String[]{ccmExe, "baseline", "-create", name, "-p", project, "-r", release, "-purpose", purpose};
return commands;
Vector<String> commands = new Vector<String>(Arrays.asList(new String[]{ccmExe, "baseline", "-create", name, "-p", project }));
if(this.release != "") {
commands.add("-r");
commands.add(release);
}

if(this.purpose != "") {
commands.add("-purpose");
commands.add(purpose);
}

return commands.toArray(new String[]{});
}
@Override
public void parseResult(String result) {
Expand Down

0 comments on commit f197b42

Please sign in to comment.