Hi,
I think there has been similar discussions before, but it can diserve one more 
go :)

I am starting a fix for one of my plugins where the fix is probably going to be 
to add a RunListener instead of a post-buildstep, added in runtime, that we 
used to have.
We did it like that to make sure that the build step was running last of all 
but before any RunListeners. Especially before the GerritTrigger's RunListener 
because it needs to make some calculations before handing it over to the Gerrit 
Trigger.
I can solve the dilemma by using @Extension(ordinal=someval/somelowerval) on 
both plugins so that the one runs before the GerritTrigger does, quite easily 
since I am maintaining both plugins.

But what if I wasn't? or just want to be a bit more loosely coupled to other 
plugins.
I think it would be great if I could annotate my RunListener with for example
  @Extension(beforeClass="org.jenkins-ci.plugins.someplugin.ThatRunListener") or
  @Extension(afterClass="org.jenkins-ci.plugins.someplugin.ThatRunListener")
  @Extension(beforePlugin="some-plugin")
  @Extension(afterPlugin="some-plugin")

I did some digging and it would probably mostly involve adding logic to 
hudson.ExtensionComponent.compareTo(ExtensionComponent<T> that) but I don't 
know how to find and handle cyclic references (class A wants to run before B 
that wants to run before C that wants to run before A), one strategy could 
simply be that if detected (however that is done) don't load any of the plugins.

Any thoughts/ideas?



Robert Sandell
Software Tools Engineer
SW Environment and Product Configuration
Development Environment

Sony Mobile Communications
Tel: +46 (0)10 80 12721
sonymobile.com<http://sonymobile.com/>

[cid:[email protected]]


<<inline: image001.jpg>>

Reply via email to