aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch/src/main/java/org/sonar
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-12-05 11:13:09 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2014-12-05 11:40:37 +0100
commit80ff8563344f727ee611f3c6932d4af063bb5605 (patch)
tree04d4e387077e4ce864ad745dc426d808e31ff447 /sonar-batch/src/main/java/org/sonar
parent781301a7ee5520efb5a00cc3ee99302abfaabf00 (diff)
downloadsonarqube-80ff8563344f727ee611f3c6932d4af063bb5605.tar.gz
sonarqube-80ff8563344f727ee611f3c6932d4af063bb5605.zip
Fix regression concerning SONAR-5878 (custom working directory was not considered)
Diffstat (limited to 'sonar-batch/src/main/java/org/sonar')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/index/SourcePersister.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java9
2 files changed, 5 insertions, 8 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/SourcePersister.java b/sonar-batch/src/main/java/org/sonar/batch/index/SourcePersister.java
index 55b5b4f4b94..186e37edaa6 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/index/SourcePersister.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/index/SourcePersister.java
@@ -71,7 +71,6 @@ public class SourcePersister implements ScanPersister {
private static final Logger LOG = LoggerFactory.getLogger(SourcePersister.class);
private static final String BOM = "\uFEFF";
- private final ResourcePersister resourcePersister;
private final InputPathCache inputPathCache;
private final MyBatis mybatis;
private final MeasureCache measureCache;
@@ -82,10 +81,9 @@ public class SourcePersister implements ScanPersister {
private CodeColorizers codeColorizers;
private DuplicationCache duplicationCache;
- public SourcePersister(ResourcePersister resourcePersister, InputPathCache inputPathCache,
+ public SourcePersister(InputPathCache inputPathCache,
MyBatis mybatis, MeasureCache measureCache, ComponentDataCache componentDataCache, ProjectTree projectTree, System2 system2,
ResourceCache resourceCache, CodeColorizers codeColorizers, DuplicationCache duplicationCache) {
- this.resourcePersister = resourcePersister;
this.inputPathCache = inputPathCache;
this.mybatis = mybatis;
this.measureCache = measureCache;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
index 58417768e00..fbed697fec7 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java
@@ -115,8 +115,7 @@ public class ProjectReactorBuilder {
rootProjectWorkDir = rootProject.getWorkDir();
defineChildren(rootProject, propertiesByModuleId);
cleanAndCheckProjectDefinitions(rootProject);
- // Optimization remove all children properties from taskProps
- taskProps.properties().clear();
+ // Since task properties are now empty we should add root module properties
for (Map.Entry<String, String> entry : propertiesByModuleId.get("").entrySet()) {
taskProps.properties().put((String) entry.getKey(), (String) entry.getValue());
}
@@ -157,7 +156,7 @@ public class ProjectReactorBuilder {
File workDir;
if (parent == null) {
validateDirectories(rootProperties, baseDir, projectKey);
- workDir = initRootProjectWorkDir(baseDir);
+ workDir = initRootProjectWorkDir(baseDir, rootProperties);
} else {
workDir = initModuleWorkDir(baseDir, rootProperties);
}
@@ -169,8 +168,8 @@ public class ProjectReactorBuilder {
}
@VisibleForTesting
- protected File initRootProjectWorkDir(File baseDir) {
- String workDir = taskProps.property(CoreProperties.WORKING_DIRECTORY);
+ protected File initRootProjectWorkDir(File baseDir, Map<String, String> rootProperties) {
+ String workDir = rootProperties.get(CoreProperties.WORKING_DIRECTORY);
if (StringUtils.isBlank(workDir)) {
return new File(baseDir, CoreProperties.WORKING_DIRECTORY_DEFAULT_VALUE);
}