Package org.intellij.sonar.util

Examples of org.intellij.sonar.util.TemplateProcessor


    if (!localAnalysisScript.isPresent()) return Optional.absent();
    final String sourceCodeTemplate = localAnalysisScript.get().getSourceCode();
    final String serverName = enrichedSettings.settings.getServerName();
    final Optional<SonarServerConfig> serverConfiguration = SonarServers.get(serverName);

    final TemplateProcessor sourceCodeTemplateProcessor = TemplateProcessor.of(sourceCodeTemplate);
    sourceCodeTemplateProcessor
        .withProject(enrichedSettings.project)
        .withModule(enrichedSettings.module);

    String pathToSonarReportTemplate = localAnalysisScript.get().getPathToSonarReport();
    final TemplateProcessor pathToSonarReportTemplateProcessor = TemplateProcessor.of(pathToSonarReportTemplate)
        .withProject(enrichedSettings.project)
        .withModule(enrichedSettings.module);

    if (serverConfiguration.isPresent()) {
      sourceCodeTemplateProcessor.withSonarServerConfiguration(serverConfiguration.get());
      pathToSonarReportTemplateProcessor.withSonarServerConfiguration(serverConfiguration.get());
    }

    File workingDir = WorkingDirs.computeFrom(enrichedSettings);

    sourceCodeTemplateProcessor.withWorkingDir(workingDir);
    pathToSonarReportTemplateProcessor.withWorkingDir(workingDir);

    final String sourceCode = sourceCodeTemplateProcessor.process();
    final String pathToSonarReport = pathToSonarReportTemplateProcessor.process();

    return Optional.of(new RunLocalAnalysisScriptTask(
        enrichedSettings, sourceCode, pathToSonarReport, workingDir,
        psiFiles));
  }
View Full Code Here

TOP

Related Classes of org.intellij.sonar.util.TemplateProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.