- aggiunta x test pre-build event
This commit is contained in:
Samuele Locatelli
2024-09-26 10:58:40 +02:00
parent 6af8564ef3
commit 577c2dd4ae
3 changed files with 32 additions and 1 deletions
@@ -41,4 +41,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PreBuild" AfterTargets="PreBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\pre-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
</Target>
</Project>
@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2024-09-24T14:54:23.4735539Z||;True|2024-09-24T16:39:32.2152525+02:00||;True|2024-09-24T15:16:02.4976236+02:00||;True|2024-09-24T15:06:15.3728331+02:00||;</History>
<History>True|2024-09-26T06:47:21.6588993Z||;True|2024-09-24T16:54:23.4735539+02:00||;True|2024-09-24T16:39:32.2152525+02:00||;True|2024-09-24T15:16:02.4976236+02:00||;True|2024-09-24T15:06:15.3728331+02:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
+28
View File
@@ -0,0 +1,28 @@
param([string]$ProjectDir, [string]$ProjectPath);
$FileMajMin = "..\MajMin.vers"
$FileClickOnce = "Properties\PublishProfiles\ClickOnceProfile.pubxml"
$MajMin = Get-Content $FileMajMin # "6.14."
$currentDate = get-date -format yyMM;
$currentTime = get-date -format ddHH;
$currRelNum = $MajMin + $currentDate +"." + $currentTime
# fix csProj file
$csproj = Get-Content $ProjectPath
$find = "<Version>(.|\n)*?</Version>";
$replace = "<Version>" + $currRelNum + "</Version>";
$csprojUpdated = $csproj -replace $find, $replace
# fix clickonceFile
$coFile = Get-Content $FileClickOnce
$find = "<ApplicationRevision>(.|\n)*?</ApplicationRevision>";
$replace = "<ApplicationRevision>" + $currentTime + "</ApplicationRevision>";
$coFile = $coFile -replace $find, $replace
$find = "<ApplicationVersion>(.|\n)*?</ApplicationVersion>";
$replace = "<ApplicationVersion>" + $currRelNum + "</ApplicationVersion>";
$csFilejUpd = $coFile -replace $find, $replace
Set-Content -Path $ProjectPath -Value $csprojUpdated
Set-Content -Path $FileClickOnce -Value $csFilejUpd