Skip to content

Commit

Permalink
docToolchain#229 changelog config moved to main and fixed /src/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmueller committed Nov 12, 2018
1 parent eb4ec8b commit 1f97c71
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
27 changes: 27 additions & 0 deletions Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,33 @@ taskInputsFiles = []

//*****************************************************************************************

//Configuration for exportChangelog

exportChangelog = [:]

changelog.with {

// Directory of which the exportChangelog task will export the changelog.
// It should be relative to the docDir directory provided in the
// gradle.properties file.
dir = 'src/docs'

// Command used to fetch the list of changes.
// It should be a single command taking a directory as a parameter.
// You cannot use multiple commands with pipe between.
// This command will be executed in the directory specified by changelogDir
// it the environment inherited from the parent process.
// This command should produce asciidoc text directly. The exportChangelog
// task does not do any post-processing
// of the output of that command.
//
// See also https://git-scm.com/docs/pretty-formats
cmd = 'git log --pretty=format:%x7c%x20%ad%x20%n%x7c%x20%an%x20%n%x7c%x20%s%x20%n --date=short'

}

//*****************************************************************************************

//tag::confluenceConfig[]
//Configureation for publishToConfluence

Expand Down
10 changes: 5 additions & 5 deletions scripts/exportChangelog.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ task exportChangeLog(
new File(targetDir).mkdirs()
}
doLast {
println "changelogConfigFile: ${changelogConfigFile}"
def config
config = new ConfigSlurper().parse(new File(docDir, changelogConfigFile).text)
logger.info("docToolchain> docDir: "+docDir)
logger.info("docToolchain> mainConfigFile: "+mainConfigFile)
def config = new ConfigSlurper().parse(new File(docDir, mainConfigFile).text)

def cmd = "${config.changelogCmd} ."
def changes = cmd.execute(null, new File(docDir, config.changelogDir)).text
def cmd = "${config.changelog.cmd} ."
def changes = cmd.execute(null, new File(docDir, config.changelog.dir)).text
def changelog = new File(targetDir, 'changelog.adoc')
logger.info "> changelog exported ${changelog.canonicalPath}"
changelog.write(changes)
Expand Down

0 comments on commit 1f97c71

Please sign in to comment.