diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-19 20:09:09 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-19 20:09:09 -0700 |
commit | ab9971d08183795bb53a52c10e778672735e9c9f (patch) | |
tree | 5a177d5cbed1e5f938f3a65d8ece7fe76d6f4343 /build.gradle | |
parent | 34f08f591900ee00d15b748e5ecf07252fac19a5 (diff) | |
download | kau-ab9971d08183795bb53a52c10e778672735e9c9f.tar.gz kau-ab9971d08183795bb53a52c10e778672735e9c9f.tar.bz2 kau-ab9971d08183795bb53a52c10e778672735e9c9f.zip |
Add changelogs
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 18 |
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 |