Reputation: 1786
I'm developing plugin for TeamCity 10.
I have created Listener to do something during build:
public class XYZBuidListener extends BuildServerAdapter {
@Override
public void buildFinished(@NotNull SRunningBuild build) {
Loggers.SERVER.info("FINISHED");
sendNotification(build);
}
@Override
public void buildStarted(@NotNull SRunningBuild build) {
Loggers.SERVER.info("STARTED");
sendNotification(build);
}
@Override
public void buildInterrupted(@NotNull SRunningBuild build) {
Loggers.SERVER.info("Interrupted");
sendNotification(build);
}
}
On each event I'd like to write something into Build Log tab. Unfortunetly nothing that I have tried worked. E.g I tried to write something as error message:
build.getBuildLog().getErrorMessages().add(new LogMessage(...))
Just to avoid confusion - this is what I've meant as "Build Log tab"
Upvotes: 0
Views: 353
Reputation: 3249
The TeamCity plugin model makes heavy use of Spring beans. Have a look at how other plugins are implemented, for example the SinCity plugin (disclaimer: I'm the author), specifically:
Good luck!
Upvotes: 1