diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-07-10 10:16:09 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-07-10 10:17:14 +0200 |
commit | 9c72b48199e5450b17edacedf04e5f2406b0d5c3 (patch) | |
tree | 6c167ade3c8b23ddd2ec0fd60cf6dd3a94f86386 /sonar-plugin-api | |
parent | 53fad895269bf78cf7b28fc97d84261dc42e2757 (diff) | |
download | sonarqube-9c72b48199e5450b17edacedf04e5f2406b0d5c3.tar.gz sonarqube-9c72b48199e5450b17edacedf04e5f2406b0d5c3.zip |
SONAR-5419 Add a hack for backward compatibility of visual studio bootstrapper
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java | 15 |
1 files changed, 15 insertions, 0 deletions
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 29fb31ce86f..7b5a059b680 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 @@ -291,6 +291,11 @@ public class ProjectDefinition { */ @Deprecated public ProjectDefinition addSourceFiles(String... paths) { + // Hack for visual studio project builder that used to add baseDir first as source dir + List<String> sourceDirs = getSourceDirs(); + if (sourceDirs.size() == 1 && new File(sourceDirs.get(0)).isDirectory()) { + resetSources(); + } return addSources(paths); } @@ -299,6 +304,11 @@ public class ProjectDefinition { */ @Deprecated public ProjectDefinition addSourceFiles(File... files) { + // Hack for visual studio project builder that used to add baseDir first as source dir + List<String> sourceDirs = getSourceDirs(); + if (sourceDirs.size() == 1 && new File(sourceDirs.get(0)).isDirectory()) { + resetSources(); + } return addSources(files); } @@ -404,6 +414,11 @@ public class ProjectDefinition { */ @Deprecated public ProjectDefinition addTestFiles(String... paths) { + // Hack for visual studio project builder that used to add baseDir first as test dir + List<String> testDirs = getTestDirs(); + if (testDirs.size() == 1 && new File(testDirs.get(0)).isDirectory()) { + resetTests(); + } return addTests(paths); } |