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();
}
Aggregations