Multiple build files for one project?

Hello , can i create multiple build.gradle for one project?

Yes. You can have multiple build files in one project. The only thing you can’t do, of course, is have multiple files named build.gradle in the same folder.

I’m in the habit myself of having multiple build files in the root folder of my projects. For experimenting with different things I haven’t committed to yet, for instance.

Each of my different build files are named something like: build.gradle.1, build.gradle.2, build.gradle.n...

Then when I want to run a build file other than the default build.gradle, I just do: gradle --build-file=build.gradle.n ...

Of course, if you don’t give Gradle the --build-file option, the default build.gradle will be used.

1 Like

Thank you so much , i’ll test it