To make it easier to work with Greenshot directly after checkout, I removed the AssemblyInfo.cs.template files in favor of modifying the AssemblyInfo.cs directly from our build script.

This commit is contained in:
RKrom 2014-05-30 10:38:45 +02:00
commit 1f2534865b
19 changed files with 728 additions and 758 deletions

View file

@ -122,6 +122,29 @@ Function ReleaseNotes {
return $releaseNotes
}
# Set the assembly versions
Function ReplaceAssemblyVersion {
echo "Setting the assembly verions to the Git version $readableversion`n`n"
Get-ChildItem . -recurse AssemblyInfo.cs |
foreach {
$content = Get-Content $_.FullName
$newcontent = @()
foreach ($line in $content) {
# Special case, if we find "@RELEASENOTES@" we replace that line with the release notes
if ($line -match "\[assembly: AssemblyInformationalVersion.*") {
# skip, it will be added automatically
} elseif ($line -match "\[assembly: AssemblyVersion.*") {
$newcontent += "[assembly: AssemblyVersion(""$version"")]"
$newcontent += "[assembly: AssemblyInformationalVersion(""$detailversion"")]"
} else {
$newcontent += $line
}
}
# Write the new information back the file
$newcontent | Set-Content $_.FullName -encoding UTF8
}
}
# Fill the templates
Function FillTemplates {
echo "Filling templates for Git version $readableversion`n`n"
@ -303,6 +326,8 @@ Function PackageInstaller {
return
}
ReplaceAssemblyVersion
FillTemplates
$continue = Read-Host "`n`nPreperations are ready.`nIf you are generating a release you can now change the readme.txt to your desire and use 'y' afterwards to continue building.`nContinue with the build? (y/n)"