Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Tapchicoma opened this issue Jul 4, 2023 · 1 comment

Comments

@Tapchicoma
Copy link
Contributor

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"))
    }
}
@Tapchicoma Tapchicoma changed the title Plugin is not compatible with changes in Kotlin 1.9.0 release Plugin is not compatible with changes in Kotlin Gradle plugins 1.9.0 release Jul 4, 2023
Tapchicoma added a commit to Tapchicoma/protobuf-gradle-plugin that referenced this issue Jul 7, 2023
Kotlin Gradle Plugin 1.9.0 release has changed how kapt tasks are configured: https://youtrack.jetbrains.com/issue/KT-54468/KAPT-Gradle-plugin-causes-eager-task-creation. Because of this change, generated proto sources are not passed to kaptGenerateStubs task leading to compilation error even in default setup.

If the Kotlin plugin version is 1.7.20 - protobuf plugin now, instead of directly configuring KotlinCompile task inputs, configures related KotlinSourceSet. This way additional sources are passed both for KotlinCompile and KaptGenerateStubs tasks.

Fixes issue google#714
ejona86 pushed a commit that referenced this issue Jul 10, 2023
Kotlin Gradle Plugin 1.9.0 release has changed how kapt tasks are configured: https://youtrack.jetbrains.com/issue/KT-54468/KAPT-Gradle-plugin-causes-eager-task-creation. Because of this change, generated proto sources are not passed to kaptGenerateStubs task leading to compilation error even in default setup.

If the Kotlin plugin version is 1.7.20 - protobuf plugin now, instead of directly configuring KotlinCompile task inputs, configures related KotlinSourceSet. This way additional sources are passed both for KotlinCompile and KaptGenerateStubs tasks.

Fixes issue #714
@ejona86
Copy link
Collaborator

ejona86 commented Jul 10, 2023

Fixed by #715

@ejona86 ejona86 closed this as completed Jul 10, 2023
YifeiZhuang pushed a commit to YifeiZhuang/protobuf-gradle-plugin that referenced this issue Jul 13, 2023
…gle#715)

Kotlin Gradle Plugin 1.9.0 release has changed how kapt tasks are configured: https://youtrack.jetbrains.com/issue/KT-54468/KAPT-Gradle-plugin-causes-eager-task-creation. Because of this change, generated proto sources are not passed to kaptGenerateStubs task leading to compilation error even in default setup.

If the Kotlin plugin version is 1.7.20 - protobuf plugin now, instead of directly configuring KotlinCompile task inputs, configures related KotlinSourceSet. This way additional sources are passed both for KotlinCompile and KaptGenerateStubs tasks.

Fixes issue google#714
YifeiZhuang added a commit that referenced this issue Jul 13, 2023
… (#721)

Kotlin Gradle Plugin 1.9.0 release has changed how kapt tasks are configured: https://youtrack.jetbrains.com/issue/KT-54468/KAPT-Gradle-plugin-causes-eager-task-creation. Because of this change, generated proto sources are not passed to kaptGenerateStubs task leading to compilation error even in default setup.

If the Kotlin plugin version is 1.7.20 - protobuf plugin now, instead of directly configuring KotlinCompile task inputs, configures related KotlinSourceSet. This way additional sources are passed both for KotlinCompile and KaptGenerateStubs tasks.

Fixes issue #714

Co-authored-by: Yahor Berdnikau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants