google / protobuf-gradle-plugin

Protobuf Plugin for Gradle
Other
1.77k stars 273 forks source link

Plugin is not compatible with changes in Kotlin Gradle plugins 1.9.0 release #714

Closed Tapchicoma closed 1 year ago

Tapchicoma commented 1 year ago

In the Kotlin 1.9.0 release, kapt tasks should now be additionally configured with the same custom configuration as KotlinCompile task. Here protobuf plugin configures KotlinJvmCompile tasks with additional generated sources. Now it should also configure KaptGenerateStubs task with this additional sources. Even better approach would be to configure releated KotlinSourceSet similar to this workaround:

androidComponents.beforeVariants {
    android.sourceSets.register(it.name) {
        java.srcDir(buildDir.resolve("generated/source/proto/${it.name}/java"))
        kotlin.srcDir(buildDir.resolve("generated/source/proto/${it.name}/kotlin"))
    }
}
ejona86 commented 1 year ago

Fixed by #715