Skip to content

Commit

Permalink
Add new constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
mdkf committed Aug 17, 2018
1 parent 4aaf901 commit 2a3d04b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<!--<jenkins.version>2.7.4</jenkins.version> -->
<jenkins.version>2.73.3</jenkins.version>
<java.level>8</java.level>
<findbugs.failOnError>false</findbugs.failOnError>
</properties>

<url>https://wiki.jenkins-ci.org/display/JENKINS/Managed+Script+Plugin</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@ public ManagedBatchScriptStep(String buildStepId) {
this.scriptId = buildStepId;
}

public ManagedBatchScriptStep(WinBatchBuildStep step) {
if (step == null) {
throw new IllegalArgumentException();
}
this.scriptId = step.getBuildStepId();
this.buildStepArgs = step.getBuildStepArgs();
if (this.buildStepArgs!= null && this.buildStepArgs.length>0){
ArgValue[] args=new ArgValue[buildStepArgs.length];
for (int c=0; c<buildStepArgs.length;c++){
args[c]=new ArgValue(buildStepArgs[c]);
}
this.scriptBuildStepArgs=new ScriptBuildStepArgs(true,args);
}

}

@Override
protected DurableTask task() {
return new ManagedBatchScript(scriptId, buildStepArgs);
Expand Down

0 comments on commit 2a3d04b

Please sign in to comment.