-
Notifications
You must be signed in to change notification settings - Fork 274
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
Make plugin more "kotlin-dsl" friendly #219
Comments
More complete example of attempting to convert the protobuf.protobuf.run {
protoc(delegateClosureOf<ExecutableLocator> {
artifact = "com.google.protobuf:protoc:3.5.1-1"
})
plugins(delegateClosureOf<NamedDomainObjectContainer<ExecutableLocator>> {
this {
"grpc" {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
})
generateProtoTasks(delegateClosureOf<ProtobufConfigurator.GenerateProtoTaskCollection> {
all().forEach {
it.plugins(delegateClosureOf<NamedDomainObjectContainer<GenerateProtoTask.PluginOptions>> {
this {
"grpc"()
}
})
}
})
}
|
PRs are very welcome :) If minor non API breaking changes here makes it easier for for the kotlin DSL then I'm all for it. |
Hoping to understand the scope before I take a crack at this. |
|
If adding kotlin as a dependency isnt out of the question, alot of the work can be achieved with clever extension functions. This would allow the groovy api to remain untouched. I can give it a shot for curiosity sake if your interested |
That might not be a bad idea. My thinking was that this would be a good time to try and address some other things (like If the main concern is not breaking the build script DSL for consumers, I think that can probably be satisfied. I was hoping to take a crack at some pieces of this in the next couple weeks since the |
Ill try to open a pr a little early just for review purposes. But this is generally the approach I was thinking.
|
Can somebody help to configure protobuf plugin for generating grpc service? The solution from #219 (comment) doesn't work with gradle 4.10. It produces next error:
|
Copied some functions from #262 ProtobufConfiguratorExts.kt, took the example and now it works fine with gradle 4.10. Excuse for troubling. |
@zhangkun83 This can be closed. Its resolved via #275 |
The
kotlin-dsl
project is an alternative way to write statically typed build scripts for Gradle in Kotlin.As of right now, using this plugin requires a bit of knowledge of how the
kotlin-dsl
generates code and also how to manipulate Groovy types through Kotlin.Example:
The text was updated successfully, but these errors were encountered: