Skip to content

Instantly share code, notes, and snippets.

@mhutch
Created October 9, 2015 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhutch/ad0b70b9c31eba973b4d to your computer and use it in GitHub Desktop.
Save mhutch/ad0b70b9c31eba973b4d to your computer and use it in GitHub Desktop.
#!/bin/sh
MONO_ASM_DIR=/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5
# need at least NuGet 3, Mono 4.1 ships 2.8.4
if [ ! -e nuget.exe ]; then
wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe || exit 1
fi
# for some reason Mono doesn't even build mono-api-html or mono-api-diff
# but ships mono-api-info
APIDIFF_PROJ=../mono/mcs/tools/corcompare/mono-api-html/mono-api-html.csproj
if [ ! -e $APIDIFF_PROJ ]; then
echo "need ../mono checked out"
exit 1
fi
xbuild ../mono/mcs/tools/corcompare/mono-api-html/mono-api-html.csproj || exit 1
APIDIFF=../mono/mcs/tools/corcompare/mono-api-html/bin/Debug/mono-api-html.exe
# don't bother with
# "Microsoft.NETCore.Portable.Compatibility": "1.0.0"
# it's just facades for PCLv4 compat
echo '{
"supports": {
"net46.app": {},
"uwp.10.0.app": {},
"dnxcore50.app": {}
},
"dependencies": {
"Microsoft.NETCore": "5.0.0",
},
"frameworks": {
"dotnet": {
"imports": "portable-net452+win81"
}
}
}' > project.json
mono nuget.exe restore project.json -PackagesDirectory packages || exit 1
# copy all the reference dlls to a single directory so
# cecil can resolve references
mkdir -p dlls
for DLL in `find ./packages | grep "ref/dotnet/[^/]*.dll"`; do
cp $DLL dlls
done
mkdir -p ref
for DLL in dlls/*; do
mono-api-info $DLL > ref/`basename $DLL .dll`.xml
done
mkdir -p info report
for DLL in dlls/*; do
DLL=$MONO_ASM_DIR/Facades/`basename $DLL`
if [ ! -e $DLL ]; then
DLL=$MONO_ASM_DIR/`basename $DLL`
fi
if [ ! -e $DLL ]; then
echo "MISSING: $DLL"
echo "<html><h1>MISSING</h1></html>" >> report/`basename $DLL .dll`.html
else
XMLNAME=`basename $DLL .dll`.xml
mono-api-info $DLL > info/$XMLNAME
mono $APIDIFF ref/$XMLNAME info/$XMLNAME report/`basename $DLL .dll`.html
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment