From 4e3edd5a810a59bf307e548ecbc14fd7de7eb690 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Thu, 9 Oct 2014 17:10:01 +0200 Subject: [PATCH] SONAR-5068 Deprecate binaries and libraries related methods --- .../ModuleFileSystemInitializer.java | 4 +++ .../batch/bootstrap/ProjectDefinition.java | 25 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ModuleFileSystemInitializer.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ModuleFileSystemInitializer.java index fa79c8e682d..3d6aec8934c 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ModuleFileSystemInitializer.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ModuleFileSystemInitializer.java @@ -106,6 +106,10 @@ public class ModuleFileSystemInitializer implements BatchComponent { return testDirsOrFiles; } + /** + * @deprecated since 4.5.1 use SonarQube Java specific API + */ + @Deprecated List binaryDirs() { return binaryDirs; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java index a5fa7ab0d93..ec3bb5efa07 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java @@ -62,7 +62,15 @@ public class ProjectDefinition { */ @Deprecated public static final String TEST_FILES_PROPERTY = "sonar.testFiles"; + /** + * @deprecated since 4.5.1 use SonarQube Java specific API + */ + @Deprecated public static final String BINARIES_PROPERTY = "sonar.binaries"; + /** + * @deprecated since 4.5.1 use SonarQube Java specific API + */ + @Deprecated public static final String LIBRARIES_PROPERTY = "sonar.libraries"; public static final String BUILD_DIR_PROPERTY = "sonar.buildDir"; @@ -450,6 +458,10 @@ public class ProjectDefinition { return tests(); } + /** + * @deprecated since 4.5.1 use SonarQube Java specific API + */ + @Deprecated public List getBinaries() { String sources = properties.getProperty(BINARIES_PROPERTY, ""); return trim(StringUtils.split(sources, SEPARATOR)); @@ -458,17 +470,26 @@ public class ProjectDefinition { /** * @param path path to directory with compiled source. In case of Java this is directory with class files. * It can be absolute or relative to project directory. - * TODO currently Sonar supports only one such directory due to dependency on MavenProject + * @deprecated since 4.5.1 use SonarQube Java specific API */ + @Deprecated public ProjectDefinition addBinaryDir(String path) { appendProperty(BINARIES_PROPERTY, path); return this; } + /** + * @deprecated since 4.5.1 use SonarQube Java specific API + */ + @Deprecated public ProjectDefinition addBinaryDir(File f) { return addBinaryDir(f.getAbsolutePath()); } + /** + * @deprecated since 4.5.1 use SonarQube Java specific API + */ + @Deprecated public List getLibraries() { String sources = properties.getProperty(LIBRARIES_PROPERTY, ""); return trim(StringUtils.split(sources, SEPARATOR)); @@ -477,7 +498,9 @@ public class ProjectDefinition { /** * @param path path to file with third-party library. In case of Java this is path to jar file. * It can be absolute or relative to project directory. + * @deprecated since 4.5.1 use SonarQube Java specific API */ + @Deprecated public void addLibrary(String path) { appendProperty(LIBRARIES_PROPERTY, path); } -- 2.39.5