Skip to content

Instantly share code, notes, and snippets.

@mslinn
Last active December 17, 2015 20:09
Show Gist options
  • Save mslinn/5665958 to your computer and use it in GitHub Desktop.
Save mslinn/5665958 to your computer and use it in GitHub Desktop.
Shows the changes in compiled code from scalac between versions
#!/bin/bash
if [ $# -lt 3 ]; then
echo "Shows the changes in compiled code from scalac between versions"
echo "Usage: $BASH_SOURCE v1 v2 classname"
echo " Where v1 and v2 are legal Scala compiler versions, such as 2.8.0, 2.9.0 and 2.10"
echo " ... and classname is fully qualified, such as com/blah/MyClass"
exit -1
fi
function input {
javap -classpath target/scala-$1/classes $2 | grep public | sort
}
diff -bBsw -C 0 <(input $1 $3) <(input $2 $3) | tail -n +3
@larsrh
Copy link

larsrh commented May 29, 2013

Cool! You don't need those temp files though, there's a nice little bash trick:

diff -bBsw -C 0 <(javap -classpath target/scala-$1/classes $3|grep public|sort) <(javap -classpath target/scala-$2/classes $3|grep public|sort)

@mslinn
Copy link
Author

mslinn commented May 29, 2013

larsrh, I took your suggestion, factored out a function and also chopped the first 3 lines of output because they no longer provide useful information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment