summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/binary-repo-lib.sh2
-rwxr-xr-xtools/epfl-publish2
-rwxr-xr-xtools/make-release-notes49
-rw-r--r--tools/make-release-notes.scala129
-rwxr-xr-xtools/partest-ack71
5 files changed, 202 insertions, 51 deletions
diff --git a/tools/binary-repo-lib.sh b/tools/binary-repo-lib.sh
index 4fe6dd67a0..704bf4944d 100755
--- a/tools/binary-repo-lib.sh
+++ b/tools/binary-repo-lib.sh
@@ -208,7 +208,7 @@ pullJarFile() {
local sha1=$(cat ${jar}${desired_ext})
local jar_dir=$(dirname $jar)
local jar_name=${jar#$jar_dir/}
- local version=${sha1% ?$jar_name}
+ local version=${sha1%% *}
local remote_uri=${version}/${jar#$basedir/}
echo "Resolving [${remote_uri}]"
pullJarFileToCache $remote_uri $version
diff --git a/tools/epfl-publish b/tools/epfl-publish
index de5e17b13f..cdf18823a5 100755
--- a/tools/epfl-publish
+++ b/tools/epfl-publish
@@ -24,7 +24,7 @@ if [[ -z $publish_to ]]; then
else
echo "Publishing nightly build to $publish_to"
# Archive Scala nightly distribution
- rsync -az dists/archives/ "$publish_to/distributions"
+ rsync -az --exclude scala-latest-sources.tgz dists/archives/ "$publish_to/distributions"
# only publish scaladoc nightly for trunk
[[ $version == "master" ]] && rsync -az build/scaladoc/ "$publish_to/docs"
# sbaz
diff --git a/tools/make-release-notes b/tools/make-release-notes
deleted file mode 100755
index dcd206f7fc..0000000000
--- a/tools/make-release-notes
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env bash
-
-# This tool is used to build a *scaffold* of a release note that you can fill in details with before posting to the list.
-# It aims to provide *all* the information you need, and probably need to prune it before releasing.
-# Author: jsuereth
-
-fixMessages() {
- local tag1="$1"
- local tag2="$2"
- git log $tag1..$tag2 "--format=format: * %h - %s" --no-merges --grep "SI-"
-}
-
-allcommitMessages() {
- local tag1="$1"
- local tag2="$2"
- git log $tag1..$tag2 "--format=format: * %h - %s" --no-merges
-}
-
-authors() {
- local tag1="$1"
- local tag2="$2"
- git log $tag1..$tag2 --format=format:%an --no-merges | sort | uniq -c | sort -rh
-}
-
-
-message() {
- local tag1="$1"
- local tag2="$2"
-
- echo "A new release of Scala is available! Please point your build tools at ${tag2#v}"
- echo
- echo "Here's a list of the issues that have been fixed since ${tag1#v}: "
- fixMessages "$tag1" "$tag2"
- echo
- echo
- echo "Special thanks to all the contributions!"
- echo "------- --------------------------------"
- authors "$tag1" "$tag2"
- echo "------- --------------------------------"
- echo
- echo
- echo "Here's a complete list of changes:"
- allcommitMessages "$tag1" "$tag2"
-}
-
-
-message "$1" "$2"
-
-
diff --git a/tools/make-release-notes.scala b/tools/make-release-notes.scala
new file mode 100644
index 0000000000..3e5b60d223
--- /dev/null
+++ b/tools/make-release-notes.scala
@@ -0,0 +1,129 @@
+#!/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 => """<a href="https://issues.scala-lang.org/browse/%s">%s</a>""" format (si, si)) mkString ", "
+}
+
+
+// HTML Generation for Toni
+
+def commitShaLink(sha: String) =
+ """<a href="https://github.com/scala/scala/commit/%s">%s</a>""" format (sha,sha)
+
+def printBlankLine(): Unit = println("<p>&nbsp</p>")
+def printHeader4(msg: String): Unit = println("<h4>%s</h4>" format (msg))
+
+def printCommiterList(): Unit = {
+ printBlankLine()
+ printHeader4("Special thanks to all the contribtuors!")
+ println("""<table border="0" cellspacing="0" cellpadding="1">
+ <thead><tr><th>#</th><th align="left">Author</th></tr></thead>
+ <tbody>""")
+ for((author, count) <- authors)
+ println("""<tr><td align="right">%d &nbsp;</td><td>%s</td></tr>""" format (count, author))
+ println("""</tbody>
+</table>""")
+}
+
+def printCommitList(): Unit = {
+ printBlankLine()
+ printHeader4("Complete commit list!")
+ println("""<table border="0" cellspacing="0" cellpadding="1">
+ <thead><tr><th>sha</th><th align="left">Title</th></tr></thead>
+ <tbody>""")
+ for(commit <- commits) {
+ println("<tr>")
+ println("""<td align="right">%s&nbsp;</td><td>%s</td>""" format (commitShaLink(commit.sha), commit.header))
+ /*print("<td>")
+ (commit.body split "[\\r\\n]") foreach { line =>
+ print(line)
+ print("<br/>")
+ }
+ print("</td>")*/
+ println("""</tr>""")
+ }
+ println("""</tbody>
+</table>""")
+}
+
+def issueFixPrinter(): Unit = {
+ printBlankLine()
+ printHeader4("Here's a list of isssues that have been fixed since %s" format (tag1))
+ println("""<table border="0" cellspacing="0" cellpading="1">
+ <thead><tr><th>Issue(s)</th><th>Commit</th><th>Message</th></tr></thead>
+ <tbody>""")
+ for(commit <- fixCommits) {
+ println("""<tr><td>%s&nbsp;</td><td>%s&nbsp;</td><td>%s</td></tr>""" format(fixLinks(commit), commitShaLink(commit.sha), commit.header))
+ }
+ println("""</tbody>
+</table>""")
+ printBlankLine()
+}
+
+def printHTML(): Unit = {
+ println("""<html>
+ <head>
+ <title>%s - Release notes</title>
+ </head>
+ <body>
+ <h3>A new release of Scala is available! Please point your build tools at %s</h3>
+ <p>:: INSERT HAND GENERATED NOTES HERE ::</p>
+""" format(tag2, tag2 drop 1))
+ issueFixPrinter()
+ printCommiterList()
+ printCommitList()
+ println("""</body></html>""")
+}
+
+printHTML()
+
+
+
diff --git a/tools/partest-ack b/tools/partest-ack
new file mode 100755
index 0000000000..f62d2c1ac0
--- /dev/null
+++ b/tools/partest-ack
@@ -0,0 +1,71 @@
+#!/usr/bin/env bash
+#
+# wrapper around partest for fine-grained test selection via ack
+
+args="$@"
+
+pathMatches () {
+ ack --noenv --files-with-matches "$@" test/files
+
+ for p in $(find test/files/* -print); do
+ [[ $p =~ $1 ]] && echo "$p"
+ done
+}
+
+testIds () {
+ pathMatches "$@" | \
+ perl -pe 's#^(test/files/[^/]+/[^/.]+).*$#$1#' | \
+ sort -u
+}
+testPaths () {
+ for id in "$@"; do
+ if [[ -d $id ]]; then
+ echo $id
+ elif [[ -f ${id}.scala ]]; then
+ echo "${id}.scala"
+ else
+ echo >&2 "No test corresponds to $id"
+ fi
+ done
+}
+
+[[ $# -gt 0 ]] || {
+ cat <<EOM
+Usage: $0 <regex> [ack options]
+
+Given a regular expression (and optionally, any arguments accepted by ack)
+runs all the tests for which any associated file matches the regex. Associated
+files include .check and .flags files. Tests in directories will match if any
+file matches. A file can match the regex by its contents or by its name.
+
+You must have ack installed: http://betterthangrep.com/ack-standalone
+
+Examples:
+
+ % tools/partest-ack monad
+ Found 4 tests matching 'ack monad'
+
+ Testing individual files
+ testing: [...]/files/pos/tcpoly_boundedmonad.scala [ OK ]
+ testing: [...]/files/pos/tcpoly_ticket2096.scala [ OK ]
+ testing: [...]/files/run/tcpoly_monads.scala [ OK ]
+ testing: [...]/files/presentation/callcc-interpreter [ OK ]
+
+ % tools/partest-ack monad -i # -i == ignore case
+ Found 12 tests matching 'ack monad -i'
+
+ Testing individual files
+ [etc]
+EOM
+
+ exit 0
+}
+
+paths=$(testPaths $(testIds "$@"))
+if [[ -z $paths ]]; then
+ echo >&2 "No matching tests."
+else
+ count=$(echo $(echo "$paths" | wc -w))
+ echo "Found $count tests matching 'ack $@'"
+ test/partest $paths
+fi