A small gradle plugin to implement the Test-Commit-Revert workflow.
If :test
passes successfully, all changes are staged and committed, else all changes are reverted.
Include the plugin in your build.gradle
plugins {
id "uk.co.probablyfine.gradle.test-commit-revert" version "0.3.0"
}
By default, the commit command is git commit --all --message TCR
and the revert command is git reset --hard HEAD
.
You can override these in your build.gradle
if you, say, use Mercurial as your VCS.
testCommitRevert {
commitCommand = 'hg commit -A -m TCR'
revertCommand = 'hg update --clean'
}