I’ve written a thorough presentation of the issue here
To summarize I want to use a gradle groovy plugin i android, which extends sourceSet. However I cannot get that sourceSet extension from Android as its an AndroidSourceSet.
I tried various tricks.
I cannot get
dynamic-groovy-plugin to work at all, gradle 6.7.1 complains if I add that plugin, as mentioned in Kotlin Dsl Primer. It could be a general interesting method to fix such troublesome cases.
Also I couldn’t seem to get extensions via the
sourceSet.withGroovyBuilder , though I’m not sure that’s the intended purpose.
I couldn’t figure out how to get an SourceSet from AndroidSourceSet.