diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/binary-repo-lib.sh | 20 | ||||
-rwxr-xr-x | tools/scaladoc-compare | 50 |
2 files changed, 63 insertions, 7 deletions
diff --git a/tools/binary-repo-lib.sh b/tools/binary-repo-lib.sh index a22747520c..64f62a103d 100755 --- a/tools/binary-repo-lib.sh +++ b/tools/binary-repo-lib.sh @@ -75,24 +75,21 @@ pushJarFile() { local jar_dir=$(dirname $jar) local jar_name=${jar#$jar_dir/} pushd $jar_dir >/dev/null - local jar_sha1=$(shasum -p $jar_name) - local version=${jar_sha1% ?$jar_name} + local version=$(makeJarSha $jar_name) local remote_uri=${version}${jar#$basedir} echo " Pushing to ${remote_urlbase}/${remote_uri} ..." echo " $curl" curlUpload $remote_uri $jar_name $user $pw echo " Making new sha1 file ...." - echo "$jar_sha1" > "${jar_name}${desired_ext}" + echo "$version ?$jar_name" > "${jar_name}${desired_ext}" popd >/dev/null # TODO - Git remove jar and git add jar.desired.sha1 # rm $jar } -getJarSha() { +makeJarSha() { local jar=$1 - if [[ ! -f "$jar" ]]; then - echo "" - elif which sha1sum 2>/dev/null >/dev/null; then + if which sha1sum 2>/dev/null >/dev/null; then shastring=$(sha1sum "$jar") echo "$shastring" | sed 's/ .*//' elif which shasum 2>/dev/null >/dev/null; then @@ -104,6 +101,15 @@ getJarSha() { fi } +getJarSha() { + local jar=$1 + if [[ ! -f "$jar" ]]; then + echo "" + else + echo $(makeJarSha $jar) + fi +} + # Tests whether or not the .desired.sha1 hash matches a given file. # Arugment 1 - The jar file to test validity. # Returns: Empty string on failure, "OK" on success. diff --git a/tools/scaladoc-compare b/tools/scaladoc-compare new file mode 100755 index 0000000000..74fbfd1dd4 --- /dev/null +++ b/tools/scaladoc-compare @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Script to compare scaladoc raw files. For an explanation read the next echos. +# + +if [ $# -ne 2 ] +then + echo + echo "scaladoc-compare will compare the scaladoc-generated pages in two different locations and output the diff" + echo "it's main purpose is to track changes to scaladoc and prevent updates that break things." + echo + echo "This script is meant to be used with the scaladoc -raw-output option, as it compares .html.raw files " + echo "instead of markup-heavy .html files." + echo + echo "Script usage $0 <new api files path> <old api files path>" + echo " eg: $0 build/scaladoc/library build/scaladoc-prev/library | less" + echo + exit 1 +fi + +NEW_PATH=$1 +OLD_PATH=$2 + +FILES=`find $NEW_PATH -name '*.html.raw'` +if [ "$FILES" == "" ] +then + echo "No .html.raw files found in $NEW_PATH!" + exit 1 +fi + +for NEW_FILE in $FILES +do + OLD_FILE=${NEW_FILE/$NEW_PATH/$OLD_PATH} + if [ -f $OLD_FILE ] + then + #echo $NEW_FILE" => "$OLD_FILE + DIFF=`diff -q -w $NEW_FILE $OLD_FILE 2>&1` + if [ "$DIFF" != "" ] + then + # Redo the full diff + echo "$NEW_FILE:" + diff -w $NEW_FILE $OLD_FILE 2>&1 + echo -e "\n\n" + fi + else + echo -e "$NEW_FILE: No corresponding file (expecting $OLD_FILE)\n\n" + fi +done + +echo Done. |