From cf6c0262eeff81c8532328b668278e28362c4c6e Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 2 Nov 2021 09:28:38 +0100 Subject: [PATCH] update gestione num versione --- PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj | 8 ++++++-- PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj.user | 1 + PROJ-ETS/PROJ-ETS/post-build.ps1 | 14 ++++++++++++++ PROJ-ETS/Resources/VersNum.txt | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 PROJ-ETS/PROJ-ETS/post-build.ps1 create mode 100644 PROJ-ETS/Resources/VersNum.txt diff --git a/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj b/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj index 2da3458..f3b4d0d 100644 --- a/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj +++ b/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj @@ -1,4 +1,4 @@ - + @@ -24,6 +24,7 @@ 4.3 + 2.4.2111.0209 true @@ -1260,4 +1261,7 @@ --> - \ No newline at end of file + + + + diff --git a/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj.user b/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj.user index 8c5840a..9b7254b 100644 --- a/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj.user +++ b/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj.user @@ -10,6 +10,7 @@ enabled + ShowAllFiles diff --git a/PROJ-ETS/PROJ-ETS/post-build.ps1 b/PROJ-ETS/PROJ-ETS/post-build.ps1 new file mode 100644 index 0000000..233e799 --- /dev/null +++ b/PROJ-ETS/PROJ-ETS/post-build.ps1 @@ -0,0 +1,14 @@ +param([string]$ProjectDir, [string]$ProjectPath); + +$FileVers="..\Resources\VersNum.txt" +$MajMin="2.4." +$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 diff --git a/PROJ-ETS/Resources/VersNum.txt b/PROJ-ETS/Resources/VersNum.txt new file mode 100644 index 0000000..5bb280b --- /dev/null +++ b/PROJ-ETS/Resources/VersNum.txt @@ -0,0 +1 @@ +2.4.2111.0209