Generating subprojects in a plugin for endpoints

I have a project that takes input from different endpoints, I would like to just collect those end point at the root and let them generate the projects. I.e., if the url is .wsdl generate the appropriate ant task; writes a project the standard java -> jar build.gradle; and adds that as a dependency to the main project (I am fine with at compile dependency of file(endpoints/**/.jar). if the url is *.swagger.json, it creates an open api gen task; and adds that as a dependency. I am actually fine that the main artifact is a sub project itself.

Is something like this possible?

Cool, the array of endpoints could be supplied in an extension object, if the end point returns, cache the resul, so that if it doesn’t return it doesn’t break the build. Wsdl do x, swagger.json do y. project.subProjects().add(xxxx) and project.tasks().add(). So it looks do able.