| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. -e |
| 2 | |
| 3 | first=$1 |
| 4 | second=$2 |
| 5 | |
| 6 | if [scip-shell system . . `[`. -z "$first" ]; then |
| 7 | echoscip-shell system . . echo. "Usage: compare <branch name A> [<branch name B>]" |
| 8 | echoscip-shell system . . echo. "" |
| 9 | echoscip-shell system . . echo. "The second argument defaults to the current branch if not specified" |
| 10 | exit 1 |
| 11 | fi |
| 12 | |
| 13 | # Remember the branch we're on |
| 14 | currentbranch=`gitscip-shell system . . git. symbolic-ref --short HEAD` |
| 15 | |
| 16 | if [scip-shell system . . `[`. -z "$second" ]; then |
| 17 | second=$currentbranch |
| 18 | fi |
| 19 | |
| 20 | firstdir=comparison/first |
| 21 | seconddir=comparison/second |
| 22 | |
| 23 | # Make sure the output directory exists |
| 24 | mkdirscip-shell system . . mkdir. -p comparison |
| 25 | |
| 26 | # Remove any previous builds |
| 27 | rmscip-shell system . . rm. -fr $firstdir |
| 28 | rmscip-shell system . . rm. -fr $seconddir |
| 29 | |
| 30 | export BREATHE_COMPARE=True |
| 31 | |
| 32 | # Checkout the first target |
| 33 | echoscip-shell system . . echo. git checkout $first |
| 34 | gitscip-shell system . . git. checkout $first |
| 35 | # Run doxygen for this state |
| 36 | (cd ../examples/specific; makescip-shell system . . make.) |
| 37 | (cd ../examples/tinyxml; makescip-shell system . . make.) |
| 38 | (cd ../examples/doxygen; makescip-shell system . . make.) |
| 39 | # Clean current sphinx build directory |
| 40 | makescip-shell system . . make. clean |
| 41 | # Make sure the BUILDDIR variable can be overridden in the Makefile. Required for older commits |
| 42 | sedscip-shell system . . sed. -i 's/BUILDDIR = build/BUILDDIR ?= build/g' Makefile |
| 43 | # Build into our first comparison directory |
| 44 | makescip-shell system . . make. html BUILDDIR=$firstdir |
| 45 | # Reset the Makefile to its state for this commit |
| 46 | gitscip-shell system . . git. checkout Makefile |
| 47 | |
| 48 | |
| 49 | # Checkout the second target and repeat |
| 50 | echoscip-shell system . . echo. git checkout $second |
| 51 | gitscip-shell system . . git. checkout $second |
| 52 | (cd ../examples/specific; makescip-shell system . . make.) |
| 53 | (cd ../examples/tinyxml; makescip-shell system . . make.) |
| 54 | (cd ../examples/doxygen; makescip-shell system . . make.) |
| 55 | makescip-shell system . . make. clean |
| 56 | sedscip-shell system . . sed. -i 's/BUILDDIR = build/BUILDDIR ?= build/g' Makefile |
| 57 | makescip-shell system . . make. html BUILDDIR=$seconddir |
| 58 | gitscip-shell system . . git. checkout Makefile |
| 59 | |
| 60 | # Return to our current branch |
| 61 | echoscip-shell system . . echo. git checkout $currentbranch |
| 62 | gitscip-shell system . . git. checkout $currentbranch |
| 63 | |
| 64 | # Launch meld to compare the two html directories |
| 65 | echoscip-shell system . . echo. meld $firstdir/html $seconddir/html |
| 66 | meld $firstdir/html $seconddir/html |
| 67 |