Change some GradleTask Code to fix cross-platform support