properties.put("sonar.working.directory", new File(project.getBuildDir(), "sonar"));
}
project.getPlugins().withType(JavaBasePlugin.class, new Action<JavaBasePlugin>() {
public void execute(JavaBasePlugin javaBasePlugin) {
JavaPluginConvention javaPluginConvention = new DslObject(project).getConvention().getPlugin(JavaPluginConvention.class);
properties.put("sonar.java.source", javaPluginConvention.getSourceCompatibility());
properties.put("sonar.java.target", javaPluginConvention.getTargetCompatibility());
}
});
project.getPlugins().withType(JavaPlugin.class, new Action<JavaPlugin>() {
public void execute(JavaPlugin javaPlugin) {
JavaPluginConvention javaPluginConvention = new DslObject(project).getConvention().getPlugin(JavaPluginConvention.class);
SourceSet main = javaPluginConvention.getSourceSets().getAt("main");
List<File> sourceDirectories = nonEmptyOrNull(Iterables.filter(main.getAllSource().getSrcDirs(), FILE_EXISTS));
properties.put("sonar.sources" , sourceDirectories);
SourceSet test = javaPluginConvention.getSourceSets().getAt("test");