aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-19 20:09:09 -0700
committerAllan Wang <me@allanwang.ca>2017-06-19 20:09:09 -0700
commitab9971d08183795bb53a52c10e778672735e9c9f (patch)
tree5a177d5cbed1e5f938f3a65d8ece7fe76d6f4343 /build.gradle
parent34f08f591900ee00d15b748e5ecf07252fac19a5 (diff)
downloadkau-ab9971d08183795bb53a52c10e778672735e9c9f.tar.gz
kau-ab9971d08183795bb53a52c10e778672735e9c9f.tar.bz2
kau-ab9971d08183795bb53a52c10e778672735e9c9f.zip
Add changelogs
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle18
1 files changed, 18 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle
index b0476be..aa426e1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -27,3 +27,21 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}
+
+task generateChangelogMd() {
+ def parsedProjectXml = (new XmlParser()).parse("$project.rootDir/sample/src/main/res/xml/changelog.xml")
+ def sw = new StringWriter()
+ sw.append("# Changelog\n")
+ parsedProjectXml.depthFirst().each {
+ switch (it.name()) {
+ case "version":
+ sw.append("\n## ${it.@title}\n")
+ break
+ case "item":
+ if (it.@text?.trim())
+ sw.append("* ${it.@text}\n")
+ }
+ }
+ def changelogMd = new File("$project.rootDir/docs/Changelog.md")
+ changelogMd.write(sw.toString())
+} \ No newline at end of file