Files
psg-oversight-app/Directory.Build.props

47 lines
1.6 KiB
XML

<!--
This file allows for customizing your build process.
See: https://learn.microsoft.com/visualstudio/msbuild/customize-your-build
-->
<Project>
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>12</LangVersion>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<!--<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>-->
</PropertyGroup>
<PropertyGroup Label="User Secrets">
<UserSecretsId>1ef91ee6-7b55-474e-ab2b-2d164b723a56</UserSecretsId>
</PropertyGroup>
<!-- 🔹 Automatically derive version from latest Git tag -->
<Target Name="GetVersionFromGit" BeforeTargets="GetAssemblyVersion">
<!-- Get the most recent tag (like v1.1.1) -->
<Exec Command="git describe --tags --abbrev=0" ConsoleToMSBuild="true" IgnoreExitCode="true">
<Output TaskParameter="ConsoleOutput" PropertyName="GitTag" />
</Exec>
<!-- Strip leading 'v' if present -->
<PropertyGroup>
<GitVersion>$([System.Text.RegularExpressions.Regex]::Replace('$(GitTag)', '^v', ''))</GitVersion>
</PropertyGroup>
<!-- Fallback if no tags exist yet -->
<PropertyGroup Condition="'$(GitVersion)' == ''">
<GitVersion>0.0.0</GitVersion>
</PropertyGroup>
<!-- Apply to assembly and file versions -->
<Message Text="🔖 Using version: $(GitVersion)" Importance="High" />
<PropertyGroup>
<Version>$(GitVersion)</Version>
<FileVersion>$(GitVersion)</FileVersion>
<AssemblyVersion>$(GitVersion)</AssemblyVersion>
</PropertyGroup>
</Target>
</Project>