From: Julien Lancelot Date: Wed, 9 Apr 2014 13:22:45 +0000 (+0200) Subject: SONAR-5185 Deprecate "sonar.dynamicAnalysis" feature X-Git-Tag: 4.3~78 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1cd2e9ef68c3975e920f1f57f7eabf98997204fb;p=sonarqube.git SONAR-5185 Deprecate "sonar.dynamicAnalysis" feature --- diff --git a/sonar-batch/src/main/java/org/sonar/batch/ProjectConfigurator.java b/sonar-batch/src/main/java/org/sonar/batch/ProjectConfigurator.java index 3e3626069a4..399ecf5e0ba 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/ProjectConfigurator.java +++ b/sonar-batch/src/main/java/org/sonar/batch/ProjectConfigurator.java @@ -22,6 +22,8 @@ package org.sonar.batch; import org.apache.commons.configuration.PropertiesConfiguration; import org.apache.commons.lang.StringUtils; import org.apache.maven.project.MavenProject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.api.BatchComponent; import org.sonar.api.CoreProperties; import org.sonar.api.batch.bootstrap.ProjectDefinition; @@ -37,6 +39,8 @@ import java.util.Date; public class ProjectConfigurator implements BatchComponent { + private static final Logger LOG = LoggerFactory.getLogger(ProjectConfigurator.class); + private DatabaseSession databaseSession; private Settings settings; @@ -62,7 +66,7 @@ public class ProjectConfigurator implements BatchComponent { return project; } - String loadProjectBranch() { + private String loadProjectBranch() { return settings.getString(CoreProperties.PROJECT_BRANCH_PROPERTY); } @@ -94,7 +98,7 @@ public class ProjectConfigurator implements BatchComponent { } - Date loadAnalysisDate() { + private Date loadAnalysisDate() { Date date; try { // sonar.projectDate may have been specified as a time @@ -110,11 +114,13 @@ public class ProjectConfigurator implements BatchComponent { return date; } - Project.AnalysisType loadAnalysisType() { + private Project.AnalysisType loadAnalysisType() { String value = settings.getString(CoreProperties.DYNAMIC_ANALYSIS_PROPERTY); if (value == null) { return Project.AnalysisType.DYNAMIC; } + + LOG.warn("'sonar.dynamicAnalysis' property is deprecated since version 4.3 and should not be used anymore. It's the responsibility of plugins to gather test information."); if ("true".equals(value)) { return Project.AnalysisType.DYNAMIC; } @@ -124,7 +130,7 @@ public class ProjectConfigurator implements BatchComponent { return Project.AnalysisType.STATIC; } - String loadAnalysisVersion() { + private String loadAnalysisVersion() { return settings.getString(CoreProperties.PROJECT_VERSION_PROPERTY); } } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java index 7c1ed5e91f1..2b105f454fe 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java @@ -163,6 +163,11 @@ public interface CoreProperties { */ @Deprecated String PROJECT_LANGUAGE_PROPERTY = "sonar.language"; + + /** + * @deprecated since 4.3. See http://jira.codehaus.org/browse/SONAR-5185 + */ + @Deprecated String DYNAMIC_ANALYSIS_PROPERTY = "sonar.dynamicAnalysis"; /* Exclusions */