record current git-diff in assets

This commit is contained in:
Eric House 2017-09-22 06:46:19 -07:00
parent 618ee89add
commit 5dc9327d31

View file

@ -256,7 +256,13 @@ task makeBuildAssets() {
def assetsDir = android.sourceSets.main.assets.srcDirs.toArray()[0] def assetsDir = android.sourceSets.main.assets.srcDirs.toArray()[0]
String path = new File(assetsDir, 'build-info.txt').getAbsolutePath() String path = new File(assetsDir, 'build-info.txt').getAbsolutePath()
File file = new File(path); File file = new File(path);
file.write("git: ${GITREV}\n"); String out = "git: ${GITREV}\n"
String diff = "git diff".execute().text.trim()
if (diff) {
out += "\n" + diff
}
file.write(out)
} }
gradle.projectsEvaluated { gradle.projectsEvaluated {