Dependency substitutions with classifiers

We have a need to run dependency substitutions between project and module, where the module/jar file has a classifier and the project jar is identified by a configuration.

The boilerplate dependency substitution does not support either of these.

It is possible to programmatically check for a project being present, and declare a module dependency with classifier if it is not - but gradle does not allow programmatically declaring a project dependency including configuration when the project is present.

Has anyone found a path through this conundrum that works? Is gradle planning on supporting this kind of thing in the near future?

thank you for any help