diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/get-scala-commit-date | 17 | ||||
-rw-r--r-- | tools/get-scala-commit-date.bat | 9 | ||||
-rwxr-xr-x | tools/get-scala-commit-sha | 18 | ||||
-rw-r--r-- | tools/get-scala-commit-sha.bat | 9 | ||||
-rwxr-xr-x | tools/get-scala-revision | 44 | ||||
-rw-r--r-- | tools/get-scala-revision.bat | 22 | ||||
-rwxr-xr-x | tools/make-release-notes | 49 | ||||
-rwxr-xr-x | tools/verify-jar-cache | 10 |
8 files changed, 107 insertions, 71 deletions
diff --git a/tools/get-scala-commit-date b/tools/get-scala-commit-date new file mode 100755 index 0000000000..b2e4e10770 --- /dev/null +++ b/tools/get-scala-commit-date @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Usage: get-scala-commit-date [dir] +# Figures out current commit date of a git clone. +# If no dir is given, current working dir is used. +# +# Example build version string: +# 20120312 +# + +[[ $# -eq 0 ]] || cd "$1" + +lastcommitdate=$(git log --format="%ci" HEAD | head -n 1 | cut -d ' ' -f 1) +lastcommithours=$(git log --format="%ci" HEAD | head -n 1 | cut -d ' ' -f 2) + +# 20120324 +echo "${lastcommitdate//-/}-${lastcommithours//:/}" diff --git a/tools/get-scala-commit-date.bat b/tools/get-scala-commit-date.bat new file mode 100644 index 0000000000..2a75073633 --- /dev/null +++ b/tools/get-scala-commit-date.bat @@ -0,0 +1,9 @@ +@echo off
+for %%X in (bash.exe) do (set FOUND=%%~$PATH:X)
+if defined FOUND (
+ bash "%~dp0\get-scala-commit-date"
+) else (
+ rem echo this script does not work with cmd.exe. please, install bash
+ echo unknown
+ exit 1
+)
\ No newline at end of file diff --git a/tools/get-scala-commit-sha b/tools/get-scala-commit-sha new file mode 100755 index 0000000000..eab90a4215 --- /dev/null +++ b/tools/get-scala-commit-sha @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# Usage: get-scala-commit-sha [dir] +# Figures out current commit sha of a git clone. +# If no dir is given, current working dir is used. +# +# Example build version string: +# 6f1c486d0ba +# + +[[ $# -eq 0 ]] || cd "$1" + +# printf %016s is not portable for 0-padding, has to be a digit. +# so we're stuck disassembling it. +hash=$(git log -1 --format="%H" HEAD) +hash=${hash#g} +hash=${hash:0:10} +echo "$hash" diff --git a/tools/get-scala-commit-sha.bat b/tools/get-scala-commit-sha.bat new file mode 100644 index 0000000000..390e2d99d0 --- /dev/null +++ b/tools/get-scala-commit-sha.bat @@ -0,0 +1,9 @@ +@echo off
+for %%X in (bash.exe) do (set FOUND=%%~$PATH:X)
+if defined FOUND (
+ bash "%~dp0\get-scala-commit-sha"
+) else (
+ rem echo this script does not work with cmd.exe. please, install bash
+ echo unknown
+ exit 1
+)
\ No newline at end of file diff --git a/tools/get-scala-revision b/tools/get-scala-revision deleted file mode 100755 index 4d97ec58ad..0000000000 --- a/tools/get-scala-revision +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -# -# Usage: get-scala-revision [dir] -# Figures out current scala revision of a git clone. -# If no dir is given, current working dir is used. -# -# Example build version string: -# v2.10.0-M1-0098-g6f1c486d0b-2012-02-01 -# - -[[ $# -eq 0 ]] || cd "$1" - -ensure_tag () { - sha=$1 - rev=$2 - - [[ -n $(git tag -l $rev) ]] || { - git tag -a -m "generated by get-scala-revision" $rev $sha - } -} - -# Ensure some baseline tags are present so if this repository's -# tags are screwed up or stale, we should still have a reference -# point for a build string. -ensure_tag 58cb15c40d v2.10.0-M1 -ensure_tag 29f3eace1e v2.9.1 -ensure_tag b0d78f6b9c v2.8.2 - -# the closest tag, obtained separately because we have to -# reconstruct the string around the padded distance. -tag=$(git describe --tags --match 'v2*' --abbrev=0) - -# printf %016s is not portable for 0-padding, has to be a digit. -# so we're stuck disassembling it. -described=$(git describe --tags --match 'v2*' --abbrev=10) -suffix="${described##${tag}-}" -counter=$(echo $suffix | cut -d - -f 1) -hash=$(echo $suffix | cut -d - -f 2) - -# remove any alphabetic characters before the version number -tag=$(echo $tag | sed "s/\([a-z_A-Z]*\)\(.*\)/\2/") - -# 2.10.0-M1-0098-g6f1c486d0b-2012-02-01 -printf "%s-%04d-%s-%s\n" "$tag" "$counter" "$hash" $(date "+%Y-%m-%d") diff --git a/tools/get-scala-revision.bat b/tools/get-scala-revision.bat deleted file mode 100644 index 48c7cbd94f..0000000000 --- a/tools/get-scala-revision.bat +++ /dev/null @@ -1,22 +0,0 @@ -@echo off -rem -rem Usage: get-scala-revison.bat [dir] -rem Figures out current scala revision of a git clone. -rem -rem If no dir is given, current working dir is used. - -@setlocal -set _DIR= -if "%*"=="" ( - for /f "delims=;" %%i in ('cd') do set "_DIR=%%i" -) else ( - set "_DIR=%~1" -) -cd %_DIR% - -if exist .git\NUL ( - git describe --abbrev=10 --always --tags -) - -:end -@endlocal diff --git a/tools/make-release-notes b/tools/make-release-notes new file mode 100755 index 0000000000..dcd206f7fc --- /dev/null +++ b/tools/make-release-notes @@ -0,0 +1,49 @@ +#!/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/verify-jar-cache b/tools/verify-jar-cache index 1e86264ecb..8a376a6987 100755 --- a/tools/verify-jar-cache +++ b/tools/verify-jar-cache @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Discovers files whose sha sum does not match the # sha embedded in their directory name from ~/.sbt/cache/scala. @@ -9,14 +9,14 @@ cd ~/.sbt/cache/scala unset failed unset removal -[[ $1 == "-f" ]] && removal=true +[[ "$1" == "-f" ]] && removal=true for file in $(find . -type f); do sha=$(echo "${file:2}" | sed 's/\/.*$//') sum=$(shasum "$file" | sed 's/ .*$//') if [[ $sum != $sha ]]; then failed=true - if [[ -n $removal ]]; then + if [[ -n "$removal" ]]; then echo "Removing corrupt file $file, shasum=$sum" rm -rf $sha else @@ -25,9 +25,9 @@ for file in $(find . -type f); do fi done -if [[ -z $failed ]]; then +if [[ -z "$failed" ]]; then echo "All cached files match their shas." -elif [[ -z $removal ]]; then +elif [[ -z "$removal" ]]; then echo "" echo "Run again with -f to remove the corrupt files." fi |