Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-7459

Ability to check SQ runtime version when a plugin declares its extensions

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5
    • Component/s: Plugin API
    • Labels:

      Description

      The plugin entry-point org.sonar.api.SonarPlugin should provide the ability to check runtime version of SQ in order to modify the list of declared extensions.
      Example:

      public class MyPlugin implements Plugin {
         @Override
         public void define(Context context) {
           context.addExtensions(MySensor.class, MyRules.class);
           if (context.getSonarQubeVersion().isGreaterThanOrEqual(SonarQubeVersion.V5_6)) {
             // Extension which supports only versions 5.6 and greater
             // See org.sonar.api.SonarQubeVersion for more details.
             context.addExtension(MyNewExtension.class);
           }
         }
       }
      

        Attachments

          Activity

            People

            Assignee:
            simon.brandhof Simon Brandhof (Inactive)
            Reporter:
            simon.brandhof Simon Brandhof (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: