android studio - Block gradle release-build if git is not committed -


i need gradle.build throw gradleexception if have files isn't commited git, when make release build.

i have been trying way:

android {     buildtypes {         release {             prebuild.dependson('verifyversioncontrol')         }     } }  task verifyversioncontrol {     def cmd = "git diff-files"     def proc = cmd.execute()     ext.status = proc.text.trim()     dolast {         if (!(ext.status == ""))             throw new gradleexception("git not clean, commit changes before running release build")     } } 

but code trigger when run application through androidstudio.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -