forked from googleapis/google-cloud-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 7
/
checkcompatibility.sh
49 lines (41 loc) · 999 Bytes
/
checkcompatibility.sh
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
#!/bin/bash
set -e
if [[ -z "$1" || -z "$2" ]]
then
echo Please specify old and new branches
exit 1
fi
build_and_copy() {
declare -r BRANCH=$1
declare -r TARGET_DIR=$2
rm -rf $TARGET_DIR
mkdir -p $TARGET_DIR
git checkout $BRANCH
./build.sh --notests
for dir in apis/Google.*
do
pkg=$(basename $dir)
dll=apis/$pkg/$pkg/bin/Release/netstandard2.0/$pkg.dll
if [[ -f $dll ]]
then
cp $dll $TARGET_DIR
fi
done
}
# Build both branches and save the results
build_and_copy $1 tmp/old_dlls
build_and_copy $2 tmp/new_dlls
# Now run the compatibility checker
> tmp/compatibility.txt
for old_dll in tmp/old_dlls/*.dll
do
base_dll=$(basename $old_dll)
new_dll=tmp/new_dlls/$base_dll
if [[ -f $new_dll ]]
then
echo "Comparing $base_dll"
dotnet run --project tools/Google.Cloud.Tools.CompareVersions -- --file1=$old_dll --file2=$new_dll >> tmp/compatibility.txt
else
echo "$base_dll only exists in $OLD_DIR, not $NEW_DIR"
fi
done