From: Julien HENRY Date: Wed, 11 May 2016 07:13:08 +0000 (+0200) Subject: SONAR-7612 Rework Initializer extension point to no more require to use Project X-Git-Tag: 5.6-RC1~141 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d04b0fde3f735f89e37b15bcef26b44379a13e6e;p=sonarqube.git SONAR-7612 Rework Initializer extension point to no more require to use Project --- diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/Initializer.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/Initializer.java index 66e2f9f27db..2a5ec53ff73 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/Initializer.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/Initializer.java @@ -20,26 +20,39 @@ package org.sonar.api.batch; import org.sonar.api.ExtensionPoint; +import org.sonar.api.batch.fs.FileSystem; import org.sonar.api.resources.Project; /** *

- * Initializer can execute external tool (like a Maven plugin), change project configuration. For example CoberturaMavenInitializer invokes - * the Codehaus Cobertura Mojo and sets path to Cobertura report according to Maven POM. + * Initializer are executed at the very beginning of each module analysis, prior the core listing files to be analyzed. It means {@link FileSystem} should not be accessed. *

- * Initializers are executed first and once during project analysis. * @since 2.6 */ @BatchSide @ExtensionPoint public abstract class Initializer implements CheckProject { + /** + * @deprecated since 5.6 should no more be implemented by plugins + */ + @Deprecated @Override public boolean shouldExecuteOnProject(Project project) { return true; } - public abstract void execute(Project project); + /** + * @deprecated since 5.6 override {@link #execute()} instead + */ + @Deprecated + public void execute(Project project) { + execute(); + } + + public void execute() { + // To be implemented by client + } @Override public String toString() {