Modifica preliminare componente x gestione vers calcolata

This commit is contained in:
Samuele Locatelli
2025-08-07 18:53:16 +02:00
parent 9bab85dcd3
commit 28ca2a7a4b
2 changed files with 49 additions and 22 deletions
@@ -1,29 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.7.8.0717</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione JWD per LUX</Description>
</PropertyGroup>
<ItemGroup>
<Content Remove="compilerconfig.json" />
</ItemGroup>
<ItemGroup>
<Content Remove="compilerconfig.json" />
</ItemGroup>
<ItemGroup>
<None Include="compilerconfig.json" />
</ItemGroup>
<ItemGroup>
<None Include="compilerconfig.json" />
</ItemGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2507.1815" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2507.1815" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.17" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2507.1815" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2507.1815" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.17" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectPath $(ProjectPath)" />
</Target>
</Project>
+21
View File
@@ -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)<Version>\s*(.*?)\s*</Version>'
$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 = "<Version>(.|\n)*?</Version>";
$replVers = "<Version>" + $env:NUM_REL + "</Version>";
$newContent = $fileContent -replace $findVers, $replVers;
Set-Content -Path $ProjectPath -Value $newContent;
echo "Modifica dati file progetto x nuspec completata su file $ProjectPath"