You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2019/05/20 09:10:15 UTC

[groovy-website] branch asf-site updated: tweak changelog production

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new adf55ac  tweak changelog production
adf55ac is described below

commit adf55ac616f7c97ec9b950708301a0b1d1a0147b
Author: Paul King <pa...@asert.com.au>
AuthorDate: Mon May 20 19:10:04 2019 +1000

    tweak changelog production
---
 generator/src/main/groovy/generator/ChangelogParser.groovy | 10 ++++++++--
 site/src/site/pages/changelogs.groovy                      | 10 +++++-----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/generator/src/main/groovy/generator/ChangelogParser.groovy b/generator/src/main/groovy/generator/ChangelogParser.groovy
index 70563e7..ea9e075 100644
--- a/generator/src/main/groovy/generator/ChangelogParser.groovy
+++ b/generator/src/main/groovy/generator/ChangelogParser.groovy
@@ -35,6 +35,12 @@ class ChangelogParser {
     private static final String ITEM_MARK = '    * '
     private static final Pattern ITEM_PATTERN = ~/\[(GROOVY-[0-9]+)\] - (.+)/
     private static final String VERSION_PATTERN = /^((1\.)|[23]\.)/
+    public static final Map<String, String> UNRELEASED = [
+            '1.1.0': 'renamed to 1.5.0',
+            '1.9.0': 'renamed to 2.0.0',
+            '2.6.0': 'discontinued',
+            '3.0.0': 'upcoming new release',
+    ]
 
     static List<Changelog> fetchReleaseNotes(File cacheDirectory) {
         def slurper = new JsonSlurper()
@@ -73,12 +79,12 @@ class ChangelogParser {
         def allMajor = changelogs.groupBy {
             def v = it.groovyVersion
             v.contains('-')?v-v.substring(v.indexOf('-')):v
-        }.findAll { ver, logs -> ver in releasedVersions || ver in ['2.6.0', '3.0.0'] } // 2.6, 3.0 added to get aggregate changelog
+        }.findAll { ver, logs -> ver in releasedVersions || ver in UNRELEASED.keySet() } // add some unreleased versions to get aggregate changelog
         allMajor.collect { k,v ->
             def changelog = changelogs.find { it.groovyVersion == k }
             if (!changelog) {
                 println "Not found: $k"
-                // it's useful to have an aggregate when we haven't done a '.0' release yet, use '-unreleased' to track
+                // it's useful to have an aggregate when we haven't done a '.0' release, use '-unreleased' to track
                 changelog = new Changelog(groovyVersion: k + '-unreleased', issues:[])
                 changelogs << changelog
             }
diff --git a/site/src/site/pages/changelogs.groovy b/site/src/site/pages/changelogs.groovy
index 7efd865..caf9f52 100644
--- a/site/src/site/pages/changelogs.groovy
+++ b/site/src/site/pages/changelogs.groovy
@@ -29,14 +29,14 @@ layout 'layouts/main.groovy', true,
                                 h2("Groovy $mj")
                                 ul {
                                     minor.each { v ->
-                                        def ver = v
-                                        def unreleased = ''
-                                        if (v.endsWith('-unreleased')) {
-                                            ver = (v - '-unreleased') + ' (unreleased)'
-                                        }
+                                        def unreleased = v.endsWith('-unreleased')
+                                        def ver = unreleased ? v - '-unreleased' : v
                                         li {
                                             yieldUnescaped ( v.endsWith('-unreleased') || (!v.contains('-') && versions.any{ it.startsWith("$v-") }) ? "Aggregate c" : "C" ) + "hangelog for "
                                             a(href: "changelogs/changelog-${v}.html", "Groovy $ver")
+                                            if (unreleased) {
+                                                yieldUnescaped "&nbsp;&nbsp;[Unreleased: ${generator.ChangelogParser.UNRELEASED[ver]}]"
+                                            }
                                         }
                                     }
                                 }