I’ve created some convention plugins to share with others in my team according to this guide Sharing build logic in a multi-repo setup Sample.
I want to reference the project directory of the project that is using my convention plugin from within the plugin itself. However when I use something like project.layout.buildDirectory it is referencing the build directory for the plugin and not the project using the plugin.
EDIT:
I am using the conventions from the plugin in /buildSrc conventions within a project. I just testing using the conventions from the plugin directly in a subproject gradle build file and it compiled just fine. Is using a convention from a plugin within a /buildSrc convention simply not the correct way to use conventions. I did it this way because there are some commonalities between our various projects but also some differences. Should I move all the conventions, even the more project specific ones, into the plugin.