Subproject depends on sibling subproject plugin

Hello. I am working on a project, which has two subprojects: ‘SubprojectA’ and ‘SubprojectB’. ‘SubprojectA’ is a gradle plugin and ‘SubprojectB’ is an Android application, which buildscript depends on the plugin from ‘SubprojectA’. I struggle making this build to work, because the build fails before ‘SubprojectA’ is built and installed to local maven repository with error message saying Gradle could not find the plugin in any repository. What should I do ?

Do you need to publish SubprojectA separately (as a Gradle plugin)? If you don’t, you can turn SubprojectA into buildSrc and it’ll be built before any other project. Other than buildSrc, there’s not a way to use any other subproject as a build script dependency yet.

No, I don’t need to publish it. Turning it into buildSrc seems to work, thank you. Now I face another problem. I need to apply another plugin (not local) to both buildSrc and ‘SubprojectB’. I did it before in /build.gradle using subprojects {} but these settings seems not being applied on buildSrc. Can I do something about that ?

buildSrc is treated a little special, almost like a completely separate build. You have to apply the plugins separately to the buildSrc project. subprojects {} should still work for SubprojectB.

Yeah, I’ve figured it out already. Thank you for you help, my project now works as it’s supposed to.