Should gradle automatically check work in and out of a VCS when running certain tasks? If possible, can someone elaborate on the proccess?

Should gradle automatically check work in and out of a VCS when running certain tasks? If possible, can someone elaborate on the proccess?

The answer to your question really depends on what you want to achieve with your build. Usually, you already work on a checked out version of your code which also contains your Gradle build script. Could you please describe what your goal is?

Generally, it’s possible to run VCS operations from Gradle but they are not a built-in capability.

Basically we have an already existing project using Maven which we have integrated using the maven2gradle task. I have a book here that has a diagram explaining the execution of build definitions backed by a VCS. I was wondering if gradle interacted with the VCS and the checking in and out of the project was part of the automation.

I thought your name was familiar, I happen to be reading your book!

Thanks

I hope you enjoy reading the book. I still don’t fully grasp your check in/check out use case. As a developer you check out the code from VCS locally on your dev machine. After being done with a change, you check it into VCS. Both operations usually just use the command line VCS tools or an IDE which calls off to the command line tools. For Continuous Integration checking out the code is done by the CI product. In none of these use cases, the build is involved to run the VCS operations. The only use case I can think of that makes sense to trigger VCS operations as part of the build is release automation e.g. for tagging. Am I missing something?

Thanks, I understand how to use a VCS (in our case VSS). I now realise I misunderstood the diagram, but thank you very much for the help. Also, thanks for the quick replies. I’ll be sure to pop back with any questions.