violations-gradle-plugin
violations-gradle-plugin copied to clipboard
[Question] How to setup gradle build for use KOTLINGRADLE.
Sorry for the questions on this topic, but I believe the answer helps for documentation for this project.
as far as I understand this plugin reads only report files.
If I build an Android project with Kotlin via
./gradlew build
I have some output from the Kotlin compiler
(25, 17): Variable 'some' is never used
but I can't find any output with this text
Have any idea, how Kotlin Gradle output to integrate with the plugin?
I'm not using that feature, so I don't know.
So, I found a solution for my CI. (gitlab)
mkdir -p build/gradle_output
./gradlew lintRelease -w > build/gradle_output/lint_release.txt
./gradlew violationCommentsToGitLab
and in root build.gradle:
task violationCommentsToGitLab(type: ViolationCommentsToGitLabTask) {
// ....
violations = [
["ANDROIDLINT", "${rootDir}".toString(), ".*/reports/.*\\.xml\$", "Android lint"],
["KOTLINGRADLE", "${rootDir}".toString(), ".*/gradle_output/.*\\.txt\$", "Kotlinc"],
]
}
It will show errors from Kotlin compiler and Android lint