33 lines
1.2 KiB
PowerShell
33 lines
1.2 KiB
PowerShell
param([string]$ProjectDir, [string]$ProjectPath);
|
|
|
|
$FileMajMin = "..\MajMin.vers"
|
|
$FileVers = "Resources\VersNum.txt"
|
|
$FileManIn = "Resources\manifest-original.xml"
|
|
$FileManOut = "Resources\manifest.xml"
|
|
$FileCLogIn = "Resources\ChangeLog-original.html"
|
|
$FileCLogOut = "Resources\ChangeLog.html"
|
|
$MajMin = Get-Content $FileMajMin
|
|
$currentDate = get-date -format yyMM;
|
|
$currentTime = get-date -format dHH;
|
|
$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-SPEC"
|
|
$manData = $manData -replace "{{BRANCHNAME}}", "stable/LAST"
|
|
$manData = $manData -replace "{{PACKNAME}}", "MP.SPEC"
|
|
Set-Content -Path $FileManOut -Value $manData
|
|
|
|
# replace x ChangeLog
|
|
$clogData = Get-Content $FileCLogIn
|
|
$clogData = $clogData -replace "{{CURRENT-REL}}", $currRelNum
|
|
Set-Content -Path $FileCLogOut -Value $clogData
|