tags:

views:

29

answers:

1

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 bit drowsy it seems. Big Thanks for everyone who bothered their minds even a bit on this one.

+1  A: 

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.

Haju

related questions