Aggiunto script x PostBuild
This commit is contained in:
@@ -24,4 +24,7 @@
|
||||
<ProjectReference Include="..\MP.FileData\MP.FileData.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
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-PROG"
|
||||
$manData = $manData -replace "{{BRANCHNAME}}", "stable/0"
|
||||
$manData = $manData -replace "{{PACKNAME}}", "MP.Prog"
|
||||
Set-Content -Path $FileManOut -Value $manData
|
||||
|
||||
# replace x ChangeLog
|
||||
$clogData = Get-Content $FileCLogIn
|
||||
$clogData = $clogData -replace "{{CURRENT-REL}}", $currRelNum
|
||||
# $clogData = $clogData -replace "{{DIRNAME}}", "MP-PROG"
|
||||
# $clogData = $clogData -replace "{{BRANCHNAME}}", "stable"
|
||||
# $clogData = $clogData -replace "{{PACKNAME}}", "MP.Prog"
|
||||
Set-Content -Path $FileCLogOut -Value $clogData
|
||||
Reference in New Issue
Block a user