google / protobuf-gradle-plugin

Protobuf Plugin for Gradle
Other
1.76k stars 274 forks source link

Kotlin only generated classes #743

Closed newmanw closed 6 months ago

newmanw commented 8 months ago

I am trying to generate koltin classes in an Android project and running into some issues.

generateProtoTasks {
      all().each { task ->
          task.builtins {
              java {  // Cannot remove this, leads to build issues
                  option 'lite'
              }
              kotlin {
                  option 'lite'
              }
          }
      }
  }
implementation 'com.google.protobuf:protobuf-javalite:3.25.2'
implementation("com.google.protobuf:protobuf-kotlin-lite:3.25.2")

This is generating kotlin DSL classes that only support a helper for the builder pattern. If possible it would be nice to generate Kotlin only classes. Is it possible to generate kotlin only classes? Kotlin only class would also allow for kotlin extensions.

ejona86 commented 7 months ago

Looks like protobuf requires both. That's more of a protobuf and protoc thing than something about the plugin.

ejona86 commented 6 months ago

Seems like this is resolved. If not, comment, and it can be reopened.