Fixing ordering issue in gradle