Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLLS-279 populate sonar.java.source analyzer property when possible #412

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,18 @@ public Map<String, String> configureJavaProperties(List<URI> fileInTheSameModule
// Assume all files in the same module have the same vmLocation
var commonConfig = javaConfigs.get(javaConfigs.keySet().iterator().next());
var vmLocationStr = commonConfig.getVmLocation();
var sourceLevel = commonConfig.getSourceLevel();
List<Path> jdkClassesRoots = new ArrayList<>();
if (vmLocationStr != null) {
var vmLocation = Paths.get(vmLocationStr);
jdkClassesRoots = getVmClasspathFromCacheOrCompute(vmLocation);
props.put("sonar.java.jdkHome", vmLocationStr);
}

if (sourceLevel != null) {
props.put("sonar.java.source", sourceLevel);
}

// Assume all main files have the same classpath
if (!mainFiles.isEmpty()) {
var mainConfig = javaConfigs.get(mainFiles.get(0));
Expand Down
Loading