google / google/protobuf-gradle-plugin

kspKotlin depends on generateProto

Open
#694 0 comments 4 reactions 0 assignees View on GitHub
Dominant language
Groovy
Stars
1.8k
Forks
288
PR merge metrics
No merged PRs in 30d

Description

Please see the minimal example here: https://github.com/schmist/ksp-proto-minimal and my comment here: https://github.com/google/protobuf-gradle-plugin/issues/624

The problem we face is that for some unknown (at least to me) reason, the `kspKotlin` Gradle tasks depends on the `generateProto` task as soon as the protobuf plugin is added to the module. Please run `./gradlew :workload:kspKotlin --dry-run` in the provided minimal example to reproduce.

Strangly the dependency disappears when changing the `main/java` source set reference in the affected module, e.g., add
```
sourceSets {
main {
java {
setSrcDirs(srcDirs)
}
}
}
```
to the `workload` `build.gradle.kts` file.

Is this expected behavior? Versions 0.8.x do not have this issue.

In our (more complicated) build we additionally enforce that proto buffers are generated before running `ksp` which leads to a cyclic task dependency.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.