gradle-http-plugin
gradle-http-plugin copied to clipboard
Support client selection at configuration time
I know there is a way to add dependencies to a plugin when it is applied. It would be nice to be able to only download the HttpBuilder-NG client library that is selected rather than having all three present in all use cases.
Alternately, I guess I could have three separate Gradle plugins, one for each client, but I'd rather not.
If you use this plugin and care about having an isolated client distribution, comment on this issue or give it a thumbs up.
I've used dependencies
in the past to handle this. Could we create a dependency that has a default, but uses the one defined in the build file if it exists?
See: https://github.com/Optum/giraffle/blob/dev/src/main/kotlin/com/optum/giraffle/GsqlPlugin.kt#L69-L72
and
https://github.com/Optum/giraffle/blob/dev/src/main/kotlin/com/optum/giraffle/tasks/GsqlAbstract.kt#L28-L31
This creates a dependency, if it doesn't exist. That handles the default. This allows the uses to override the default in favor of their preferred. The second section adds the dependency to the classpath.
Thoughts?