Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. import com.cwctravel.hudson.plugins.extended_choice_parameter.ExtendedChoiceParameterDefinition
  2.  
  3. def checkBox (String name, String values, String defaultValue,
  4. int visibleItemCnt=0, String description='', String delimiter=',') {
  5.  
  6. // default same as number of values
  7. visibleItemCnt = visibleItemCnt ?: values.split(',').size()
  8. return new ExtendedChoiceParameterDefinition(
  9. name, //name,
  10. "PT_CHECKBOX", //type
  11. values, //value
  12. "", //projectName
  13. "", //propertyFile
  14. "", //groovyScript
  15. "", //groovyScriptFile
  16. "", //bindings
  17. "", //groovyClasspath
  18. "", //propertyKey
  19. defaultValue, //defaultValue
  20. "", //defaultPropertyFile
  21. "", //defaultGroovyScript
  22. "", //defaultGroovyScriptFile
  23. "", //defaultBindings
  24. "", //defaultGroovyClasspath
  25. "", //defaultPropertyKey
  26. "", //descriptionPropertyValue
  27. "", //descriptionPropertyFile
  28. "", //descriptionGroovyScript
  29. "", //descriptionGroovyScriptFile
  30. "", //descriptionBindings
  31. "", //descriptionGroovyClasspath
  32. "", //descriptionPropertyKey
  33. "", //javascriptFile
  34. "", //javascript
  35. false, //saveJSONParameterToFile
  36. false, //quoteValue
  37. visibleItemCnt, //visibleItemCount
  38. description, //description
  39. delimiter //multiSelectDelimiter
  40. )
  41. }
  42. def testParam = checkBox("这是一个这是一个这", // name
  43. "opt1,opt2,opt3", // values
  44. "opt1", //default value
  45. 0, //visible item cnt
  46. "Multi-select", // description
  47. )
  48.  
  49. properties(
  50. [parameters([testParam])]
  51. )
  52.  
  53. node {
  54. echo 'Hello World'
  55. echo "${params.opt}"
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement