Make build.gradle custom build friendly