I am currently experimenting writing a plugin where I would like to create new issues for a gradle project where I run the scan with the gradle plugin. I tried to create the issues against the build.gradle file but this didn’t work as build.gradle is not being indexed by default. I can only make it work by adding this file explicitly to the sonar.sources property.
Additionally, when I use Kotlin for the build file, i.e. build.gradle.kts, then the file does get indexed by default.
I would like to understand why the behaviour is different between the two approaches?
Google is telling me that .kts is a ‘normal’ Kotlin file. So this is not about ignoring the build file necessarily, but about picking up ‘recognized’ source files. .kts is a recognized file extension, whereas .gradle is not.
Note: sonar-groovy is not maintained anymore, but one of the forks seems to be updated to work with 10.6 (from reading the commit name, I haven’t tested it myself).