blob: 64dc025ecd65ab83958d0445d795d895fccba330 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
#!/usr/bin/env bash
#
# Script to compare the scaladoc of the current commit with the scaladoc
# of the parent commit. No arguments.
#
oldsha=$(git log -1 --format="%H" HEAD^)
oldsha=${oldsha#g}
oldsha=${oldsha:0:10}
sha=`sh tools/get-scala-commit-sha`
echo "parent commit sha: $oldsha. current commit sha: $sha"
# create scaladoc for parent commit if not done already
if [ ! -f "build/scaladoc-output-$oldsha.txt" ]
then
echo "making scaladoc for parent commit ($oldsha)"
git checkout HEAD^
ant docs.lib -Dscaladoc.raw.output='yes' > build/scaladoc-output-$oldsha.txt
cp -r build/scaladoc/ build/scaladoc-${oldsha}
git checkout $sha
fi
# create scaladoc for current commit
echo "making scaladoc for current commit ($sha)"
ant docs.lib -Dscaladoc.raw.output='yes' > build/scaladoc-output-$sha.txt
cp -r build/scaladoc/ build/scaladoc-${sha}
echo "opendiff build/scaladoc-output-$oldsha.txt build/scaladoc-output-$sha.txt"
opendiff build/scaladoc-output-$oldsha.txt build/scaladoc-output-$sha.txt
echo "Comparing files..."
difffile=build/scaladoc-diff-${sha}-$oldsha.txt
sh tools/scaladoc-compare build/scaladoc-${sha}/ build/scaladoc-$oldsha/ &> $difffile
open $difffile &
# Adapted from tools/scaladoc-compare
echo "Comparing versions with difftool: build/scaladoc-${sha}/ build/scaladoc-$oldsha/"
NEW_PATH=build/scaladoc-${sha}/
OLD_PATH=build/scaladoc-$oldsha/
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
DIFF=`diff -q -w $NEW_FILE $OLD_FILE 2>&1`
if [ "$DIFF" != "" ]
then
opendiff $OLD_FILE $NEW_FILE > /dev/null
echo "next [y\N]? "
read -n 1 -s input
if [ "$input" == "N" ]
then exit 0
fi
fi
else
echo -e "$NEW_FILE: No corresponding file (expecting $OLD_FILE)\n\n"
fi
done
echo "Done."
|