How can I get the project settings from a RunType and AgentBuildRunner?

I've created a ProjectTab+ProjectSettings+Factory (and all that dance) so I can set project-wide settings for my plugin, but I can't find how to get the information in the project settings from my RunType class. My plugin access a 3rd party API so I need to get the API Key from the project settings. Injecting SProject+ProjectSettingsManager into the RunType constructor doesn't work, how can I do it?

I also need the API Key on my AgentBuildRunner, how can I get it from my project settings?

Personal note: this is my first attempt to build a plugin and it is frustraiting most of the time the docs are almost irrelevant. My only option is to the download the source code of as many plugin as I can find and read them to see anyone does what I want to do.

1 comment
Comment actions Permalink

RunType is just a description of build runner, usually it does not depend on project. As I understand you need to add some API key configured in project settings to the build sent to the agent. The easiest way to do that is to implement jetbrains.buildServer.serverSide.ParametersPreprocessor and modify build parameters before build is sent to an agent. Let me know if you need more details.

0

Please sign in to leave a comment.