-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
32 lines (32 loc) · 1.54 KB
/
Directory.Build.props
File metadata and controls
32 lines (32 loc) · 1.54 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
25
26
27
28
29
30
31
32
<Project>
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>0.2.0</Version>
</PropertyGroup>
<!-- Embed git short SHA into InformationalVersion (e.g. 0.1.0+abc1234) -->
<Target Name="SetSourceRevisionId" BeforeTargets="InitializeSourceControlInformation">
<Exec Command="git rev-parse --short HEAD" ConsoleToMSBuild="true" StandardOutputImportance="low" IgnoreExitCode="true">
<Output TaskParameter="ConsoleOutput" PropertyName="SourceRevisionId" />
</Exec>
</Target>
<PropertyGroup>
<SourceControlInformationFeatureSupported>true</SourceControlInformationFeatureSupported>
</PropertyGroup>
<!-- Embed git tag (if any) as assembly metadata -->
<Target Name="SetGitTag" BeforeTargets="CoreGenerateAssemblyInfo">
<Exec Command="git describe --tags --exact-match HEAD" ConsoleToMSBuild="true" StandardOutputImportance="low" StandardErrorImportance="low" IgnoreExitCode="true">
<Output TaskParameter="ConsoleOutput" PropertyName="_GitTag" />
<Output TaskParameter="ExitCode" PropertyName="_GitTagExitCode" />
</Exec>
<ItemGroup Condition="'$(_GitTagExitCode)' == '0' And '$(_GitTag)' != ''">
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>GitTag</_Parameter1>
<_Parameter2>$(_GitTag)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
</Target>
</Project>