Can we change the Build Order of sub-modules using gradle?

I have a multi-module project with some modules having dependent on other sub-modules.I have added this dependency in the sub-module-build.gradle like

implementation project(’:dependent-project-name’)

However during build because of standard gradle build order -my compilation fails.

Can i customize build order in Gradle?If so then i can make all dependent project get compiled first. so that my build doesnt fail.

The dependency you have declared will ensure that the project :dependent-project-name is compiled before the project declaring the dependency. Are you saying you want :dependent-project-name compiled after? If yes, then it sounds like you have your dependency declaration in the wrong project.