8 $ScriptName = Split-Path -leaf
$MyInvocation.ScriptName
9 Write-Host "$ScriptName -OldVersion <tag> -NewVersion <branch>"
13 if ($Args -Contains
"-?" -or
!$OldVersion -or
!$NewVersion -or
($OldVersion -eq
$NewVersion)) {
17 function SetupVariables
() {
18 $ToolsDir = Split-Path $MyInvocation.ScriptName
19 $RootDir = [io
.path
]::getfullpath
((Join-Path $ToolsDir .. -resolve
))
20 $BinDir = "$RootDir\bin"
21 $LibCheckTmpDir = Join-Path ([IO
.Path
]::GetTempPath
()) "LibCheck"
24 function Checkout
($Version) {
29 msbuild
.exe
"$RootDir\src\DotNetOpenAuth\DotNetOpenAuth.csproj" /p
:Configuration
=$Configuration
32 function Generate-Metadata
($Version) {
33 Push-Location $LibCheckTmpDir
34 & ".\libcheck.exe" -store
"DotNetOpenAuth.dll" $Version -full
"$BinDir\$Configuration"
38 function Compare-Metadata
() {
39 Push-Location $LibCheckTmpDir
40 & ".\libcheck.exe" -compare
$OldVersion $NewVersion
44 function ShadowCopy-Libcheck
() {
45 # This function copies LibCheck from the checked out version to a temp
46 # directory so that as we git checkout other versions of DotNetOpenAuth,
47 # we can be sure of running one consistent version of LibCheck.
48 Remove-Item -Recurse
$LibCheckTmpDir
49 Copy-Item -Recurse
"$ToolsDir\LibCheck" (Split-Path $LibCheckTmpDir)
50 # As a side benefit, this also puts the results of running LibCheck
51 # outside the git repo so it can't get checked in accidentally.
56 Checkout
-version
$OldVersion
58 Generate-Metadata
-version
$OldVersion
59 Checkout
-version
$NewVersion
61 Generate-Metadata
-version
$NewVersion
64 & "$LibCheckTmpDir\$($OldVersion)to$($NewVersion)\APIChanges$($OldVersion)to$($NewVersion).html"