Hello, I think I had a similar issue. I could not see Kotlin files in Jenkins when I checked Jacoco coverage (error message: "Error while reading the sourcefile!") but I managed to solve it by putting the following line to my Jenkinsfile jacoco step configuration:
sourceInclusionPattern: '**/*.*'
Now both Java and Kotlin files are showed in reports. I checked the source code for JacocoPublisher where I found that the default value for String sourceInclusionPattern is indeed set to copy only java files but you can rewrite it either in post-build actions tab in Jenkins or in your Jenkinsfile (depending on your implementation).
The above mentioned implementation will include all files from your source code (defined as sourcePattern)
Hello, I think I had a similar issue. I could not see Kotlin files in Jenkins when I checked Jacoco coverage (error message: "Error while reading the sourcefile!") but I managed to solve it by putting the following line to my Jenkinsfile jacoco step configuration:
sourceInclusionPattern: '**/*.*'
Now both Java and Kotlin files are showed in reports. I checked the source code for JacocoPublisher where I found that the default value for String sourceInclusionPattern is indeed set to copy only java files but you can rewrite it either in post-build actions tab in Jenkins or in your Jenkinsfile (depending on your implementation).
The above mentioned implementation will include all files from your source code (defined as sourcePattern)