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
Post a Comment