I'm writing an agent plugin. Its purpose is to intercept the command line that would be forwarded to any runner and modify it by wrapping it with an outer command line.
For developement only, I've implemented MyCommandLineBuildServiceFactory to return MyCommandLineBuildService from createService(). As well, just for testing purposes, the AgentBuildRunnerInfo within it returns, "Ant" through its getType() method.
MyCommandLineBuildService extends BuildServiceAdapter. From its makeProgramCommandLine() method, I can create a new SimpleProgramCommandLine that is specific to the runner type ("Ant", in this case).
What I would like to know, is there a mechanism whereby I can be served up a prepared command line, from any runner type? From my point of view, it feels like I have to implement a CommandLineBuildServiceFactory for each runner type that I would like to intercept. As well, it feels like I would have to implement a CommandLineBuildService for each run type for which I'd want to modify its command line. I think that I may have to extend CommandLineBuildService instead of BuildServiceAdapter as the JaveDocs suggest, but I'm not yet sure. You guys do such a great job of putting together all of those varied command lines, it would be a shame to throw them out and have to re-invent the wheel.
I hope this isn't too abstract without code samples; there really isn't very much to get this up and running; it's just getting it to do what I need.
Cheers & Thanks.