Revert "Revert "Gradle Build Script changes""

This reverts commit 1126e81304f512fc109b7642ec82131bfef7747b.