pwall567 / json-kotlin-gradle

Gradle JSON Schema code generation plugin
17 stars 7 forks source link

Added plugin ID to improve usability of this plugin. #6

Open jufickel-b opened 1 year ago

jufickel-b commented 1 year ago

With the generated plugin ID it is possible to use this plugin as follows (in build.gradle.kts):

…
plugins {
    id("net.pwall.json.json-kotlin") version "0.91"
    …
}
…
pwall567 commented 1 year ago

Hello,

I apologise for being slow to respond to issues recently; I've had a lot going on.

I'm not a Gradle expert, but my understanding is that in order to use the plugins syntax you describe, the plugin must be published to the Gradle Plugin Portal. I opened an account with that portal some time ago, with the intention of publishing my plugin to the portal, but I didn't follow up on the idea when I found that the buildscript approach worked reasonably well, even if it is a little less convenient.

Now that many more people are using the plugin, it's worth reconsidering the idea of publishing to the Gradle Plugin Portal. I'll look into it over the next few days and I'll let you know the outcome shortly.

Regards, Peter Wall

jufickel-b commented 12 months ago

Hi @pwall567,

Did you have the chance to look into the topic? It would be great if the PR could be merged soon. :-)

Thank you.

Kind regards, Jürgen Fickel

gino-m commented 7 months ago

I was unable to get this plugin working following the docs. I think having the plugin id would have helped.

pwall567 commented 7 months ago

Hi @gino-m , I'm sorry you found it difficult to use the plugin in its current form – I very often struggle with Gradle myself. But I'm not sure that uploading the plugin to the official Gradle plugin repository would would solve all of the problems people encounter when configuring Gradle to use the code generator.

The build process for the code generator is already complex – after making changes to the main repository json-kotlin-schema-codegen I have to build and upload that to Maven Central. I then update the json-kotlin-maven and json-kotlin-gradle projects, and build and upload them as well. Add the upload to the Gradle plugin site, and that would be another step to be performed for every release. I hope you can understand that I'm not keen to add to my workload.

I suspect the problems you were having might have been alleviated with better documentation, and I will endeavour to provide better and more comprehensive documentation on the configuration of the plugin in future.

Regards, Peter

gino-m commented 7 months ago

That sounds like a reasonable approach. Indeed 90% of my trouble was certainly due to my lack of understanding of Gradle, especially the Kotlin DSL. Thank you for all your hard work and for a great tool!

oxisto commented 3 weeks ago

Hi @gino-m , I'm sorry you found it difficult to use the plugin in its current form – I very often struggle with Gradle myself. But I'm not sure that uploading the plugin to the official Gradle plugin repository would would solve all of the problems people encounter when configuring Gradle to use the code generator.

The build process for the code generator is already complex – after making changes to the main repository json-kotlin-schema-codegen I have to build and upload that to Maven Central. I then update the json-kotlin-maven and json-kotlin-gradle projects, and build and upload them as well. Add the upload to the Gradle plugin site, and that would be another step to be performed for every release. I hope you can understand that I'm not keen to add to my workload.

I suspect the problems you were having might have been alleviated with better documentation, and I will endeavour to provide better and more comprehensive documentation on the configuration of the plugin in future.

Regards, Peter

Having the gradle plugin ID included would already help, there is no need to upload it to the gradle plugins portal. Your users can just adjust the plugin dependencies to include maven central and it would be found.

Having this would enable the much cleaner plugins syntax instead of the cumbersome buildscript, which I fear will probably be phased out at some point anyway. It is completely de-coupled from the gradle plugins portal.