Files
2022-04-12 14:26:09 +02:00

35 lines
1.4 KiB
PowerShell

param([string]$ProjectDir, [string]$ProjectPath);
$FileVers="..\Resources\VersNum.txt"
$FileManIn="..\Resources\manifest-original.xml"
$FileManOut="..\Resources\manifest.xml"
$FileCLogIn="..\Resources\ChangeLog-original.html"
$FileCLogOut="..\Resources\ChangeLog.html"
$MajMin="1.0."
$currentDate = get-date -format yyMM;
$currentTime = get-date -format ddHH;
$find = "<Version>(.|\n)*?</Version>";
$currRelNum=$MajMin + $currentDate +"." + $currentTime
$replace = "<Version>" + $MajMin + $currentDate +"." + $currentTime + "</Version>";
$csproj = Get-Content $ProjectPath
$csprojUpdated = $csproj -replace $find, $replace
Set-Content -Path $ProjectPath -Value $csprojUpdated
Set-Content -Path $FileVers -Value $currRelNum
# replace x manifest
$manData = Get-Content $FileManIn
$manData = $manData -replace "1.0.0.0", $currRelNum
$manData = $manData -replace "{{DIRNAME}}", "MP-STATS"
$manData = $manData -replace "{{BRANCHNAME}}", "stable/0"
$manData = $manData -replace "{{PACKNAME}}", "BlaServApp.UI"
Set-Content -Path $FileManOut -Value $manData
# replace x ChangeLog
$clogData = Get-Content $FileCLogIn
$clogData = $clogData -replace "{{CURRENT-REL}}", $currRelNum
# $clogData = $clogData -replace "{{DIRNAME}}", "MP-STATS"
# $clogData = $clogData -replace "{{BRANCHNAME}}", "stable"
# $clogData = $clogData -replace "{{PACKNAME}}", "BlaServApp.UI"
Set-Content -Path $FileCLogOut -Value $clogData