In USVM we use gradle convention plugin (buildSrc) to share build logic. When we include Diktat gradle plugin into usvm.kotlin-conventions.gradle.kts, the build fails with the exception.
Expected behavior
The build succeeds.
Observed behavior
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/sergey/Programming/Work/usvm/usvm-core/build.gradle.kts' line: 1
* What went wrong:
An exception occurred applying plugin request [id: 'usvm.kotlin-conventions']
> Failed to apply plugin 'com.saveourtool.diktat'.
> Task with name 'mergeDiktatReports' not found in root project 'usvm'.
Describe the bug
In USVM we use gradle convention plugin (
buildSrc
) to share build logic. When we include Diktat gradle plugin intousvm.kotlin-conventions.gradle.kts
, the build fails with the exception.Expected behavior
The build succeeds.
Observed behavior
Steps to Reproduce
Project structure:
buildSrc/build.gradle.kts
buildSrc/src/main/kotlin/usvm.kotlin-conventions.gradle.kts
usvm-core/build.gradle.kts
Environment information
Extra
Brief investigation led to this snippet:
https://github.com/saveourtool/diktat/blob/8d61ddf58e60519830f64ee7d52f144e5da4d57d/diktat-gradle-plugin/src/main/kotlin/com/saveourtool/diktat/plugin/gradle/tasks/SarifReportMergeTask.kt#L92-L98
Looks like we won't register any task if there are no top-level
build.gradle.kts
.Adding
build.gradle.kts
only withsolves the problem.