Search in sources :

Example 1 with Builder

use of org.sonarsource.sonarlint.daemon.proto.SonarlintDaemon.AnalysisReq.Builder in project sonarlint-core by SonarSource.

the class StandaloneDaemonTest method createAnalysisConfig.

private AnalysisReq createAnalysisConfig(String projectName) throws IOException {
    Path projectPath = clientTools.deployProject(projectName);
    List<Path> sourceFiles = clientTools.collectAllFiles(projectPath.resolve("src"));
    Builder builder = AnalysisReq.newBuilder();
    for (Path p : sourceFiles) {
        InputFile file = InputFile.newBuilder().setCharset(StandardCharsets.UTF_8.name()).setPath(p.toAbsolutePath().toString()).setIsTest(false).build();
        builder.addFile(file);
    }
    return builder.setBaseDir(projectPath.toAbsolutePath().toString()).setWorkDir(temp.newFolder().getAbsolutePath()).putAllProperties(Collections.singletonMap("key", "value")).build();
}
Also used : Path(java.nio.file.Path) Builder(org.sonarsource.sonarlint.daemon.proto.SonarlintDaemon.AnalysisReq.Builder) ManagedChannelBuilder(io.grpc.ManagedChannelBuilder) InputFile(org.sonarsource.sonarlint.daemon.proto.SonarlintDaemon.InputFile)

Aggregations

ManagedChannelBuilder (io.grpc.ManagedChannelBuilder)1 Path (java.nio.file.Path)1 Builder (org.sonarsource.sonarlint.daemon.proto.SonarlintDaemon.AnalysisReq.Builder)1 InputFile (org.sonarsource.sonarlint.daemon.proto.SonarlintDaemon.InputFile)1