Is there any way to easily support multiple versions of Gradle from a Gradle plugin?
e.g., say I want to use the task configuration avoidance APIs (
register*) for all newer Gradle versions that support it, but want to support older versions without it by using the legacy API (
create*). Is there any way to either generate different plugin jars (preferably differentiated by version of Gradle requesting plugin from portal), or somehow have one jar support multiple versions of Gradle (almost like a multi-release jar)? Can plugins even specify the ranges of Gradle with which they’ll work, just as documentation, even if not as a programmatic selector?
If any mechanism like this exists, can it also work for versions of plugins for other frameworks / libraries?