diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2016-05-11 09:13:08 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2016-05-12 08:49:09 +0200 |
commit | d04b0fde3f735f89e37b15bcef26b44379a13e6e (patch) | |
tree | 79b225a819a3db1642a3f58176ed52347487ca43 /sonar-plugin-api | |
parent | f58fdc8b6b65f998e6addfecf7269625366523a5 (diff) | |
download | sonarqube-d04b0fde3f735f89e37b15bcef26b44379a13e6e.tar.gz sonarqube-d04b0fde3f735f89e37b15bcef26b44379a13e6e.zip |
SONAR-7612 Rework Initializer extension point to no more require to use Project
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/batch/Initializer.java | 21 |
1 files changed, 17 insertions, 4 deletions
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; /** * <p> - * 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. * <p> - * 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() { |