I'm trying to write a wrapper to allow the Google Storage Plugin Post-Build
step to also act as a Build step.
Here is my first attempt
<https://github.com/agoulti/google-storage-plugin/commit/b051db72048bd2c6b760678936ed128d78a161a0>.
There is an inner class (e.g., ClassicUpload) that might be instantiated in
a Build step or in a Post Build step.
It has an option ("on failed build") which makes sense for Post-Build, but
not for Build Step. I wanted to make that option hidden for the Build Step
version but not for the Post Build.
I have tried the following approaches, but was not able to get either of
them to work:
- Use a jelly built in variable. The problem is, the class is nested. So,
in the corresponding jelly config, the "it" variable points to
FreeStyleProject, and the "instance" points to the inner class
(ClassicUpload), which doesn't know whether it's in a Build Step or
Post-Build Step.
- Set a jelly variable "isBuild" in the parent class jelly (BuildStep or
Post-Build Step), and read it in the child class. It works correctly when
the page is originally rendered, but if I'm adding a nested class through
the UI the jelly variable, then "isBuild" is undefined
- Get the nested class to remember if it's BuildStep or Post-Build: create
a bool isBuild, set it through the constructor, read it in the jelly. The
problem is that the magic happens through "hetero-list". It would be easy
to set isBuild in the original default list, but is there a way to pass
something as a parameter to the constructor?
Does anyone have any suggestions on how to approach 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/1c6fdbc3-4465-42c7-9603-bb0b679b03ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.