Subproject without build.gradle file

In my root project I have some common dependencies and settings configured for all subprojects. One subproject has no additional dependencies or configuration and is therefore without a build.gradle file. This causes an error in a plugin I’m using (File ‘/[filesystem path]/build.gradle’ specified for property ‘inputFile’ does not exist).

When I raised this issue with the maintainer of the plugin he questioned the validity of not having a build.gradle file for all subprojects.

So, I’m wondering, is it regarded as a bad practice to skip the build.gradle file if not needed or is it a supported (and perhaps documented) feature in Gradle?

Gradle gives you the freedom to do everything in the root project’s build.gradle if you wish.

For simple projects that’s just fine. As your modules within a multi-module build get more hairy, it’s common to separate into a build.gradle per module. But it’s definitely not enforced by gradle

Horses for courses :smile:

1 Like

Hello,

For our case, we use common dependencies definition in the root project and a build.gradle with specifics in each sub modules and it’s work fine. :slight_smile: