开发者

Hudson, is it possible to make a plugin configuration non-visible depending on job type?

开发者 https://www.devze.com 2023-01-03 23:16 出处:网络
With the plugin (SCM plugin) I\'m working on the problem is that it doesn\'t work in any other job/project type than Freestyle-project. I\'d like to hide the plugin configuration from project configur

With the plugin (SCM plugin) I'm working on the problem is that it doesn't work in any other job/project type than Freestyle-project. I'd like to hide the plugin configuration from project configuration page on other job/project types (maven, matrix etc), because it seems to distract people. I wonder if there's a "right" way of doing this, or any way at all?

Currently the project type is checked in checkout-method as a first thing, and if it doesn't match, the build is failed instantly, but this is not completely satisfactory solution, since it causes a bit more work to the end user.

Edit: I have a hunch that this could be possible by making some magic in descriptor associated to SCM class, but I'm still a bit short.

Edit #2: managed to solve this, I have been a开发者_StackOverflow社区 bit drowsy it seems. Big Thanks for everyone who bothered their minds even a bit on this one.


Solved this one. In SCMDescriptor there's this isApplicable method, that can be used to filter out the project types where plugin configuration is either shown ot not shown, like this:

@Override
    public boolean isApplicable(AbstractProject project)
    {
        if(!(project instanceof FreeStyleProject))
            return false;
        return true;
    }

so this solved my problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消