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

Example/documentation for generating kotlin classes with kotlin DSL #753

Open
pgalbraith opened this issue Apr 20, 2024 · 1 comment
Open

Comments

@pgalbraith
Copy link

I gleamed bits of information here and there that lead me to think it should be possible to get kotlin sources generated using a kotlin builtin, but I haven't had any luck actually accomplishing this. It would be nice to have a documented example of how to do this (kotlin DSL preferably).

@pgalbraith
Copy link
Author

pgalbraith commented Apr 22, 2024

I think I have it working now with this protobuf block in a kotlin DSL gradle script::

protobuf {
    protoc {
        artifact = "com.google.protobuf:protoc:$protobufVersion"
    }

    generateProtoTasks {
        all().forEach {
            it.builtins {
                register("kotlin")
            }
        }
    }
}

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

1 participant