in generator/src/main/groovy/generator/ChangelogParser.groovy [100:132]
private static List<Issue> changelogHTML(String id, File cacheDir) {
def cache = new File(cacheDir, "changelog-${id}.html")
def log
if (cache.exists()) {
log = cache.getText('UTF-8')
} else {
log = new URL("$JIRA_SERVER/secure/ReleaseNote.jspa?version=$id&styleName=Text&projectId=$PROJECT_ID").getText('UTF-8')
cache.write(log, 'UTF-8')
}
boolean inNotes = false
String type = null
List<Issue> issues = []
log.eachLine { line ->
if (line.startsWith(LOGNOTES_INTRO)) {
inNotes = true
} else if (line.startsWith(LOGNOTES_END)) {
inNotes = false
} else if (inNotes) {
if (line.startsWith(BUGTYPE_MARK)) {
type = line - BUGTYPE_MARK
} else if (line.startsWith(ITEM_MARK)) {
def m = ITEM_PATTERN.matcher(line)
m.find()
issues << new Issue(id: m.group(1), description: m.group(2), type: type)
}
}
}
def json = new JsonSlurper().parse("$JIRA_SERVER/rest/api/2/search?jql=labels%20in%20(breaking)%20and%20fixVersion%20in%20($id)%20and%20project=GROOVY".toURL())
def keys = json.issues*.key
issues.findAll{ it.id in keys }.each{ it.description += ' *' }
issues
}