diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/binary-repo-lib.sh | 4 | ||||
-rwxr-xr-x | tools/epfl-build | 28 | ||||
-rwxr-xr-x | tools/epfl-publish | 50 | ||||
-rwxr-xr-x | tools/get-scala-revision | 29 |
4 files changed, 97 insertions, 14 deletions
diff --git a/tools/binary-repo-lib.sh b/tools/binary-repo-lib.sh index 1f4733ff3b..79a37dd7df 100755 --- a/tools/binary-repo-lib.sh +++ b/tools/binary-repo-lib.sh @@ -111,7 +111,7 @@ pushJarFiles() { local user=$2 local password=$3 # TODO - ignore target/ and build/ - local jarFiles=$(find ${basedir} -name "*.jar") + local jarFiles="$(find ${basedir}/lib -name "*.jar") $(find ${basedir}/test/files -name "*.jar")" for jar in $jarFiles; do local valid=$(isJarFileValid $jar) if [[ "$valid" != "OK" ]]; then @@ -141,7 +141,7 @@ pullJarFile() { # Argument 1 - The directory to search for *.desired.sha1 files that need to be retrieved. pullJarFiles() { local basedir=$1 - local desiredFiles=$(find ${basedir} -name "*${desired_ext}") + local desiredFiles="$(find ${basedir}/lib -name *${desired_ext}) $(find ${basedir}/test/files -name *${desired_ext})" for sha in $desiredFiles; do jar=${sha%$desired_ext} local valid=$(isJarFileValid $jar) diff --git a/tools/epfl-build b/tools/epfl-build new file mode 100755 index 0000000000..dd66307de3 --- /dev/null +++ b/tools/epfl-build @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# +# builds nightlies + +[[ $# -gt 0 ]] || { + cat <<EOM +Usage: $0 <version> [opt opt ...] + + Everything after the version is supplied to scalac and partest. + Example: $0 -Xcheckinit -Ycheck:all + +Environment variables: + extra_ant_targets Additional ant targets to run after nightly + +EOM + exit 0 +} + +# version isn't actually used at present. +scalaVersion="$1" && shift +scalaArgs="-Dscalac.args=\"$@\" -Dpartest.scalac_opts=\"$@\"" + +ant all.clean && ./pull-binary-libs.sh + +ant $scalaArgs build-opt && +ant $scalaArgs nightly && +for target in $extra_ant_targets; do ant $target ; done +# [[ -n "$BUILD_DOCSCOMP" ]] && ant docscomp diff --git a/tools/epfl-publish b/tools/epfl-publish new file mode 100755 index 0000000000..e9cd97b3d2 --- /dev/null +++ b/tools/epfl-publish @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# +# publishes nightly build if $publish_to is set in environment. +# alternate maven settings.xml file given in $maven_settings. +# + +[[ $# -eq 1 ]] || { + cat <<EOM +Usage: $0 <scala version> + +Environment variables: + publish_to rsync destination +EOM + exit 0 +} +version="$1" + +[[ -d dists/archives ]] || { + echo "Can't find build, has it completed? No directory at dists/archives" + exit 1 +} + +# should not be hardcoded +# adds -Dsettings.file= if fixed path is present +mavenSettingsOption () { + hardcoded_path="/home/linuxsoft/apps/hudson-maven-settings/settings.xml" + + # environment variable + if [[ -n $maven_settings ]]; then + echo -Dsettings.file="$maven_settings" + elif [[ -f $hardcoded_path ]]; then + echo -Dsettings.file="$hardcoded_path" + fi +} + +mavenSettings=${maven_settings:-findMavenSettings} + +if [[ -z $publish_to ]]; then + echo "Nothing to publish." +else + echo "Publishing nightly build to $publish_to" + # Archive Scala nightly distribution + rsync -az dists/archives/ "$publish_to/distributions" + # don't publish docs in 2.8.x + [[ $version == "2.8.x" ]] || rsync -az build/scaladoc/ "$publish_to/docs" + # sbaz + [[ -d dists/sbaz ]] && rsync -az dists/sbaz/ "$publish_to/sbaz" + # Deploy the maven artifacts on scala-tools.org + ( cd dists/maven/latest && ant deploy.snapshot $(mavenSettingsOption) ) +fi diff --git a/tools/get-scala-revision b/tools/get-scala-revision index e8597844cc..b27b6ddc82 100755 --- a/tools/get-scala-revision +++ b/tools/get-scala-revision @@ -1,19 +1,24 @@ -#!/bin/sh +#!/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. -[ -n "$1" ] && cd "$1" +# not like releases come out so often that we are duty-bound +# to recalculate this every time. +# git merge-base v2.8.2 v2.9.1 master +devbase="df13e31bbb" -# dev should be a tag at the merge-base of master and the -# most recent release. -if [ -z $(git tag -l dev) ]; then - # no dev tag available - this will generate dev-g<sha> - echo "dev-g$(git describe HEAD --abbrev=7 --always)" -else - # dev tag exists - this generates dev-NNNN-g<sha> - # where NNNN is the number of commits since dev. - git describe HEAD --abbrev=7 --match dev -fi +# reimplementing git describe hopefully in a way which works +# without any particular tags, branches, or recent versions of git. +# this is supposed to generate +# dev-NNNN-g<sha> +# where NNNN is the number of commits since devbase, which +# is the merge-base of the most recent release and master. +# Presently hardcoded to reduce uncertainty, v2.8.2/v2.9.1/master. +commits=$(git --no-pager log --pretty=oneline $devbase..HEAD | wc -l) +sha=$(git rev-list -n 1 HEAD) +datestr=$(date "+%Y-%m-%d") + +printf "rdev-%s-%s-g%s\n" $commits $datestr ${sha:0:7} |