From dc409d14c26a9cb6be4eecfb59e56f37207572c8 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 6 Jun 2019 16:23:22 -0400 Subject: Enhancement/whatsnew (#1434) * Use kts for settings * Update whatsnew automatically * Remove changelog length check --- build.gradle | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'build.gradle') diff --git a/build.gradle b/build.gradle index 33031d0b..7ccde02f 100644 --- a/build.gradle +++ b/build.gradle @@ -20,14 +20,28 @@ buildscript { wrapper.setDistributionType(Wrapper.DistributionType.ALL) } -apply plugin: 'ca.allanwang.kau' +apply plugin: "ca.allanwang.kau" task clean(type: Delete) { delete rootProject.buildDir } task generateChangelogMd() { - kauChangelog.generate("$project.rootDir/app/src/main/res/xml/frost_changelog.xml") + def changelog = kauChangelog.generate("${project.rootDir}/app/src/main/res/xml/frost_changelog.xml") + // If we have no changelog, something is wrong + def entry = changelog[0] + def whatsNewFile = new File("${project.rootDir}/app/src/main/play/en-US/whatsnew") + if (!whatsNewFile.exists()) { + // Throw exceptions so that moving this file will require us to update the script + throw new RuntimeException("Whatsnew file not found") + } + whatsNewFile.withWriter { writer -> + writer.write(entry.version) + writer.write("\n") + entry.items.each { + writer.write("\n* ${it}") + } + } } task fullRelease(type: GradleBuild) { -- cgit v1.2.3