Permalink
Browse files

Add configuration file for exportChangelog task

  • Loading branch information...
jakubjab committed Dec 3, 2017
1 parent cc593be commit aa1edc81fd07239404b7c1a868306ed7008e063e
Showing with 14 additions and 1 deletion.
  1. +3 −0 gradle.properties
  2. +4 −0 scripts/ChangelogConfig.groovy
  3. +7 −1 scripts/exportChangelog.gradle
View
@@ -19,3 +19,6 @@ mainConfigFile = Config.groovy
// Path to the confluence configuration file, relative to docDir.
confluenceConfigFile = scripts/ConfluenceConfig.groovy
// Path to the configuration file of exportChangelog task, relative to docDir.
changelogConfigFile = scripts/ChangelogConfig.groovy
@@ -0,0 +1,4 @@
// changelogDir is a directory of which the exportChangelog task will export the changelog using git
changelogDir = 'src/docs'
changelogCmd = 'git log --pretty=format:%x7c%x20%ad%x20%n%x7c%x20%an%x20%n%x7c%x20%s%x20%n --date=short'
@@ -3,8 +3,14 @@ task exportChangeLog(
description: 'exports the change log from a git subpath',
group: 'docToolchain'
) doLast {
println "changelogConfigFile: ${changelogConfigFile}"
def config
config = new ConfigSlurper().parse(new File(docDir, changelogConfigFile).text)
println "changelogCmd: ${config.changelogCmd}"
println "changelogDir: ${config.changelogDir}"
// https://git-scm.com/docs/pretty-formats
def changes = "git log --pretty=format:%x7c%x20%ad%x20%n%x7c%x20%an%x20%n%x7c%x20%s%x20%n --date=short ./src/docs".execute().text
def changes = "${config.changelogCmd} ${config.changelogDir}".execute().text
new File(targetDir).mkdirs()
def changelog = new File(targetDir, 'changelog.adoc')
logger.info "> changelog exported"

0 comments on commit aa1edc8

Please sign in to comment.