/** * @return the qualifier of the current object */ @Override public String getQualifier() { return isRoot() ? Qualifiers.PROJECT : Qualifiers.MODULE; }
/** * @return whether the current project is a module */ public boolean isModule() { return !isRoot(); }
public boolean shouldExecuteOnProject(final Project project) { return project.isRoot() && fileSystem.languages().contains(ObjectiveC.KEY); }
public boolean shouldExecuteOnProject(final Project project) { return project.isRoot() && fileSystem.languages().contains(ObjectiveC.KEY); }
@Override public void analyse(Project project, SensorContext context) { if (project.isRoot()) { analyze(context, new UnitTestResults()); } }
/** * {@inheritDoc} */ public boolean shouldExecuteOnProject(Project project) { if (project.isRoot() || !isLanguageSupported(project.getLanguageKey())) { return false; } boolean skipMode = MODE_SKIP.equalsIgnoreCase(getExecutionMode()); if (skipMode) { LOG.info("{} plugin won't execute as it is set to 'skip' mode.", getToolName()); return false; } return true; }
@Override public void onProjectAnalysis(ProjectAnalysisEvent event) { Project module = event.getProject(); if (event.isStart()) { decoratorsProfiler = new DecoratorsProfiler(); currentModuleProfiling = new ModuleProfiling(module, system); } else { currentModuleProfiling.stop(); modulesProfilings.put(module, currentModuleProfiling); long moduleTotalTime = currentModuleProfiling.totalTime(); println(""); println(" -------- Profiling of module " + module.getName() + ": " + TimeUtils.formatDuration(moduleTotalTime) + " --------"); println(""); Properties props = new Properties(); currentModuleProfiling.dump(props); println(""); println(" -------- End of profiling of module " + module.getName() + " --------"); println(""); String fileName = module.getKey() + "-profiler.properties"; dumpToFile(props, BatchUtils.cleanKeyForFilename(fileName)); totalProfiling.merge(currentModuleProfiling); if (module.isRoot() && !module.getModules().isEmpty()) { dumpTotalExecutionSummary(); } } }
@Override public void onProjectAnalysis(ProjectAnalysisEvent event) { Project module = event.getProject(); if (event.isStart()) { decoratorsProfiler = new DecoratorsProfiler(); currentModuleProfiling = new ModuleProfiling(module, system); } else { currentModuleProfiling.stop(); modulesProfilings.put(module, currentModuleProfiling); long moduleTotalTime = currentModuleProfiling.totalTime(); println(""); println(" -------- Profiling of module " + module.getName() + ": " + TimeUtils.formatDuration(moduleTotalTime) + " --------"); println(""); Properties props = new Properties(); currentModuleProfiling.dump(props); println(""); println(" -------- End of profiling of module " + module.getName() + " --------"); println(""); String fileName = module.getKey() + "-profiler.properties"; dumpToFile(props, BatchUtils.cleanKeyForFilename(fileName)); totalProfiling.merge(currentModuleProfiling); if (module.isRoot() && !module.getModules().isEmpty()) { dumpTotalExecutionSummary(); } } }
/** * Executed on each module */ @Override public void execute(Project module) { pi.execute(module); eventBus.fireEvent(new ProjectAnalysisEvent(module, true)); executeInitializersPhase(); if (phases.isEnabled(Phases.Phase.SENSOR)) { // Index and lock the filesystem indexFs(); // Log detected languages and their profiles after FS is indexed and languages detected profileVerifier.execute(); // Initialize issue exclusions initIssueExclusions(); sensorsExecutor.execute(sensorContext); } if (module.isRoot()) { localIssueTracking(); issuesReport(); publishReportJob(); } cleanMemory(); eventBus.fireEvent(new ProjectAnalysisEvent(module, false)); }
/** * Executed on each module */ public void execute(Project module) { pi.execute(module); eventBus.fireEvent(new ProjectAnalysisEvent(module, true)); executeInitializersPhase(); // Index and lock the filesystem indexFs(); // Log detected languages and their profiles after FS is indexed and languages detected profileVerifier.execute(); // Initialize issue exclusions initIssueExclusions(); sensorsExecutor.execute(sensorContext); if (module.isRoot()) { if (analysisMode.isIssues()) { localIssueTracking(); issuesCallback(); } else { computeDuplications(); } issuesReport(); publishReportJob(); postJobsExecutor.execute(sensorContext); } cleanMemory(); eventBus.fireEvent(new ProjectAnalysisEvent(module, false)); }
if (module.isRoot()) { jsonReport.execute();