-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
24 lines (21 loc) · 1.42 KB
/
Directory.Build.props
File metadata and controls
24 lines (21 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<Project>
<PropertyGroup>
<!-- Version configuration - read from VERSION file or CI environment -->
<VersionPrefix>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)VERSION').Trim())</VersionPrefix>
<!-- Use minutes-since-midnight (0-1439) instead of HHmm to avoid SemVer leading zeros -->
<VersionSuffix Condition="'$(VersionSuffix)' == '' AND '$(Configuration)' == 'Debug'">dev.$([System.DateTime]::UtcNow.ToString('yyyyMMdd')).$([MSBuild]::Add($([MSBuild]::Multiply($([System.DateTime]::UtcNow.Hour), 60)), $([System.DateTime]::UtcNow.Minute)))</VersionSuffix>
<Version Condition="'$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix)</Version>
<Version Condition="'$(VersionSuffix)' == ''">$(VersionPrefix)</Version>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<FileVersion>$(VersionPrefix).0</FileVersion>
<InformationalVersion>$(Version)</InformationalVersion>
<!-- Treat all warnings as errors to match CI behaviour -->
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- Temporarily exclude nullable reference warnings while fixing incrementally -->
<!-- Remove these as warnings are fixed -->
<WarningsNotAsErrors>CS8600;CS8601;CS8602;CS8603;CS8604;CS1998</WarningsNotAsErrors>
<!-- Enforce code quality standards -->
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AnalysisLevel>latest</AnalysisLevel>
</PropertyGroup>
</Project>