Gradle: renaming build.gradle to moduleName.gradle

When working with multimodule projects, having many build.gradle files with the same name can be confusing. Gradle provides a way to change this behaviour by using the settings.gradle file, which you can put in your project.

An example settings.gradle file is listed below.

As you can see here, the buildFileName of the main project is now called epub-organizer.gradle instead of build.gradle. For the sub projects (ie the children), the project name is retrieved, replacing all upper case characters with the lower case equivalent, prefixed by a dash, so that epubOrganizer will become epub-organizer. Of course, this is just an example, you can use any naming convention you’d like!