Search in sources :

Example 1 with Builder

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

the class ConnectedDaemonTest method createAnalysisConfig.

private ConnectedAnalysisReq createAnalysisConfig(String projectName) throws IOException {
    Path projectPath = clientTools.deployProject(projectName);
    List<Path> sourceFiles = clientTools.collectAllFiles(projectPath);
    Builder builder = ConnectedAnalysisReq.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()).setModuleKey(PROJECT_KEY_JAVA).putAllProperties(Collections.singletonMap("sonar.java.binaries", new File("projects/sample-java/target/classes").getAbsolutePath())).build();
}
Also used : Path(java.nio.file.Path) ManagedChannelBuilder(io.grpc.ManagedChannelBuilder) Builder(org.sonarsource.sonarlint.daemon.proto.SonarlintDaemon.ConnectedAnalysisReq.Builder) InputFile(org.sonarsource.sonarlint.daemon.proto.SonarlintDaemon.InputFile) File(java.io.File) InputFile(org.sonarsource.sonarlint.daemon.proto.SonarlintDaemon.InputFile)

Aggregations

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