elygre commented on Improvement JENKINS-26897

In our use case, there is no external build script. Instead, everything is handled by the "Invoke Gradle Script" build step.

First, the parameters section specifies two input parameters: "version" and "refreshDependencies". They are both string parameter, even though the use case calls for the second one to be boolean (refresh or not).

Second in the "Invoke Gradle Script" build step, there is an input box named "switches". In this box we currently put "Pversion=$version $refreshDependencies". There is no external script before, and since the parameter "-refresh-dependencies" is parsed by gradle before the script itself starts, we have no way of translating the value ourselves.

In short:

1) As far as I can tell, it is today not possible to use a boolean parameter to decide whether to pass a switch or not to the built-in gradle support, even though that is the perfect use case for a boolean parameter.
2) The workaround is simple, but kinda removes the motivation for a boolean parameter. After all, everybody could use a string parameter and tell users to enter "true" or "false" themselves

Therefore, I respectfully disagree. Jenkins should have a built-in mechanism for translating a boolean parameter to the string value required later on, if you need something else than "true" and "false".

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to