gradle-http-plugin icon indicating copy to clipboard operation
gradle-http-plugin copied to clipboard

Support client selection at configuration time

Open cjstehno opened this issue 7 years ago • 1 comments

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.

cjstehno avatar Oct 14 '17 11:10 cjstehno

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?

jmeekhof avatar Dec 23 '19 13:12 jmeekhof