vandmo
(Mikael Vandmo)
November 15, 2023, 6:36am
1
if (isGradleVersionGreaterOrEqualTo("6.1")) {
MapProperty<String, String> mapProperty = project.getObjects().mapProperty(String.class, String.class);
mapProperty.convention(conventionProvider);
mapProperty.finalizeValueOnRead();
sonarTask.setProperties(mapProperty);
} else {
sonarTask.setProperties(conventionProvider);
}
boolean skipImplicitCompilation = Boolean.getBoolean("sonar.gradle.skipCompile");
if (skipImplicitCompilation) {
sonarTask.mustRunAfter(getJavaCompileTasks(project));
sonarTask.mustRunAfter(getAndroidCompileTasks(project));
} else {
LOGGER.warn(
"The '{}' task depends on compile tasks. This behavior is now deprecated and will be removed in version 5.x. " +
"To avoid implicit compilation, set property 'sonar.gradle.skipCompile' to 'true' " +
"and make sure your project is compiled, before analysis has started.",
sonarTask.getName()
only allows you to set it as a system property.
Would be nice if it was also possible to set it as a gradle property since you could then add it to the gradle.properties file once your build is conforming.
Colin
(Colin)
November 17, 2023, 4:01pm
2
Hey there.
I think we’re heading in the right direction with this: [SONARGRADL-134] - Jira