-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
65 lines (57 loc) · 3.3 KB
/
Copy pathDirectory.Build.props
File metadata and controls
65 lines (57 loc) · 3.3 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<Project>
<PropertyGroup>
<!-- One compiler dialect for every project (the plugin previously pinned 8.0
while the test project silently defaulted to 7.3). net48 is a runtime
target — modern C# compiles fine against it except for features that
need runtime support (default interface members; records/init need the
IsExternalInit shim). -->
<LangVersion>latest</LangVersion>
<!-- Surface .editorconfig style rules (incl. IDE0130 namespace-folder match)
as build diagnostics, not IDE-only suggestions. -->
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<!-- Single source of truth for product versioning. -->
<VersionPrefix>0.7.0</VersionPrefix>
<Version Condition="'$(VersionSuffix)' == ''">$(VersionPrefix)</Version>
<Version Condition="'$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix)</Version>
<!-- Early-development policy: keep assembly and file versions in sync with VersionPrefix. -->
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<FileVersion>$(VersionPrefix).0</FileVersion>
<!-- Keep informational version user-friendly (e.g. "0.1.0" or "0.1.0-preview")
instead of appending +gitsha automatically. The commit hash is embedded
separately below as AssemblyMetadata so the About panel can show both. -->
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<!-- Default SimHub install path. Override in Directory.Build.props.user for your machine. -->
<SimHubDir Condition="'$(SimHubDir)' == ''">C:\Program Files (x86)\SimHub\</SimHubDir>
</PropertyGroup>
<!-- ── Build metadata ──────────────────────────────────────────────
Embedded as [AssemblyMetadata] attributes so the plugin About
panel can display version, configuration, and commit at runtime. -->
<!-- Configuration is always known statically. -->
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>BuildConfiguration</_Parameter1>
<_Parameter2>$(Configuration)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
<!-- Resolve short commit hash from git and emit as [AssemblyMetadata].
Uses a single target before GetAssemblyAttributes so the item is
visible when GenerateAssemblyInfo runs. -->
<Target Name="EmbedCommitHash" BeforeTargets="GetAssemblyAttributes"
Condition="'$(CommitHash)' == ''">
<Exec Command="git rev-parse --short HEAD" ConsoleToMsBuild="true"
IgnoreExitCode="true" StandardOutputImportance="low">
<Output TaskParameter="ConsoleOutput" PropertyName="CommitHash" />
<Output TaskParameter="ExitCode" PropertyName="_GitExitCode" />
</Exec>
<PropertyGroup Condition="'$(_GitExitCode)' != '0'">
<CommitHash></CommitHash>
</PropertyGroup>
<ItemGroup Condition="'$(CommitHash)' != ''">
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>CommitHash</_Parameter1>
<_Parameter2>$(CommitHash)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
</Target>
<Import Project="Directory.Build.props.user" Condition="Exists('Directory.Build.props.user')" />
</Project>