@@ -68,8 +68,8 @@ import org.sonar.server.component.ComponentCleanerService; | |||
import org.sonar.server.component.ComponentFinder; | |||
import org.sonar.server.component.ComponentService; | |||
import org.sonar.server.computation.CeModule; | |||
import org.sonar.server.computation.container.ReportProcessingModule; | |||
import org.sonar.server.computation.queue.CeQueueModule; | |||
import org.sonar.server.computation.task.projectanalysis.ProjectAnalysisTaskModule; | |||
import org.sonar.server.computation.CeQueueModule; | |||
import org.sonar.server.computation.queue.PurgeCeActivities; | |||
import org.sonar.server.computation.taskprocessor.CeTaskProcessorModule; | |||
import org.sonar.server.debt.DebtModelPluginRepository; | |||
@@ -551,7 +551,7 @@ public class ComputeEngineContainerImpl implements ComputeEngineContainer { | |||
// Compute engine (must be after Views and Developer Cockpit) | |||
CeModule.class, | |||
CeQueueModule.class, | |||
ReportProcessingModule.class, | |||
ProjectAnalysisTaskModule.class, | |||
CeTaskProcessorModule.class, | |||
// CeWsModule.class, no Web Service in CE | |||
@@ -86,7 +86,7 @@ public class ComputeEngineContainerImplTest { | |||
+ 75 // level 4 | |||
+ 7 // content of CeModule | |||
+ 7 // content of CeQueueModule | |||
+ 4 // content of ReportProcessingModule | |||
+ 4 // content of ProjectAnalysisTaskModule | |||
+ 4 // content of CeTaskProcessorModule | |||
); | |||
assertThat(picoContainer.getParent().getComponentAdapters()).hasSize( |
@@ -20,10 +20,11 @@ | |||
package org.sonar.ce.settings; | |||
import org.picocontainer.Startable; | |||
import org.sonar.server.computation.container.EagerStart; | |||
import org.sonar.server.computation.task.container.EagerStart; | |||
import org.sonar.server.computation.task.container.TaskContainerImpl; | |||
/** | |||
* Add this class as the first components in the {@link org.sonar.server.computation.container.ComputeEngineContainerImpl} | |||
* Add this class as the first components in the {@link TaskContainerImpl} | |||
* to trigger loading of Thread local specific {@link org.sonar.api.config.Settings} in {@link ThreadLocalSettings}. | |||
*/ | |||
@EagerStart |
@@ -17,13 +17,16 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.queue; | |||
package org.sonar.server.computation; | |||
import org.sonar.ce.queue.report.ReportFiles; | |||
import org.sonar.core.platform.Module; | |||
import org.sonar.server.computation.monitoring.CEQueueStatusImpl; | |||
import org.sonar.server.computation.monitoring.CeTasksMBeanImpl; | |||
import org.sonar.server.computation.queue.report.CleanReportQueueListener; | |||
import org.sonar.server.computation.queue.CeQueueCleaner; | |||
import org.sonar.server.computation.queue.CeQueueInitializer; | |||
import org.sonar.server.computation.queue.InternalCeQueueImpl; | |||
import org.sonar.server.computation.task.projectanalysis.queue.CleanReportQueueListener; | |||
public class CeQueueModule extends Module { | |||
@Override | |||
@@ -38,7 +41,6 @@ public class CeQueueModule extends Module { | |||
// queue cleaning | |||
CeQueueCleaner.class, | |||
CleanReportQueueListener.class, | |||
ReportFiles.class, | |||
// init queue state and queue processing |
@@ -1,235 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.container; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
import javax.annotation.Nullable; | |||
import org.sonar.ce.queue.CeTask; | |||
import org.sonar.ce.settings.SettingsLoader; | |||
import org.sonar.core.issue.tracking.Tracker; | |||
import org.sonar.core.platform.ContainerPopulator; | |||
import org.sonar.plugin.ce.ReportAnalysisComponentProvider; | |||
import org.sonar.server.computation.analysis.AnalysisMetadataHolderImpl; | |||
import org.sonar.server.computation.batch.BatchReportDirectoryHolderImpl; | |||
import org.sonar.server.computation.batch.BatchReportReaderImpl; | |||
import org.sonar.server.computation.component.DbIdsRepositoryImpl; | |||
import org.sonar.server.computation.component.DisabledComponentsHolderImpl; | |||
import org.sonar.server.computation.component.SettingsRepositoryImpl; | |||
import org.sonar.server.computation.component.TreeRootHolderImpl; | |||
import org.sonar.server.computation.duplication.CrossProjectDuplicationStatusHolderImpl; | |||
import org.sonar.server.computation.duplication.DuplicationRepositoryImpl; | |||
import org.sonar.server.computation.duplication.IntegrateCrossProjectDuplications; | |||
import org.sonar.server.computation.event.EventRepositoryImpl; | |||
import org.sonar.server.computation.filemove.FileSimilarityImpl; | |||
import org.sonar.server.computation.filemove.MutableMovedFilesRepositoryImpl; | |||
import org.sonar.server.computation.filemove.SourceSimilarityImpl; | |||
import org.sonar.server.computation.filesystem.ComputationTempFolderProvider; | |||
import org.sonar.server.computation.issue.BaseIssuesLoader; | |||
import org.sonar.server.computation.issue.CloseIssuesOnRemovedComponentsVisitor; | |||
import org.sonar.server.computation.issue.ComponentIssuesRepositoryImpl; | |||
import org.sonar.server.computation.issue.ComponentsWithUnprocessedIssues; | |||
import org.sonar.server.computation.issue.DebtCalculator; | |||
import org.sonar.server.computation.issue.DefaultAssignee; | |||
import org.sonar.server.computation.issue.EffortAggregator; | |||
import org.sonar.server.computation.issue.IntegrateIssuesVisitor; | |||
import org.sonar.server.computation.issue.IssueAssigner; | |||
import org.sonar.server.computation.issue.IssueCache; | |||
import org.sonar.server.computation.issue.IssueCounter; | |||
import org.sonar.server.computation.issue.IssueLifecycle; | |||
import org.sonar.server.computation.issue.IssueVisitors; | |||
import org.sonar.server.computation.issue.LoadComponentUuidsHavingOpenIssuesVisitor; | |||
import org.sonar.server.computation.issue.MovedIssueVisitor; | |||
import org.sonar.server.computation.issue.NewEffortAggregator; | |||
import org.sonar.server.computation.issue.NewEffortCalculator; | |||
import org.sonar.server.computation.issue.RuleRepositoryImpl; | |||
import org.sonar.server.computation.issue.RuleTagsCopier; | |||
import org.sonar.server.computation.issue.RuleTypeCopier; | |||
import org.sonar.server.computation.issue.ScmAccountToUser; | |||
import org.sonar.server.computation.issue.ScmAccountToUserLoader; | |||
import org.sonar.server.computation.issue.TrackerBaseInputFactory; | |||
import org.sonar.server.computation.issue.TrackerExecution; | |||
import org.sonar.server.computation.issue.TrackerRawInputFactory; | |||
import org.sonar.server.computation.issue.UpdateConflictResolver; | |||
import org.sonar.server.computation.issue.commonrule.BranchCoverageRule; | |||
import org.sonar.server.computation.issue.commonrule.CommentDensityRule; | |||
import org.sonar.server.computation.issue.commonrule.CommonRuleEngineImpl; | |||
import org.sonar.server.computation.issue.commonrule.DuplicatedBlockRule; | |||
import org.sonar.server.computation.issue.commonrule.LineCoverageRule; | |||
import org.sonar.server.computation.issue.commonrule.SkippedTestRule; | |||
import org.sonar.server.computation.issue.commonrule.TestErrorRule; | |||
import org.sonar.server.computation.issue.filter.IssueFilter; | |||
import org.sonar.server.computation.language.LanguageRepositoryImpl; | |||
import org.sonar.server.computation.measure.MeasureComputersHolderImpl; | |||
import org.sonar.server.computation.measure.MeasureComputersVisitor; | |||
import org.sonar.server.computation.measure.MeasureRepositoryImpl; | |||
import org.sonar.server.computation.measure.MeasureToMeasureDto; | |||
import org.sonar.server.computation.metric.MetricModule; | |||
import org.sonar.server.computation.period.PeriodsHolderImpl; | |||
import org.sonar.server.computation.posttask.PostProjectAnalysisTasksExecutor; | |||
import org.sonar.server.computation.qualitygate.EvaluationResultTextConverterImpl; | |||
import org.sonar.server.computation.qualitygate.QualityGateHolderImpl; | |||
import org.sonar.server.computation.qualitygate.QualityGateServiceImpl; | |||
import org.sonar.server.computation.qualitygate.QualityGateStatusHolderImpl; | |||
import org.sonar.server.computation.qualitymodel.NewQualityModelMeasuresVisitor; | |||
import org.sonar.server.computation.qualitymodel.QualityModelMeasuresVisitor; | |||
import org.sonar.server.computation.qualitymodel.RatingSettings; | |||
import org.sonar.server.computation.qualityprofile.ActiveRulesHolderImpl; | |||
import org.sonar.server.computation.scm.ScmInfoRepositoryImpl; | |||
import org.sonar.server.computation.source.LastCommitVisitor; | |||
import org.sonar.server.computation.source.SourceHashRepositoryImpl; | |||
import org.sonar.server.computation.source.SourceLinesRepositoryImpl; | |||
import org.sonar.server.computation.step.ComputationStepExecutor; | |||
import org.sonar.server.computation.step.ComputationSteps; | |||
import org.sonar.server.computation.step.ReportComputationSteps; | |||
import org.sonar.server.computation.taskprocessor.MutableTaskResultHolderImpl; | |||
import org.sonar.server.view.index.ViewIndex; | |||
public final class ReportComputeEngineContainerPopulator implements ContainerPopulator<ComputeEngineContainer> { | |||
private static final ReportAnalysisComponentProvider[] NO_REPORT_ANALYSIS_COMPONENT_PROVIDERS = new ReportAnalysisComponentProvider[0]; | |||
private final CeTask task; | |||
private final ReportAnalysisComponentProvider[] componentProviders; | |||
public ReportComputeEngineContainerPopulator(CeTask task, @Nullable ReportAnalysisComponentProvider[] componentProviders) { | |||
this.task = task; | |||
this.componentProviders = componentProviders == null ? NO_REPORT_ANALYSIS_COMPONENT_PROVIDERS : componentProviders; | |||
} | |||
@Override | |||
public void populateContainer(ComputeEngineContainer container) { | |||
ComputationSteps steps = new ReportComputationSteps(container); | |||
container.add(SettingsLoader.class); | |||
container.add(task); | |||
container.add(steps); | |||
container.addSingletons(componentClasses()); | |||
for (ReportAnalysisComponentProvider componentProvider : componentProviders) { | |||
container.addSingletons(componentProvider.getComponents()); | |||
} | |||
container.addSingletons(steps.orderedStepClasses()); | |||
} | |||
/** | |||
* List of all objects to be injected in the picocontainer dedicated to computation stack. | |||
* Does not contain the steps declared in {@link ReportComputationSteps#orderedStepClasses()}. | |||
*/ | |||
private static List componentClasses() { | |||
return Arrays.asList( | |||
PostProjectAnalysisTasksExecutor.class, | |||
ComputationStepExecutor.class, | |||
// File System | |||
new ComputationTempFolderProvider(), | |||
MetricModule.class, | |||
// holders | |||
AnalysisMetadataHolderImpl.class, | |||
CrossProjectDuplicationStatusHolderImpl.class, | |||
BatchReportDirectoryHolderImpl.class, | |||
TreeRootHolderImpl.class, | |||
PeriodsHolderImpl.class, | |||
QualityGateHolderImpl.class, | |||
QualityGateStatusHolderImpl.class, | |||
RatingSettings.class, | |||
ActiveRulesHolderImpl.class, | |||
MeasureComputersHolderImpl.class, | |||
MutableTaskResultHolderImpl.class, | |||
BatchReportReaderImpl.class, | |||
// repositories | |||
LanguageRepositoryImpl.class, | |||
MeasureRepositoryImpl.class, | |||
EventRepositoryImpl.class, | |||
SettingsRepositoryImpl.class, | |||
DbIdsRepositoryImpl.class, | |||
DisabledComponentsHolderImpl.class, | |||
QualityGateServiceImpl.class, | |||
EvaluationResultTextConverterImpl.class, | |||
SourceLinesRepositoryImpl.class, | |||
SourceHashRepositoryImpl.class, | |||
ScmInfoRepositoryImpl.class, | |||
DuplicationRepositoryImpl.class, | |||
// issues | |||
RuleRepositoryImpl.class, | |||
ScmAccountToUserLoader.class, | |||
ScmAccountToUser.class, | |||
IssueCache.class, | |||
DefaultAssignee.class, | |||
IssueVisitors.class, | |||
IssueLifecycle.class, | |||
ComponentsWithUnprocessedIssues.class, | |||
ComponentIssuesRepositoryImpl.class, | |||
IssueFilter.class, | |||
// common rules | |||
CommonRuleEngineImpl.class, | |||
BranchCoverageRule.class, | |||
LineCoverageRule.class, | |||
CommentDensityRule.class, | |||
DuplicatedBlockRule.class, | |||
TestErrorRule.class, | |||
SkippedTestRule.class, | |||
// order is important: RuleTypeCopier must be the first one. And DebtAggregator must be before NewDebtAggregator (new debt requires | |||
// debt) | |||
RuleTypeCopier.class, | |||
RuleTagsCopier.class, | |||
DebtCalculator.class, | |||
EffortAggregator.class, | |||
NewEffortCalculator.class, | |||
NewEffortAggregator.class, | |||
IssueAssigner.class, | |||
IssueCounter.class, | |||
MovedIssueVisitor.class, | |||
// visitors : order is important, measure computers must be executed at the end in order to access to every measures / issues | |||
LoadComponentUuidsHavingOpenIssuesVisitor.class, | |||
IntegrateIssuesVisitor.class, | |||
CloseIssuesOnRemovedComponentsVisitor.class, | |||
QualityModelMeasuresVisitor.class, | |||
NewQualityModelMeasuresVisitor.class, | |||
LastCommitVisitor.class, | |||
MeasureComputersVisitor.class, | |||
UpdateConflictResolver.class, | |||
TrackerBaseInputFactory.class, | |||
TrackerRawInputFactory.class, | |||
Tracker.class, | |||
TrackerExecution.class, | |||
BaseIssuesLoader.class, | |||
// filemove | |||
SourceSimilarityImpl.class, | |||
FileSimilarityImpl.class, | |||
MutableMovedFilesRepositoryImpl.class, | |||
// duplication | |||
IntegrateCrossProjectDuplications.class, | |||
// views | |||
ViewIndex.class, | |||
MeasureToMeasureDto.class); | |||
} | |||
} |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.developer; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.duplication; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.event; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.filesystem; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.formula.counter; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.formula.coverage; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.formula; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.issue.commonrule; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.issue.filter; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.issue; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.language; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.measure.api; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.measure; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.metric; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.period; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.posttask; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.qualitygate; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.qualitymodel; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.qualityprofile; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.queue.report; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.scm; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.source; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -1,23 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.step; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.container; | |||
package org.sonar.server.computation.task.container; | |||
import java.lang.annotation.ElementType; | |||
import java.lang.annotation.Retention; | |||
@@ -25,7 +25,7 @@ import java.lang.annotation.RetentionPolicy; | |||
import java.lang.annotation.Target; | |||
/** | |||
* Components with this annotation will be eagerly started when loaded into the {@link ComputeEngineContainerImpl}. | |||
* Components with this annotation will be eagerly started when loaded into the {@link TaskContainerImpl}. | |||
*/ | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@Target(ElementType.TYPE) |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.container; | |||
package org.sonar.server.computation.task.container; | |||
import org.picocontainer.PicoContainer; | |||
import org.sonar.ce.queue.CeTask; | |||
@@ -27,7 +27,7 @@ import org.sonar.core.platform.ContainerPopulator; | |||
/** | |||
* The Compute Engine container. Created for a specific parent {@link ComponentContainer} and a specific {@link CeTask}. | |||
*/ | |||
public interface ComputeEngineContainer extends ContainerPopulator.Container { | |||
public interface TaskContainer extends ContainerPopulator.Container { | |||
ComponentContainer getParent(); | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.container; | |||
package org.sonar.server.computation.task.container; | |||
import java.util.List; | |||
import org.picocontainer.ComponentAdapter; | |||
@@ -35,16 +35,16 @@ import org.sonar.core.platform.Module; | |||
import static java.util.Objects.requireNonNull; | |||
public class ComputeEngineContainerImpl extends ComponentContainer implements ComputeEngineContainer { | |||
public class TaskContainerImpl extends ComponentContainer implements TaskContainer { | |||
public ComputeEngineContainerImpl(ComponentContainer parent, ContainerPopulator<ComputeEngineContainer> populator) { | |||
public TaskContainerImpl(ComponentContainer parent, ContainerPopulator<TaskContainer> populator) { | |||
super(createContainer(requireNonNull(parent)), parent.getComponentByType(PropertyDefinitions.class)); | |||
populateContainer(requireNonNull(populator)); | |||
startComponents(); | |||
} | |||
private void populateContainer(ContainerPopulator<ComputeEngineContainer> populator) { | |||
private void populateContainer(ContainerPopulator<TaskContainer> populator) { | |||
populator.populateContainer(this); | |||
populateFromModules(); | |||
} | |||
@@ -77,12 +77,12 @@ public class ComputeEngineContainerImpl extends ComponentContainer implements Co | |||
try { | |||
stopComponents(); | |||
} catch (Throwable t) { | |||
Loggers.get(ComputeEngineContainerImpl.class).error("Cleanup of container failed", t); | |||
Loggers.get(TaskContainerImpl.class).error("Cleanup of container failed", t); | |||
} | |||
} | |||
@Override | |||
public String toString() { | |||
return "ComputeEngineContainerImpl"; | |||
return "TaskContainerImpl"; | |||
} | |||
} |
@@ -18,6 +18,6 @@ | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.batch; | |||
package org.sonar.server.computation.task.container; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -17,21 +17,26 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.container; | |||
package org.sonar.server.computation.task.projectanalysis; | |||
import org.sonar.core.platform.Module; | |||
import org.sonar.ce.queue.report.ReportSubmitter; | |||
import org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor; | |||
import org.sonar.server.computation.step.ComputationStepExecutor; | |||
import org.sonar.core.platform.Module; | |||
import org.sonar.server.computation.task.projectanalysis.container.ContainerFactoryImpl; | |||
import org.sonar.server.computation.task.projectanalysis.queue.CleanReportQueueListener; | |||
import org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor; | |||
import org.sonar.server.computation.task.step.ComputationStepExecutor; | |||
public class ReportProcessingModule extends Module { | |||
public class ProjectAnalysisTaskModule extends Module { | |||
@Override | |||
protected void configureModule() { | |||
add( | |||
ContainerFactoryImpl.class, | |||
ComputationStepExecutor.class, | |||
ReportTaskProcessor.class, | |||
ReportSubmitter.class | |||
); | |||
// queue | |||
CleanReportQueueListener.class, | |||
// task | |||
ContainerFactoryImpl.class, | |||
ComputationStepExecutor.class, | |||
ReportTaskProcessor.class, | |||
ReportSubmitter.class); | |||
} | |||
} |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.analysis; | |||
package org.sonar.server.computation.task.projectanalysis.analysis; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; |
@@ -17,11 +17,11 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.analysis; | |||
package org.sonar.server.computation.task.projectanalysis.analysis; | |||
import java.util.Map; | |||
import javax.annotation.CheckForNull; | |||
import org.sonar.server.computation.qualityprofile.QualityProfile; | |||
import org.sonar.server.computation.task.projectanalysis.qualityprofile.QualityProfile; | |||
public interface AnalysisMetadataHolder { | |||
@@ -17,13 +17,13 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.analysis; | |||
package org.sonar.server.computation.task.projectanalysis.analysis; | |||
import com.google.common.collect.ImmutableMap; | |||
import java.util.Map; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
import org.sonar.server.computation.qualityprofile.QualityProfile; | |||
import org.sonar.server.computation.task.projectanalysis.qualityprofile.QualityProfile; | |||
import org.sonar.server.computation.util.InitializedProperty; | |||
import static com.google.common.base.Preconditions.checkState; |
@@ -17,11 +17,11 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.analysis; | |||
package org.sonar.server.computation.task.projectanalysis.analysis; | |||
import java.util.Map; | |||
import javax.annotation.Nullable; | |||
import org.sonar.server.computation.qualityprofile.QualityProfile; | |||
import org.sonar.server.computation.task.projectanalysis.qualityprofile.QualityProfile; | |||
public interface MutableAnalysisMetadataHolder extends AnalysisMetadataHolder { | |||
@@ -0,0 +1,23 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.task.projectanalysis.analysis; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.developer; | |||
package org.sonar.server.computation.task.projectanalysis.api.developer; | |||
/** | |||
* This interface is used to delegate the persistence of developers to the Developer Cockpit plugin |
@@ -0,0 +1,23 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.task.projectanalysis.api.developer; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.measure.api; | |||
package org.sonar.server.computation.task.projectanalysis.api.measurecomputer; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.measure.api; | |||
package org.sonar.server.computation.task.projectanalysis.api.measurecomputer; | |||
import com.google.common.base.Function; | |||
import com.google.common.base.Optional; | |||
@@ -34,16 +34,16 @@ import org.sonar.api.ce.measure.Issue; | |||
import org.sonar.api.ce.measure.Measure; | |||
import org.sonar.api.ce.measure.Settings; | |||
import org.sonar.core.issue.DefaultIssue; | |||
import org.sonar.server.computation.component.SettingsRepository; | |||
import org.sonar.server.computation.issue.ComponentIssuesRepository; | |||
import org.sonar.server.computation.measure.MeasureRepository; | |||
import org.sonar.server.computation.metric.Metric; | |||
import org.sonar.server.computation.metric.MetricRepository; | |||
import org.sonar.server.computation.task.projectanalysis.component.SettingsRepository; | |||
import org.sonar.server.computation.task.projectanalysis.issue.ComponentIssuesRepository; | |||
import org.sonar.server.computation.task.projectanalysis.measure.MeasureRepository; | |||
import org.sonar.server.computation.task.projectanalysis.metric.Metric; | |||
import org.sonar.server.computation.task.projectanalysis.metric.MetricRepository; | |||
import static com.google.common.base.Preconditions.checkArgument; | |||
import static org.sonar.api.ce.measure.MeasureComputer.MeasureComputerContext; | |||
import static org.sonar.api.ce.measure.MeasureComputer.MeasureComputerDefinition; | |||
import static org.sonar.server.computation.measure.Measure.newMeasureBuilder; | |||
import static org.sonar.server.computation.task.projectanalysis.measure.Measure.newMeasureBuilder; | |||
public class MeasureComputerContextImpl implements MeasureComputerContext { | |||
@@ -51,14 +51,14 @@ public class MeasureComputerContextImpl implements MeasureComputerContext { | |||
private final MeasureRepository measureRepository; | |||
private final MetricRepository metricRepository; | |||
private final org.sonar.server.computation.component.Component internalComponent; | |||
private final org.sonar.server.computation.task.projectanalysis.component.Component internalComponent; | |||
private final Component component; | |||
private final List<DefaultIssue> componentIssues; | |||
private MeasureComputerDefinition definition; | |||
private Set<String> allowedMetrics; | |||
public MeasureComputerContextImpl(org.sonar.server.computation.component.Component component, SettingsRepository settings, | |||
public MeasureComputerContextImpl(org.sonar.server.computation.task.projectanalysis.component.Component component, SettingsRepository settings, | |||
MeasureRepository measureRepository, MetricRepository metricRepository, ComponentIssuesRepository componentIssuesRepository) { | |||
this.settings = settings; | |||
this.internalComponent = component; | |||
@@ -114,7 +114,7 @@ public class MeasureComputerContextImpl implements MeasureComputerContext { | |||
@CheckForNull | |||
public Measure getMeasure(String metric) { | |||
validateInputMetric(metric); | |||
Optional<org.sonar.server.computation.measure.Measure> measure = measureRepository.getRawMeasure(internalComponent, metricRepository.getByKey(metric)); | |||
Optional<org.sonar.server.computation.task.projectanalysis.measure.Measure> measure = measureRepository.getRawMeasure(internalComponent, metricRepository.getByKey(metric)); | |||
if (measure.isPresent()) { | |||
return new MeasureImpl(measure.get()); | |||
} | |||
@@ -182,15 +182,15 @@ public class MeasureComputerContextImpl implements MeasureComputerContext { | |||
return componentIssues; | |||
} | |||
private static Component newComponent(org.sonar.server.computation.component.Component component) { | |||
private static Component newComponent(org.sonar.server.computation.task.projectanalysis.component.Component component) { | |||
return new ComponentImpl( | |||
component.getKey(), | |||
Component.Type.valueOf(component.getType().name()), | |||
component.getType() == org.sonar.server.computation.component.Component.Type.FILE | |||
component.getType() == org.sonar.server.computation.task.projectanalysis.component.Component.Type.FILE | |||
? new ComponentImpl.FileAttributesImpl(component.getFileAttributes().getLanguageKey(), component.getFileAttributes().isUnitTest()) : null); | |||
} | |||
private class ComponentToMeasure implements Function<org.sonar.server.computation.component.Component, Optional<org.sonar.server.computation.measure.Measure>> { | |||
private class ComponentToMeasure implements Function<org.sonar.server.computation.task.projectanalysis.component.Component, Optional<org.sonar.server.computation.task.projectanalysis.measure.Measure>> { | |||
private final Metric metric; | |||
@@ -199,17 +199,17 @@ public class MeasureComputerContextImpl implements MeasureComputerContext { | |||
} | |||
@Override | |||
public Optional<org.sonar.server.computation.measure.Measure> apply(@Nonnull org.sonar.server.computation.component.Component input) { | |||
public Optional<org.sonar.server.computation.task.projectanalysis.measure.Measure> apply(@Nonnull org.sonar.server.computation.task.projectanalysis.component.Component input) { | |||
return measureRepository.getRawMeasure(input, metric); | |||
} | |||
} | |||
private enum ToMeasureAPI implements Function<Optional<org.sonar.server.computation.measure.Measure>, Measure> { | |||
private enum ToMeasureAPI implements Function<Optional<org.sonar.server.computation.task.projectanalysis.measure.Measure>, Measure> { | |||
INSTANCE; | |||
@Nullable | |||
@Override | |||
public Measure apply(@Nonnull Optional<org.sonar.server.computation.measure.Measure> input) { | |||
public Measure apply(@Nonnull Optional<org.sonar.server.computation.task.projectanalysis.measure.Measure> input) { | |||
return input.isPresent() ? new MeasureImpl(input.get()) : null; | |||
} | |||
} |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.measure.api; | |||
package org.sonar.server.computation.task.projectanalysis.api.measurecomputer; | |||
import com.google.common.collect.ImmutableSet; | |||
import java.util.Set; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.measure.api; | |||
package org.sonar.server.computation.task.projectanalysis.api.measurecomputer; | |||
import javax.annotation.concurrent.Immutable; | |||
import org.sonar.api.ce.measure.MeasureComputer; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.measure.api; | |||
package org.sonar.server.computation.task.projectanalysis.api.measurecomputer; | |||
import java.util.EnumSet; | |||
import java.util.Locale; | |||
@@ -26,20 +26,20 @@ import org.sonar.api.ce.measure.Measure; | |||
import static com.google.common.base.Preconditions.checkState; | |||
import static java.util.Objects.requireNonNull; | |||
import static org.sonar.server.computation.measure.Measure.ValueType.BOOLEAN; | |||
import static org.sonar.server.computation.measure.Measure.ValueType.DOUBLE; | |||
import static org.sonar.server.computation.measure.Measure.ValueType.INT; | |||
import static org.sonar.server.computation.measure.Measure.ValueType.LONG; | |||
import static org.sonar.server.computation.measure.Measure.ValueType.STRING; | |||
import static org.sonar.server.computation.task.projectanalysis.measure.Measure.ValueType.BOOLEAN; | |||
import static org.sonar.server.computation.task.projectanalysis.measure.Measure.ValueType.DOUBLE; | |||
import static org.sonar.server.computation.task.projectanalysis.measure.Measure.ValueType.INT; | |||
import static org.sonar.server.computation.task.projectanalysis.measure.Measure.ValueType.LONG; | |||
import static org.sonar.server.computation.task.projectanalysis.measure.Measure.ValueType.STRING; | |||
@Immutable | |||
public class MeasureImpl implements Measure { | |||
private static final EnumSet<org.sonar.server.computation.measure.Measure.ValueType> ALLOWED_VALUE_TYPES = EnumSet.of(INT, LONG, DOUBLE, STRING, BOOLEAN); | |||
private static final EnumSet<org.sonar.server.computation.task.projectanalysis.measure.Measure.ValueType> ALLOWED_VALUE_TYPES = EnumSet.of(INT, LONG, DOUBLE, STRING, BOOLEAN); | |||
private final org.sonar.server.computation.measure.Measure measure; | |||
private final org.sonar.server.computation.task.projectanalysis.measure.Measure measure; | |||
public MeasureImpl(org.sonar.server.computation.measure.Measure measure) { | |||
public MeasureImpl(org.sonar.server.computation.task.projectanalysis.measure.Measure measure) { | |||
this.measure = requireNonNull(measure, "Measure couldn't be null"); | |||
checkState(ALLOWED_VALUE_TYPES.contains(measure.getValueType()), String.format("Only following types are allowed %s", ALLOWED_VALUE_TYPES)); | |||
} | |||
@@ -74,7 +74,7 @@ public class MeasureImpl implements Measure { | |||
return measure.getBooleanValue(); | |||
} | |||
private void checkValueType(org.sonar.server.computation.measure.Measure.ValueType expected) { | |||
private void checkValueType(org.sonar.server.computation.task.projectanalysis.measure.Measure.ValueType expected) { | |||
checkState(measure.getValueType() == expected, String.format( | |||
"Value can not be converted to %s because current value type is a %s", | |||
expected.toString().toLowerCase(Locale.US), |
@@ -0,0 +1,23 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.task.projectanalysis.api.measurecomputer; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.posttask; | |||
package org.sonar.server.computation.task.projectanalysis.api.posttask; | |||
import javax.annotation.concurrent.Immutable; | |||
import org.sonar.api.ce.posttask.CeTask; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.posttask; | |||
package org.sonar.server.computation.task.projectanalysis.api.posttask; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.concurrent.Immutable; |
@@ -17,14 +17,14 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.posttask; | |||
package org.sonar.server.computation.task.projectanalysis.api.posttask; | |||
import com.google.common.base.Function; | |||
import java.util.Map; | |||
import javax.annotation.Nonnull; | |||
import org.sonar.api.ce.posttask.QualityGate; | |||
import org.sonar.server.computation.qualitygate.Condition; | |||
import org.sonar.server.computation.qualitygate.ConditionStatus; | |||
import org.sonar.server.computation.task.projectanalysis.qualitygate.Condition; | |||
import org.sonar.server.computation.task.projectanalysis.qualitygate.ConditionStatus; | |||
import static com.google.common.base.Preconditions.checkState; | |||
import static java.lang.String.format; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.posttask; | |||
package org.sonar.server.computation.task.projectanalysis.api.posttask; | |||
import com.google.common.base.Optional; | |||
import java.util.Collection; | |||
@@ -30,13 +30,13 @@ import org.sonar.api.ce.posttask.CeTask; | |||
import org.sonar.api.ce.posttask.PostProjectAnalysisTask; | |||
import org.sonar.api.ce.posttask.Project; | |||
import org.sonar.api.ce.posttask.QualityGate; | |||
import org.sonar.server.computation.analysis.AnalysisMetadataHolder; | |||
import org.sonar.server.computation.qualitygate.Condition; | |||
import org.sonar.server.computation.qualitygate.ConditionStatus; | |||
import org.sonar.server.computation.qualitygate.QualityGateHolder; | |||
import org.sonar.server.computation.qualitygate.QualityGateStatus; | |||
import org.sonar.server.computation.qualitygate.QualityGateStatusHolder; | |||
import org.sonar.server.computation.step.ComputationStepExecutor; | |||
import org.sonar.server.computation.task.projectanalysis.analysis.AnalysisMetadataHolder; | |||
import org.sonar.server.computation.task.projectanalysis.qualitygate.Condition; | |||
import org.sonar.server.computation.task.projectanalysis.qualitygate.ConditionStatus; | |||
import org.sonar.server.computation.task.projectanalysis.qualitygate.QualityGateHolder; | |||
import org.sonar.server.computation.task.projectanalysis.qualitygate.QualityGateStatus; | |||
import org.sonar.server.computation.task.projectanalysis.qualitygate.QualityGateStatusHolder; | |||
import org.sonar.server.computation.task.step.ComputationStepExecutor; | |||
import static com.google.common.collect.FluentIterable.from; | |||
import static java.lang.String.format; | |||
@@ -109,9 +109,9 @@ public class PostProjectAnalysisTasksExecutor implements ComputationStepExecutor | |||
@CheckForNull | |||
private QualityGateImpl createQualityGate(QualityGateHolder qualityGateHolder) { | |||
Optional<org.sonar.server.computation.qualitygate.QualityGate> qualityGateOptional = qualityGateHolder.getQualityGate(); | |||
Optional<org.sonar.server.computation.task.projectanalysis.qualitygate.QualityGate> qualityGateOptional = qualityGateHolder.getQualityGate(); | |||
if (qualityGateOptional.isPresent()) { | |||
org.sonar.server.computation.qualitygate.QualityGate qualityGate = qualityGateOptional.get(); | |||
org.sonar.server.computation.task.projectanalysis.qualitygate.QualityGate qualityGate = qualityGateOptional.get(); | |||
return new QualityGateImpl( | |||
String.valueOf(qualityGate.getId()), |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.posttask; | |||
package org.sonar.server.computation.task.projectanalysis.api.posttask; | |||
import javax.annotation.concurrent.Immutable; | |||
import org.sonar.api.ce.posttask.Project; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.posttask; | |||
package org.sonar.server.computation.task.projectanalysis.api.posttask; | |||
import com.google.common.collect.ImmutableList; | |||
import java.util.Collection; |
@@ -0,0 +1,23 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.task.projectanalysis.api.posttask; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.batch; | |||
package org.sonar.server.computation.task.projectanalysis.batch; | |||
import java.io.File; | |||
import org.sonar.ce.queue.CeTask; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.batch; | |||
package org.sonar.server.computation.task.projectanalysis.batch; | |||
import java.io.File; | |||
import java.util.Objects; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.batch; | |||
package org.sonar.server.computation.task.projectanalysis.batch; | |||
import com.google.common.base.Optional; | |||
import javax.annotation.CheckForNull; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.batch; | |||
package org.sonar.server.computation.task.projectanalysis.batch; | |||
import com.google.common.base.Optional; | |||
import com.google.common.base.Throwables; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.batch; | |||
package org.sonar.server.computation.task.projectanalysis.batch; | |||
import java.io.File; | |||
@@ -18,7 +18,6 @@ | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.filemove; | |||
package org.sonar.server.computation.task.projectanalysis.batch; | |||
import javax.annotation.ParametersAreNonnullByDefault; | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import java.util.EnumSet; | |||
import java.util.List; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
/** | |||
* Allow to crawl a component tree from a given component |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import com.google.common.base.Function; | |||
import javax.annotation.Nonnull; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import com.google.common.annotations.VisibleForTesting; | |||
import com.google.common.collect.ImmutableList; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
public interface ComponentVisitor { | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
public interface DbIdsRepository { | |||
/** |
@@ -17,9 +17,9 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import static org.sonar.server.computation.component.ComponentFunctions.toReportRef; | |||
import static org.sonar.server.computation.task.projectanalysis.component.ComponentFunctions.toReportRef; | |||
/** | |||
* Cache of persisted component (component id and snapshot id) that can be used in the persistence steps |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import static java.util.Objects.requireNonNull; | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import java.util.ArrayDeque; | |||
import java.util.Deque; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
/** | |||
* Developers are created by the Developer Cockpit plugin |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import java.util.Collection; | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import java.util.Collection; | |||
@@ -17,14 +17,14 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
import javax.annotation.concurrent.Immutable; | |||
/** | |||
* The attributes specific to a Component of type {@link org.sonar.server.computation.component.Component.Type#FILE}. | |||
* The attributes specific to a Component of type {@link org.sonar.server.computation.task.projectanalysis.component.Component.Type#FILE}. | |||
*/ | |||
@Immutable | |||
public class FileAttributes { |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import com.google.common.base.Function; | |||
import java.util.HashMap; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
public interface MutableDbIdsRepository extends DbIdsRepository { | |||
/** |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import java.util.Collection; | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
public interface MutableTreeRootHolder extends TreeRootHolder { | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import com.google.common.base.Function; | |||
import com.google.common.base.Joiner; | |||
@@ -27,8 +27,8 @@ import javax.annotation.concurrent.Immutable; | |||
import static com.google.common.collect.FluentIterable.from; | |||
import static java.lang.String.format; | |||
import static java.util.Objects.requireNonNull; | |||
import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER; | |||
import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER; | |||
import static org.sonar.server.computation.task.projectanalysis.component.ComponentVisitor.Order.POST_ORDER; | |||
import static org.sonar.server.computation.task.projectanalysis.component.ComponentVisitor.Order.PRE_ORDER; | |||
/** | |||
* A {@link ComponentCrawler} which provide access to a representation of the path from the root to the currently visited |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import java.util.NoSuchElementException; | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import static java.util.Objects.requireNonNull; | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import static java.lang.String.format; | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import javax.annotation.concurrent.Immutable; | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import org.sonar.api.config.Settings; | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import java.util.Collection; | |||
import java.util.Map; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
public interface TreeRootHolder { | |||
/** |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import com.google.common.collect.ImmutableMap; | |||
import java.util.Map; | |||
@@ -26,7 +26,7 @@ import javax.annotation.CheckForNull; | |||
import static com.google.common.base.Preconditions.checkArgument; | |||
import static com.google.common.base.Preconditions.checkState; | |||
import static java.util.Objects.requireNonNull; | |||
import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER; | |||
import static org.sonar.server.computation.task.projectanalysis.component.ComponentVisitor.Order.POST_ORDER; | |||
/** | |||
* Holds the reference to the root of the {@link Component} tree for the current CE run. |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
/** | |||
* A {@link ComponentVisitor} which can exposes methods which ensure the type of the visited Component. |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import static java.util.Objects.requireNonNull; | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
public class TypeAwareVisitorWrapper implements VisitorWrapper { | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import java.util.HashMap; | |||
import java.util.List; |
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import static java.lang.String.format; | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
public interface VisitorWrapper extends TypeAwareVisitor { | |||
@@ -17,7 +17,7 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.component; | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import com.google.common.base.Function; | |||
import com.google.common.base.Predicate; |
@@ -0,0 +1,23 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.server.computation.task.projectanalysis.component; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -17,14 +17,15 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.container; | |||
package org.sonar.server.computation.task.projectanalysis.container; | |||
import javax.annotation.Nullable; | |||
import org.sonar.ce.queue.CeTask; | |||
import org.sonar.core.platform.ComponentContainer; | |||
import org.sonar.plugin.ce.ReportAnalysisComponentProvider; | |||
import org.sonar.server.computation.task.container.TaskContainer; | |||
public interface ContainerFactory { | |||
ComputeEngineContainer create(ComponentContainer parent, CeTask task, @Nullable ReportAnalysisComponentProvider[] componentProviders); | |||
TaskContainer create(ComponentContainer parent, CeTask task, @Nullable ReportAnalysisComponentProvider[] componentProviders); | |||
} |
@@ -17,16 +17,18 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.container; | |||
package org.sonar.server.computation.task.projectanalysis.container; | |||
import javax.annotation.Nullable; | |||
import org.sonar.ce.queue.CeTask; | |||
import org.sonar.core.platform.ComponentContainer; | |||
import org.sonar.plugin.ce.ReportAnalysisComponentProvider; | |||
import org.sonar.server.computation.task.container.TaskContainer; | |||
import org.sonar.server.computation.task.container.TaskContainerImpl; | |||
public class ContainerFactoryImpl implements ContainerFactory { | |||
@Override | |||
public ComputeEngineContainer create(ComponentContainer parent, CeTask task, @Nullable ReportAnalysisComponentProvider[] componentProviders) { | |||
return new ComputeEngineContainerImpl(parent, new ReportComputeEngineContainerPopulator(task, componentProviders)); | |||
public TaskContainer create(ComponentContainer parent, CeTask task, @Nullable ReportAnalysisComponentProvider[] componentProviders) { | |||
return new TaskContainerImpl(parent, new ProjectAnalysisTaskContainerPopulator(task, componentProviders)); | |||
} | |||
} |
@@ -0,0 +1,236 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.task.projectanalysis.container; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
import javax.annotation.Nullable; | |||
import org.sonar.ce.queue.CeTask; | |||
import org.sonar.ce.settings.SettingsLoader; | |||
import org.sonar.core.issue.tracking.Tracker; | |||
import org.sonar.core.platform.ContainerPopulator; | |||
import org.sonar.plugin.ce.ReportAnalysisComponentProvider; | |||
import org.sonar.server.computation.task.projectanalysis.analysis.AnalysisMetadataHolderImpl; | |||
import org.sonar.server.computation.task.projectanalysis.batch.BatchReportDirectoryHolderImpl; | |||
import org.sonar.server.computation.task.projectanalysis.batch.BatchReportReaderImpl; | |||
import org.sonar.server.computation.task.projectanalysis.component.DbIdsRepositoryImpl; | |||
import org.sonar.server.computation.task.projectanalysis.component.DisabledComponentsHolderImpl; | |||
import org.sonar.server.computation.task.projectanalysis.component.SettingsRepositoryImpl; | |||
import org.sonar.server.computation.task.projectanalysis.component.TreeRootHolderImpl; | |||
import org.sonar.server.computation.task.container.TaskContainer; | |||
import org.sonar.server.computation.task.projectanalysis.duplication.CrossProjectDuplicationStatusHolderImpl; | |||
import org.sonar.server.computation.task.projectanalysis.duplication.DuplicationRepositoryImpl; | |||
import org.sonar.server.computation.task.projectanalysis.duplication.IntegrateCrossProjectDuplications; | |||
import org.sonar.server.computation.task.projectanalysis.event.EventRepositoryImpl; | |||
import org.sonar.server.computation.task.projectanalysis.filemove.FileSimilarityImpl; | |||
import org.sonar.server.computation.task.projectanalysis.filemove.MutableMovedFilesRepositoryImpl; | |||
import org.sonar.server.computation.task.projectanalysis.filemove.SourceSimilarityImpl; | |||
import org.sonar.server.computation.task.projectanalysis.filesystem.ComputationTempFolderProvider; | |||
import org.sonar.server.computation.task.projectanalysis.issue.BaseIssuesLoader; | |||
import org.sonar.server.computation.task.projectanalysis.issue.CloseIssuesOnRemovedComponentsVisitor; | |||
import org.sonar.server.computation.task.projectanalysis.issue.ComponentIssuesRepositoryImpl; | |||
import org.sonar.server.computation.task.projectanalysis.issue.ComponentsWithUnprocessedIssues; | |||
import org.sonar.server.computation.task.projectanalysis.issue.DebtCalculator; | |||
import org.sonar.server.computation.task.projectanalysis.issue.DefaultAssignee; | |||
import org.sonar.server.computation.task.projectanalysis.issue.EffortAggregator; | |||
import org.sonar.server.computation.task.projectanalysis.issue.IntegrateIssuesVisitor; | |||
import org.sonar.server.computation.task.projectanalysis.issue.IssueAssigner; | |||
import org.sonar.server.computation.task.projectanalysis.issue.IssueCache; | |||
import org.sonar.server.computation.task.projectanalysis.issue.IssueCounter; | |||
import org.sonar.server.computation.task.projectanalysis.issue.IssueLifecycle; | |||
import org.sonar.server.computation.task.projectanalysis.issue.IssueVisitors; | |||
import org.sonar.server.computation.task.projectanalysis.issue.LoadComponentUuidsHavingOpenIssuesVisitor; | |||
import org.sonar.server.computation.task.projectanalysis.issue.MovedIssueVisitor; | |||
import org.sonar.server.computation.task.projectanalysis.issue.NewEffortAggregator; | |||
import org.sonar.server.computation.task.projectanalysis.issue.NewEffortCalculator; | |||
import org.sonar.server.computation.task.projectanalysis.issue.RuleRepositoryImpl; | |||
import org.sonar.server.computation.task.projectanalysis.issue.RuleTagsCopier; | |||
import org.sonar.server.computation.task.projectanalysis.issue.RuleTypeCopier; | |||
import org.sonar.server.computation.task.projectanalysis.issue.ScmAccountToUser; | |||
import org.sonar.server.computation.task.projectanalysis.issue.ScmAccountToUserLoader; | |||
import org.sonar.server.computation.task.projectanalysis.issue.TrackerBaseInputFactory; | |||
import org.sonar.server.computation.task.projectanalysis.issue.TrackerExecution; | |||
import org.sonar.server.computation.task.projectanalysis.issue.TrackerRawInputFactory; | |||
import org.sonar.server.computation.task.projectanalysis.issue.UpdateConflictResolver; | |||
import org.sonar.server.computation.task.projectanalysis.issue.commonrule.BranchCoverageRule; | |||
import org.sonar.server.computation.task.projectanalysis.issue.commonrule.CommentDensityRule; | |||
import org.sonar.server.computation.task.projectanalysis.issue.commonrule.CommonRuleEngineImpl; | |||
import org.sonar.server.computation.task.projectanalysis.issue.commonrule.DuplicatedBlockRule; | |||
import org.sonar.server.computation.task.projectanalysis.issue.commonrule.LineCoverageRule; | |||
import org.sonar.server.computation.task.projectanalysis.issue.commonrule.SkippedTestRule; | |||
import org.sonar.server.computation.task.projectanalysis.issue.commonrule.TestErrorRule; | |||
import org.sonar.server.computation.task.projectanalysis.issue.filter.IssueFilter; | |||
import org.sonar.server.computation.task.projectanalysis.language.LanguageRepositoryImpl; | |||
import org.sonar.server.computation.task.projectanalysis.measure.MeasureComputersHolderImpl; | |||
import org.sonar.server.computation.task.projectanalysis.measure.MeasureComputersVisitor; | |||
import org.sonar.server.computation.task.projectanalysis.measure.MeasureRepositoryImpl; | |||
import org.sonar.server.computation.task.projectanalysis.measure.MeasureToMeasureDto; | |||
import org.sonar.server.computation.task.projectanalysis.metric.MetricModule; | |||
import org.sonar.server.computation.task.projectanalysis.period.PeriodsHolderImpl; | |||
import org.sonar.server.computation.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor; | |||
import org.sonar.server.computation.task.projectanalysis.qualitygate.EvaluationResultTextConverterImpl; | |||
import org.sonar.server.computation.task.projectanalysis.qualitygate.QualityGateHolderImpl; | |||
import org.sonar.server.computation.task.projectanalysis.qualitygate.QualityGateServiceImpl; | |||
import org.sonar.server.computation.task.projectanalysis.qualitygate.QualityGateStatusHolderImpl; | |||
import org.sonar.server.computation.task.projectanalysis.qualitymodel.NewQualityModelMeasuresVisitor; | |||
import org.sonar.server.computation.task.projectanalysis.qualitymodel.QualityModelMeasuresVisitor; | |||
import org.sonar.server.computation.task.projectanalysis.qualitymodel.RatingSettings; | |||
import org.sonar.server.computation.task.projectanalysis.qualityprofile.ActiveRulesHolderImpl; | |||
import org.sonar.server.computation.task.projectanalysis.scm.ScmInfoRepositoryImpl; | |||
import org.sonar.server.computation.task.projectanalysis.source.LastCommitVisitor; | |||
import org.sonar.server.computation.task.projectanalysis.source.SourceHashRepositoryImpl; | |||
import org.sonar.server.computation.task.projectanalysis.source.SourceLinesRepositoryImpl; | |||
import org.sonar.server.computation.task.step.ComputationStepExecutor; | |||
import org.sonar.server.computation.task.step.ComputationSteps; | |||
import org.sonar.server.computation.task.projectanalysis.step.ReportComputationSteps; | |||
import org.sonar.server.computation.taskprocessor.MutableTaskResultHolderImpl; | |||
import org.sonar.server.view.index.ViewIndex; | |||
public final class ProjectAnalysisTaskContainerPopulator implements ContainerPopulator<TaskContainer> { | |||
private static final ReportAnalysisComponentProvider[] NO_REPORT_ANALYSIS_COMPONENT_PROVIDERS = new ReportAnalysisComponentProvider[0]; | |||
private final CeTask task; | |||
private final ReportAnalysisComponentProvider[] componentProviders; | |||
public ProjectAnalysisTaskContainerPopulator(CeTask task, @Nullable ReportAnalysisComponentProvider[] componentProviders) { | |||
this.task = task; | |||
this.componentProviders = componentProviders == null ? NO_REPORT_ANALYSIS_COMPONENT_PROVIDERS : componentProviders; | |||
} | |||
@Override | |||
public void populateContainer(TaskContainer container) { | |||
ComputationSteps steps = new ReportComputationSteps(container); | |||
container.add(SettingsLoader.class); | |||
container.add(task); | |||
container.add(steps); | |||
container.addSingletons(componentClasses()); | |||
for (ReportAnalysisComponentProvider componentProvider : componentProviders) { | |||
container.addSingletons(componentProvider.getComponents()); | |||
} | |||
container.addSingletons(steps.orderedStepClasses()); | |||
} | |||
/** | |||
* List of all objects to be injected in the picocontainer dedicated to computation stack. | |||
* Does not contain the steps declared in {@link ReportComputationSteps#orderedStepClasses()}. | |||
*/ | |||
private static List componentClasses() { | |||
return Arrays.asList( | |||
PostProjectAnalysisTasksExecutor.class, | |||
ComputationStepExecutor.class, | |||
// File System | |||
new ComputationTempFolderProvider(), | |||
MetricModule.class, | |||
// holders | |||
AnalysisMetadataHolderImpl.class, | |||
CrossProjectDuplicationStatusHolderImpl.class, | |||
BatchReportDirectoryHolderImpl.class, | |||
TreeRootHolderImpl.class, | |||
PeriodsHolderImpl.class, | |||
QualityGateHolderImpl.class, | |||
QualityGateStatusHolderImpl.class, | |||
RatingSettings.class, | |||
ActiveRulesHolderImpl.class, | |||
MeasureComputersHolderImpl.class, | |||
MutableTaskResultHolderImpl.class, | |||
BatchReportReaderImpl.class, | |||
// repositories | |||
LanguageRepositoryImpl.class, | |||
MeasureRepositoryImpl.class, | |||
EventRepositoryImpl.class, | |||
SettingsRepositoryImpl.class, | |||
DbIdsRepositoryImpl.class, | |||
DisabledComponentsHolderImpl.class, | |||
QualityGateServiceImpl.class, | |||
EvaluationResultTextConverterImpl.class, | |||
SourceLinesRepositoryImpl.class, | |||
SourceHashRepositoryImpl.class, | |||
ScmInfoRepositoryImpl.class, | |||
DuplicationRepositoryImpl.class, | |||
// issues | |||
RuleRepositoryImpl.class, | |||
ScmAccountToUserLoader.class, | |||
ScmAccountToUser.class, | |||
IssueCache.class, | |||
DefaultAssignee.class, | |||
IssueVisitors.class, | |||
IssueLifecycle.class, | |||
ComponentsWithUnprocessedIssues.class, | |||
ComponentIssuesRepositoryImpl.class, | |||
IssueFilter.class, | |||
// common rules | |||
CommonRuleEngineImpl.class, | |||
BranchCoverageRule.class, | |||
LineCoverageRule.class, | |||
CommentDensityRule.class, | |||
DuplicatedBlockRule.class, | |||
TestErrorRule.class, | |||
SkippedTestRule.class, | |||
// order is important: RuleTypeCopier must be the first one. And DebtAggregator must be before NewDebtAggregator (new debt requires | |||
// debt) | |||
RuleTypeCopier.class, | |||
RuleTagsCopier.class, | |||
DebtCalculator.class, | |||
EffortAggregator.class, | |||
NewEffortCalculator.class, | |||
NewEffortAggregator.class, | |||
IssueAssigner.class, | |||
IssueCounter.class, | |||
MovedIssueVisitor.class, | |||
// visitors : order is important, measure computers must be executed at the end in order to access to every measures / issues | |||
LoadComponentUuidsHavingOpenIssuesVisitor.class, | |||
IntegrateIssuesVisitor.class, | |||
CloseIssuesOnRemovedComponentsVisitor.class, | |||
QualityModelMeasuresVisitor.class, | |||
NewQualityModelMeasuresVisitor.class, | |||
LastCommitVisitor.class, | |||
MeasureComputersVisitor.class, | |||
UpdateConflictResolver.class, | |||
TrackerBaseInputFactory.class, | |||
TrackerRawInputFactory.class, | |||
Tracker.class, | |||
TrackerExecution.class, | |||
BaseIssuesLoader.class, | |||
// filemove | |||
SourceSimilarityImpl.class, | |||
FileSimilarityImpl.class, | |||
MutableMovedFilesRepositoryImpl.class, | |||
// duplication | |||
IntegrateCrossProjectDuplications.class, | |||
// views | |||
ViewIndex.class, | |||
MeasureToMeasureDto.class); | |||
} | |||
} |