From 28ca2a7a4b8d68ffbbdd88e245baf94a39d2b7cd Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Aug 2025 18:53:16 +0200 Subject: [PATCH] Modifica preliminare componente x gestione vers calcolata --- .../WebWindowConfigurator.csproj | 50 +++++++++++-------- WebWindowConfigurator/post-build.ps1 | 21 ++++++++ 2 files changed, 49 insertions(+), 22 deletions(-) create mode 100644 WebWindowConfigurator/post-build.ps1 diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index df7d59b..a4c0ba3 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -1,29 +1,35 @@ - + - - net8.0 - enable - enable - + + net8.0 + enable + enable + 2.7.8.0717 + Annamaria Sassi + Egalware + Componente gestione JWD per LUX + - - - + + + - - - + + + - - - - - - - - - - + + + + + + + + + + + + diff --git a/WebWindowConfigurator/post-build.ps1 b/WebWindowConfigurator/post-build.ps1 new file mode 100644 index 0000000..e833db0 --- /dev/null +++ b/WebWindowConfigurator/post-build.ps1 @@ -0,0 +1,21 @@ +param([string]$ProjectPath); + + +# Gestione calcolata numero Versione del componente: Major/Minor da gestire a mano, Rel e Build ricalcolate in compilazione + +echo "Modifica dati versione pacchetto nuget" +$fileContent = Get-Content $ProjectPath -Raw; +$pattern = '(?i)\s*(.*?)\s*' +$vers = if ($fileContent -match $pattern) { $matches[1] } else { $null } +echo "Versione corrente: $vers" +# calcolo Rel e Build... +$Release = get-date -format M; +$Build = get-date -format ddHH; +$newVers = $vers -replace '^(\d+)\.(\d+)\.(\d+)\.(\d+)$', '$1.$2.$Release.$Build' +echo "Versione calcolata: $newVers" +$findVers = "(.|\n)*?"; +$replVers = "" + $env:NUM_REL + ""; +$newContent = $fileContent -replace $findVers, $replVers; +Set-Content -Path $ProjectPath -Value $newContent; +echo "Modifica dati file progetto x nuspec completata su file $ProjectPath" +