Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2013-06-09 19:41:44 +0400
committernulltoken <emeric.fermas@gmail.com>2013-06-09 19:41:44 +0400
commitede53d8f7b80c14a5f9b8001f68bcd7f61d673b9 (patch)
tree37fd527ded1c36666239dc1a457eaa2e732ecbbd /UpdateLibgit2ToSha.ps1
parenta3a989aae7aea97568f34b9b2153b85a97267346 (diff)
Ensure built binaries names match with resources
Diffstat (limited to 'UpdateLibgit2ToSha.ps1')
-rw-r--r--UpdateLibgit2ToSha.ps119
1 files changed, 19 insertions, 0 deletions
diff --git a/UpdateLibgit2ToSha.ps1 b/UpdateLibgit2ToSha.ps1
index bf35ca98..84c1d9e5 100644
--- a/UpdateLibgit2ToSha.ps1
+++ b/UpdateLibgit2ToSha.ps1
@@ -91,6 +91,22 @@ function Find-Git {
Push-Location $libgit2Directory
+function Ensure-Property($expected, $propertyValue, $propertyName, $path) {
+ if ($propertyValue -eq $expected) {
+ return
+ }
+
+ throw "Error: Invalid '$propertyName' property in generated '$path' (Expected: $expected - Actual: $propertyValue)"
+}
+
+function Assert-Consistent-Naming($expected, $path) {
+ $dll = get-item $path
+
+ Ensure-Property $expected $dll.Name "Name" $dll.Fullname
+ Ensure-Property $expected $dll.VersionInfo.InternalName "VersionInfo.InternalName" $dll.Fullname
+ Ensure-Property $expected $dll.VersionInfo.OriginalFilename "VersionInfo.OriginalFilename" $dll.Fullname
+}
+
& {
trap {
Pop-Location
@@ -112,6 +128,7 @@ Push-Location $libgit2Directory
break
}
$shortsha = $sha.Substring(0,7)
+ $expected = "git2-$shortsha.dll"
Write-Output "Checking out $sha..."
Run-Command -Quiet -Fatal { & $git checkout $sha }
@@ -124,6 +141,7 @@ Push-Location $libgit2Directory
Run-Command -Quiet -Fatal { & $cmake --build . --config $configuration }
if ($test.IsPresent) { Run-Command -Quiet -Fatal { & $ctest -V . } }
cd $configuration
+ Assert-Consistent-Naming $expected "*.dll"
Run-Command -Quiet { & rm *.exp }
Run-Command -Quiet { & rm $x86Directory\* }
Run-Command -Quiet -Fatal { & copy -fo * $x86Directory }
@@ -136,6 +154,7 @@ Push-Location $libgit2Directory
Run-Command -Quiet -Fatal { & $cmake --build . --config $configuration }
if ($test.IsPresent) { Run-Command -Quiet -Fatal { & $ctest -V . } }
cd $configuration
+ Assert-Consistent-Naming $expected "*.dll"
Run-Command -Quiet { & rm *.exp }
Run-Command -Quiet { & rm $x64Directory\* }
Run-Command -Quiet -Fatal { & copy -fo * $x64Directory }