From f65bf3aab2060c341840bf5173e31c2b3d90a537 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 28 Oct 2013 10:01:17 +0100 Subject: Remove tools/make-release-notes This has lived in scala/make-release-notes for some time. --- tools/make-release-notes.scala | 129 ----------------------------------------- 1 file changed, 129 deletions(-) delete mode 100644 tools/make-release-notes.scala (limited to 'tools/make-release-notes.scala') diff --git a/tools/make-release-notes.scala b/tools/make-release-notes.scala deleted file mode 100644 index 3e5b60d223..0000000000 --- a/tools/make-release-notes.scala +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/sh -exec scala -feature $0 $@ -!# - -import sys.process._ - -val tag1 = "v2.10.0-M4" -val tag2 = "v2.10.0-M5" - -// Git commit parsing magikz - -case class Commit(sha: String, author: String, header: String, body: String) { - override def toString = " * " + sha + " (" + author + ") " + header + " - " + body.take(5) + " ..." -} - -val gitFormat = "--format=format:*-*%h``%aN``%s``%b" - -def processGitCommits(input: String): IndexedSeq[Commit] = - ((input split "[\\r\\n]*\\*\\-\\*").view map (_ split "``") collect { - case Array(sha, author, hdr, msg) => Commit(sha, author, hdr, msg) - }).toVector - -val commits = - processGitCommits(Process(Seq("git", "log", tag1+".."+tag2,"--format=format:*-*%h``%aN``%s``%b","--no-merges")).!!) - -val authors: Seq[(String, Int)] = { - val grouped: Vector[(String,Int)] = (commits groupBy (_.author)).map { case (a,c) => a -> c.length }{collection.breakOut} - (grouped sortBy (_._2)).reverse -} - -def hasFixins(msg: String): Boolean = ( - (msg contains "SI-") /*&& ((msg.toLowerCase contains "fix") || (msg.toLowerCase contains "close"))*/ -) - -val fixCommits = - for { - commit <- commits - searchString = commit.body + commit.header - if hasFixins(searchString) - } yield commit - - -val siPattern = java.util.regex.Pattern.compile("(SI-[0-9]+)") - -def fixLinks(commit: Commit): String = { - val searchString = commit.body + commit.header - val m = siPattern matcher searchString - val issues = new collection.mutable.ArrayBuffer[String] - while(m.find()) { - issues += (m group 1) - } - issues map (si => """%s""" format (si, si)) mkString ", " -} - - -// HTML Generation for Toni - -def commitShaLink(sha: String) = - """%s""" format (sha,sha) - -def printBlankLine(): Unit = println("

 

") -def printHeader4(msg: String): Unit = println("

%s

" format (msg)) - -def printCommiterList(): Unit = { - printBlankLine() - printHeader4("Special thanks to all the contribtuors!") - println(""" - - """) - for((author, count) <- authors) - println("""""" format (count, author)) - println(""" -
#Author
%d  %s
""") -} - -def printCommitList(): Unit = { - printBlankLine() - printHeader4("Complete commit list!") - println(""" - - """) - for(commit <- commits) { - println("") - println("""""" format (commitShaLink(commit.sha), commit.header)) - /*print("")*/ - println("""""") - } - println(""" -
shaTitle
%s %s") - (commit.body split "[\\r\\n]") foreach { line => - print(line) - print("
") - } - print("
""") -} - -def issueFixPrinter(): Unit = { - printBlankLine() - printHeader4("Here's a list of isssues that have been fixed since %s" format (tag1)) - println(""" - - """) - for(commit <- fixCommits) { - println("""""" format(fixLinks(commit), commitShaLink(commit.sha), commit.header)) - } - println(""" -
Issue(s)CommitMessage
%s %s %s
""") - printBlankLine() -} - -def printHTML(): Unit = { - println(""" - - %s - Release notes - - -

A new release of Scala is available! Please point your build tools at %s

-

:: INSERT HAND GENERATED NOTES HERE ::

-""" format(tag2, tag2 drop 1)) - issueFixPrinter() - printCommiterList() - printCommitList() - println("""""") -} - -printHTML() - - - -- cgit v1.2.3