Merge branch '5.6.x' into 5.7.x
This commit is contained in:
commit
752e943492
|
@ -38,14 +38,22 @@ tasks.register('generateAntora') {
|
||||||
.join('\n')
|
.join('\n')
|
||||||
def outputFile = layout.buildDirectory.file('generateAntora/antora.yml').get().asFile
|
def outputFile = layout.buildDirectory.file('generateAntora/antora.yml').get().asFile
|
||||||
mkdir(outputFile.getParentFile())
|
mkdir(outputFile.getParentFile())
|
||||||
def components = project.version.split(/(?=-)/)
|
def mainVersion = project.version
|
||||||
def mainVersion = components[0];
|
def prerelease = null
|
||||||
def prerelease = components.length > 1 ? components[1] : null
|
def versionComponents = mainVersion.split(/(?=-)/)
|
||||||
|
if (versionComponents.length > 1) {
|
||||||
|
if (versionComponents[1] == '-SNAPSHOT') {
|
||||||
|
mainVersion = versionComponents[0]
|
||||||
|
prerelease = "'-SNAPSHOT'"
|
||||||
|
} else {
|
||||||
|
prerelease = 'true'
|
||||||
|
}
|
||||||
|
}
|
||||||
def antoraYmlText = file('antora.yml').text
|
def antoraYmlText = file('antora.yml').text
|
||||||
layout.buildDirectory.file('.antora.yml').get().asFile.text = antoraYmlText
|
layout.buildDirectory.file('.antora.yml').get().asFile.text = antoraYmlText
|
||||||
antoraYmlText = antoraYmlText.lines().collect { l ->
|
antoraYmlText = antoraYmlText.lines().collect { l ->
|
||||||
if (l.startsWith('version: ')) {
|
if (l.startsWith('version: ')) {
|
||||||
return prerelease == null ? "version: '${mainVersion}'" : "version: '${mainVersion}'\nprerelease: '${prerelease}'"
|
return prerelease == null ? "version: '${mainVersion}'" : "version: '${mainVersion}'\nprerelease: ${prerelease}"
|
||||||
}
|
}
|
||||||
if (l.startsWith('title: ')) return "title: ${project.parent.description}"
|
if (l.startsWith('title: ')) return "title: ${project.parent.description}"
|
||||||
return l == 'ext:' || l.getAt(0) == ' ' ? null : l
|
return l == 'ext:' || l.getAt(0) == ' ' ? null : l
|
||||||
|
|
Loading…
Reference in New Issue