Fixed gradle build file

Fixed the poor implementation of my previous gradle file and made sure
it now works as expected