When updating a plugin to support pipeline script, how do I handle an 
optionalBlock section?


I've been using 
*https://github.com/jenkinsci/pipeline-plugin/blob/master/DEVGUIDE.md#user-content-build-wrappers-1*
 
<https://github.com/jenkinsci/pipeline-plugin/blob/master/DEVGUIDE.md#user-content-build-wrappers-1>
 
as a guide to updating my plugins to support pipeline script and that went 
well until I tried up update a plugin that uses an optionalBlock.


Using the pipeline syntax generator I get an exception that it is expecting 
a boolean for the optional block parameter and if I make it a boolean it 
complains about needing to pass a JSonObject!!!



<f:optionalBlock title="Wait Till Build Completed" 
field="waitTillBuildCompleted" >
    <f:entry title="Show BuildMaster Log on Failure" field="printLogOnFailure" >
      <f:checkbox default="false" />
    </f:entry>
</f:optionalBlock>


public DeployToStageBuilder(String toStage, JSONObject waitTillBuildCompleted) {
    this.toStage = toStage;

    if (waitTillBuildCompleted != null) { 
        this.waitTillBuildCompleted = true; 
        this.printLogOnFailure = 
"true".equalsIgnoreCase(waitTillBuildCompleted.getString("printLogOnFailure"));
    } else { 
        this.waitTillBuildCompleted = false; 
        this.printLogOnFailure = false;
    }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/a5490565-e22e-4ae5-92da-2a95ff37d43d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to