gerrit/gerrit-plugin-api
Luca Milanesio 737285df3f Allow plugins to contribute InitStep to Gerrit init.
Plugin has to include a class that implements
com.google.gerrit.pgm.init.InitStep and specifying
the class name into the Plugin MANIFEST.MF.

Plugin InitStep is getting instantiated using the
Gerrit PGM injector and then is able to access
the same init objects.

Example:
--------
public class InitJira implements InitStep {
  private ConsoleUI ui;

  @Inject
  public InitJira(final ConsoleUI ui, final Section.Factory sections) {
    this.ui = ui;
    this.sections = sections;
  }

  @Override
  public void run() throws Exception {
    ui.header("Jira integration");
    // Jira-specific init steps.

    Section jira = sections.get("link", "jira");
    // Jira-specific link expansions
  }
}

MANIFEST.MF:
------------
Gerrit-InitStep: com.googlesource.plugins.jira.InitJira

Change-Id: I84fcb9acd6845c706961657219a14570e2060b0f
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
2012-10-22 10:07:31 -07:00
..
.gitignore Fix the name of IDEA project files 2012-05-15 10:10:05 -07:00
pom.xml Allow plugins to contribute InitStep to Gerrit init. 2012-10-22 10:07:31 -07:00