Skip to content

Commit

Permalink
Script to help check package compatibility
Browse files Browse the repository at this point in the history
Sample usage:

checkpackagecompatibility.sh Google.Cloud.Storage.V1 2.3.0

This is a short term measure until we improve the compatibility checker itself, but it'll make validating autosynth PRs simpler.
  • Loading branch information
jskeet committed Sep 13, 2019
1 parent 9418f90 commit 6f2eaeb
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions checkpackagecompatibility.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -e

if [[ -z "$1" || -z "$2" ]]
then
echo Please specify the API name and the NuGet package version
exit 1
fi

# Fetch the package from NuGet and unzip it
rm -rf tmp
mkdir tmp
cd tmp
curl -sSL https://www.nuget.org/api/v2/package/$1/$2 --output tmp.zip
unzip -q tmp.zip
cd ..

# Build the current source code
./build.sh $1

# Run the comparison tool

old_dll=tmp/lib/netstandard1.*/$1.dll
new_dll=apis/$1/$1/bin/Release/netstandard1.*/$1.dll
dotnet run -p tools/Google.Cloud.Tools.VersionCompat -- $old_dll $new_dll

0 comments on commit 6f2eaeb

Please sign in to comment.