correzione modifica numero versione

This commit is contained in:
Samuele Locatelli
2022-04-11 10:24:24 +02:00
parent 19a29668dc
commit 6d3ba6cec4
+13 -4
View File
@@ -23,11 +23,20 @@ variables:
# helper x fix version number
.version-fix: &version-fix
- |
# Esecuzione fix numero versione x pack nuget
$fileNameAss = ".\$env:APP_NAME\AssemblyInfo.cs";
$find = "^<Assembly: AssemblyVersion((.|\n)*?)>";
$riga = Select-String $fileNameAss -Pattern $find;
# recupero il valore della versione release/debug
$idxVers = $riga.ToString().IndexOf("AssemblyVersion(");
$currRelease = $riga.ToString().Substring($idxVers).Replace("AssemblyVersion(","").Replace(")>","").Replace("""","");
# calcolo nuova
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date format yyMM)+"."+(get-date format ddHH)
echo "Set vers: $env:NEW_REL"
$contenuto = Get-Content -path 'VersGen\VersGen.cs' -Raw
$newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL
$newContenuto | Set-Content -path 'VersGen\VersGen.cs'
echo "New vers: $env:NEW_REL"
# aggiorno file
$contenuto = Get-Content -path $fileNameAss -Raw
$newContenuto = $contenuto -replace $currRelease, $env:NEW_REL
$newContenuto | Set-Content -path $fileNameAss
# helper creazione hash files
.hashBuild: &hashBuild