From bf1df41d046f54f53db7c7a68e3eaedce2872853 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 15 Sep 2021 18:49:53 +0200 Subject: [PATCH] Aggiunto script x PostBuild --- MP.Prog/MP.Prog.csproj | 3 +++ MP.Prog/post-build.ps1 | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 MP.Prog/post-build.ps1 diff --git a/MP.Prog/MP.Prog.csproj b/MP.Prog/MP.Prog.csproj index d2f8bc3c..8f20b266 100644 --- a/MP.Prog/MP.Prog.csproj +++ b/MP.Prog/MP.Prog.csproj @@ -24,4 +24,7 @@ + + + diff --git a/MP.Prog/post-build.ps1 b/MP.Prog/post-build.ps1 new file mode 100644 index 00000000..c1ef7c70 --- /dev/null +++ b/MP.Prog/post-build.ps1 @@ -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 = "(.|\n)*?"; +$currRelNum=$MajMin + $currentDate +"." + $currentTime +$replace = "" + $MajMin + $currentDate +"." + $currentTime + ""; +$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