How to Checkout, checkin, label code from TFS with Gradle Script

Hi,

I am new to gradle migrating ant projects to gradle, we are using TFS as version control. How to get, Checkout, checkin, label code from TFS(Team foundation Server) with Gradle script on my Linux machine. I need to get the code from TFS into local machine and execute the application build and then checkin back the newly built ear into TFS.

Please help on this.

Regards,
Chiranjeevi