There are other plugins that already does this that you can take inspiration from; env-inject and parameterized trigger plugin comes to mind. Basically put all common builder code in a separate class and have your builder and publisher as small facades that mostly just provides the extension hook and first level data binding.
/B On Tue, Dec 13, 2016 at 5:16 PM, 'Dan Alvizu' via Jenkins Developers < [email protected]> wrote: > Okay, I was hoping there was some BuilderPublisher class I could just > extend :) > > I'll go copy-pasta route. Thanks! > > > On Monday, December 12, 2016 at 12:36:43 PM UTC-7, Kanstantsin Shautsou > wrote: >> >> Unfortunately freestyle build is not freestyle. I guess because of >> workflow nobody interested in merging/enhancing other job types. >> There is a workaround by using any-build-step/flexible publisher plugins >> that expose types vice versa. >> >> On Monday, December 12, 2016 at 7:18:36 PM UTC+3, Dan Alvizu wrote: >>> >>> Hi, >>> >>> I'm working on the jira-ext plugin, which updates JIRA tickets as a >>> hudson.task.Builder, which means it shows up in the drop-down of build >>> steps. I would also like to have it show up in the list of post-build >>> steps, which I understand means I must extend a hudson.task.Publisher. >>> >>> I can just copy-pasta this into another class and have that one extend >>> hudson.task.Publisher, but that seems wrong. The implementation is >>> essentially the same. Is there a smarter way of doing this? >>> >>> Thanks! >>> >> -- > 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/2224ceb4-3998-4acb-ae0e-8a0a777cb907% > 40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-dev/2224ceb4-3998-4acb-ae0e-8a0a777cb907%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Robert Sandell *Software Engineer* *CloudBees Inc.* -- 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/CALzHZS3zX0rYNrDHq1DQNgyY_7pOcT5KepgR5R1XRJLTus5hqA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
