summaryrefslogtreecommitdiffstats
path: root/tools/libcheck.ps1
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-12-15 22:17:20 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2009-12-15 22:17:20 -0800
commite12782c1a6727390b2107ff2e39d4ac6173d86fc (patch)
tree3be0ccda0a9425927263f5b6b9616ef8ba11ac08 /tools/libcheck.ps1
parent078b1f350eb40ceee7423c25b1d833dd1f242da4 (diff)
parenta545f7be2693596fa14540c359e43150a6a7cf88 (diff)
downloadDotNetOpenAuth-origin/mono.zip
DotNetOpenAuth-origin/mono.tar.gz
DotNetOpenAuth-origin/mono.tar.bz2
Merge branch 'v2.5' into monoorigin/mono
Conflicts: src/DotNetOpenId/Properties/AssemblyInfo.cs src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs
Diffstat (limited to 'tools/libcheck.ps1')
-rw-r--r--tools/libcheck.ps164
1 files changed, 64 insertions, 0 deletions
diff --git a/tools/libcheck.ps1 b/tools/libcheck.ps1
new file mode 100644
index 0000000..45a73aa
--- /dev/null
+++ b/tools/libcheck.ps1
@@ -0,0 +1,64 @@
+param(
+ $OldVersion,
+ $NewVersion,
+ $Configuration='Debug'
+)
+
+function Usage() {
+ $ScriptName = Split-Path -leaf $MyInvocation.ScriptName
+ Write-Host "$ScriptName -OldVersion <tag> -NewVersion <branch>"
+ exit
+}
+
+if ($Args -Contains "-?" -or !$OldVersion -or !$NewVersion -or ($OldVersion -eq $NewVersion)) {
+ Usage
+}
+
+function SetupVariables() {
+ $ToolsDir = Split-Path $MyInvocation.ScriptName
+ $RootDir = [io.path]::getfullpath((Join-Path $ToolsDir .. -resolve))
+ $BinDir = "$RootDir\bin"
+ $LibCheckTmpDir = Join-Path ([IO.Path]::GetTempPath()) "LibCheck"
+}
+
+function Checkout($Version) {
+ git checkout $Version
+}
+
+function Build() {
+ msbuild.exe "$RootDir\src\DotNetOpenId\DotNetOpenId.csproj" /p:Configuration=$Configuration
+}
+
+function Generate-Metadata($Version) {
+ Push-Location $LibCheckTmpDir
+ & ".\libcheck.exe" -store "DotNetOpenId.dll" $Version -full "$BinDir\$Configuration"
+ Pop-Location
+}
+
+function Compare-Metadata() {
+ Push-Location $LibCheckTmpDir
+ & ".\libcheck.exe" -compare $OldVersion $NewVersion
+ Pop-Location
+}
+
+function ShadowCopy-Libcheck() {
+ # This function copies LibCheck from the checked out version to a temp
+ # directory so that as we git checkout other versions of DotNetOpenId,
+ # we can be sure of running one consistent version of LibCheck.
+ Remove-Item -Recurse $LibCheckTmpDir
+ Copy-Item -Recurse "$ToolsDir\LibCheck" (Split-Path $LibCheckTmpDir)
+ # As a side benefit, this also puts the results of running LibCheck
+ # outside the git repo so it can't get checked in accidentally.
+}
+
+. SetupVariables
+ShadowCopy-Libcheck
+Checkout -version $OldVersion
+Build
+Generate-Metadata -version $OldVersion
+Checkout -version $NewVersion
+Build
+Generate-Metadata -version $NewVersion
+Compare-Metadata
+Pop-Location
+& "$LibCheckTmpDir\$($OldVersion)to$($NewVersion)\APIChanges$($OldVersion)to$($NewVersion).html"