DagashiApp icon indicating copy to clipboard operation
DagashiApp copied to clipboard

Kotlin build warning on CI

Open STAR-ZERO opened this issue 2 years ago • 0 comments

Now, Danger can't comment about Kotlin build warning. I need to read build log and obtain warning.

The below code is obtaining a warning log line in build.gradle. The rest need to write a warning to the checkstyle format xml file.

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
    def file = new File("build/gradle.log")
    it.logging.addStandardOutputListener(new StandardOutputListener() {
        @Override
        void onOutput(CharSequence output) {
            if (output.startsWithAny("w: ")) {
                file << output
            }
        }
    })
}

STAR-ZERO avatar May 17 '22 12:05 STAR-ZERO